Interface ISequence
- Namespace
- Silverback.Messaging.Sequences
- Assembly
- Silverback.Integration.dll
A set of logically related messages, like the chunks belonging to the same message or the messages in a dataset.
public interface ISequence : IDisposable
- Inherited Members
Properties
AbortException
Gets the exception that caused the abort, if any.
Exception? AbortException { get; }
Property Value
Remarks
This property is filled only when AbortReason is Error.
AbortReason
Gets the reason of the abort.
SequenceAbortReason AbortReason { get; }
Property Value
Context
Gets the ConsumerPipelineContext related to the processing of this sequence (usually the context of the first message that initiated the sequence).
ConsumerPipelineContext Context { get; }
Property Value
IsAborted
Gets a value indicating whether the sequence processing has been aborted and no further message will be pushed.
bool IsAborted { get; }
Property Value
IsBeingConsumed
Gets a value indicating whether the sequence is being consumed. This value is set to true as soon as
CreateStream<TMessage>(IReadOnlyCollection<IMessageFilter>?) is called and the output IMessageStreamEnumerable<TMessage> is created.
bool IsBeingConsumed { get; }
Property Value
IsComplete
Gets a value indicating whether all messages belonging to the sequence have been pushed and processed.
bool IsComplete { get; }
Property Value
IsCompleting
Gets a value indicating whether all messages belonging to the sequence have been pushed and the last message is currently being processed.
bool IsCompleting { get; }
Property Value
IsNew
Gets a value indicating whether the first message in the sequence was consumed and this instance was just created.
bool IsNew { get; }
Property Value
IsPending
Gets a value indicating whether the sequence is incomplete and awaiting for new messages to be pushed.
bool IsPending { get; }
Property Value
Length
Gets the length of the sequence so far.
int Length { get; }
Property Value
ParentSequence
Gets the ISequence that contain this sequence (e.g. the ChunkSequence whose aggregated message is added to a BatchSequence).
ISequence? ParentSequence { get; }
Property Value
SequenceId
Gets the identifier that is used to match the consumed messages with their belonging sequence.
string SequenceId { get; }
Property Value
Sequences
Gets the ISequence that were added to this sequence (e.g. the ChunkSequence whose aggregated message is added to a BatchSequence).
IReadOnlyCollection<ISequence> Sequences { get; }
Property Value
StreamProvider
Gets the IMessageStreamProvider that will be pushed with the messages belonging to the sequence.
IMessageStreamProvider StreamProvider { get; }
Property Value
TotalLength
Gets the declared total length of the sequence, if known.
int? TotalLength { get; }
Property Value
- int?
Methods
AbortAsync(SequenceAbortReason, Exception?)
Aborts the sequence processing. Used, for example, to signal that an exception occurred or the enumeration returned prematurely.
Task AbortAsync(SequenceAbortReason reason, Exception? exception = null)
Parameters
reasonSequenceAbortReasonThe abort reason.
exceptionExceptionThe exception that caused the abort if an exception was thrown.
Returns
AbortIfIncompleteAsync()
Aborts the sequence processing if it hasn't been completed (or aborted) yet.
Task AbortIfIncompleteAsync()
Returns
AddAsync(IRawInboundEnvelope, ISequence?, bool)
Adds the message to the sequence.
Task<AddToSequenceResult> AddAsync(IRawInboundEnvelope envelope, ISequence? sequence, bool throwIfUnhandled)
Parameters
envelopeIRawInboundEnvelopeThe envelope to be added to the sequence.
sequenceISequenceThe sequence to be added to the sequence.
throwIfUnhandledboolA boolean value indicating whether an exception must be thrown if no subscriber is handling the message.
Returns
- Task<AddToSequenceResult>
A Task<TResult> representing the asynchronous operation. The task result contains a flag indicating whether the operation was successful and the number of streams that have been actually pushed.
CreateStream<TMessage>(IReadOnlyCollection<IMessageFilter>?)
Creates a IMessageStreamEnumerable<TMessage> that will be pushed with the messages belonging to the sequence.
IMessageStreamEnumerable<TMessage> CreateStream<TMessage>(IReadOnlyCollection<IMessageFilter>? filters = null)
Parameters
filtersIReadOnlyCollection<IMessageFilter>The filters to be applied.
Returns
- IMessageStreamEnumerable<TMessage>
Type Parameters
TMessageThe type of the messages to be streamed.
GetCommitIdentifiers()
Gets the identifiers to be used to commit after successful processing.
IReadOnlyCollection<IBrokerMessageIdentifier> GetCommitIdentifiers()
Returns
- IReadOnlyCollection<IBrokerMessageIdentifier>
The identifiers to be used to commit.
GetRollbackIdentifiers()
Gets the identifiers to be used to roll back in case of error.
IReadOnlyCollection<IBrokerMessageIdentifier> GetRollbackIdentifiers()
Returns
- IReadOnlyCollection<IBrokerMessageIdentifier>
The identifiers to be used to rollback.