Interface ISequence
Represents a set of logically related messages, like the chunks belonging to the same message or the messages in a dataset.
Inherited Members
Namespace: Silverback.Messaging.Sequences
Assembly: Silverback.Integration.dll
Syntax
public interface ISequence : IDisposable
Properties
| Improve this doc View sourceAbortException
Gets the exception that caused the abort, if any.
Declaration
Exception? AbortException { get; }
Property Value
Type | Description |
---|---|
Exception |
Remarks
This property is filled only when AbortReason is Error.
AbortReason
Gets the reason of the abort.
Declaration
SequenceAbortReason AbortReason { get; }
Property Value
Type | Description |
---|---|
SequenceAbortReason |
Context
Gets the ConsumerPipelineContext related to the processing of this sequence (usually the context of the first message that initiated the sequence).
Declaration
ConsumerPipelineContext Context { get; }
Property Value
Type | Description |
---|---|
ConsumerPipelineContext |
IsAborted
Gets a value indicating whether the sequence processing has been aborted and no further message will be pushed.
Declaration
bool IsAborted { get; }
Property Value
Type | Description |
---|---|
bool |
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.
Declaration
bool IsBeingConsumed { get; }
Property Value
Type | Description |
---|---|
bool |
IsComplete
Gets a value indicating whether all messages belonging to the sequence have been pushed and processed.
Declaration
bool IsComplete { get; }
Property Value
Type | Description |
---|---|
bool |
IsCompleting
Gets a value indicating whether all messages belonging to the sequence have been pushed and the last message is currently being processed.
Declaration
bool IsCompleting { get; }
Property Value
Type | Description |
---|---|
bool |
IsNew
Gets a value indicating whether the first message in the sequence was consumed and this instance was just created.
Declaration
bool IsNew { get; }
Property Value
Type | Description |
---|---|
bool |
IsPending
Gets a value indicating whether the sequence is incomplete and awaiting for new messages to be pushed.
Declaration
bool IsPending { get; }
Property Value
Type | Description |
---|---|
bool |
Length
Gets the length of the sequence so far.
Declaration
int Length { get; }
Property Value
Type | Description |
---|---|
int |
ParentSequence
Gets the ISequence that contain this sequence (e.g. the ChunkSequence whose aggregated message is added to a BatchSequence.
Declaration
ISequence? ParentSequence { get; }
Property Value
Type | Description |
---|---|
ISequence |
SequenceId
Gets the identifier that is used to match the consumed messages with their belonging sequence.
Declaration
string SequenceId { get; }
Property Value
Type | Description |
---|---|
string |
Sequences
Gets the ISequence that were added to this sequence (e.g. the ChunkSequence whose aggregated message is added to a BatchSequence.
Declaration
IReadOnlyCollection<ISequence> Sequences { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<ISequence> |
StreamProvider
Gets the IMessageStreamProvider that will be pushed with the messages belonging to the sequence.
Declaration
IMessageStreamProvider StreamProvider { get; }
Property Value
Type | Description |
---|---|
IMessageStreamProvider |
TotalLength
Gets the declared total length of the sequence, if known.
Declaration
int? TotalLength { get; }
Property Value
Type | Description |
---|---|
int? |
Methods
| Improve this doc View sourceAbortAsync(SequenceAbortReason, Exception?)
Aborts the sequence processing. Used for example to signal that an exception occurred or the enumeration returned prematurely.
Declaration
Task AbortAsync(SequenceAbortReason reason, Exception? exception = null)
Parameters
Type | Name | Description |
---|---|---|
SequenceAbortReason | reason | The abort reason. |
Exception | exception | The exception that caused the abort, if an exception was thrown. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
AddAsync(IRawInboundEnvelope, ISequence?, bool)
Adds the message to the sequence.
Declaration
Task<AddToSequenceResult> AddAsync(IRawInboundEnvelope envelope, ISequence? sequence, bool throwIfUnhandled = true)
Parameters
Type | Name | Description |
---|---|---|
IRawInboundEnvelope | envelope | The envelope to be added to the sequence. |
ISequence | sequence | The sequence to be added to the sequence. |
bool | throwIfUnhandled | A boolean value indicating whether an exception must be thrown if no subscriber is handling the message. |
Returns
Type | Description |
---|---|
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.
Declaration
IMessageStreamEnumerable<TMessage> CreateStream<TMessage>(IReadOnlyCollection<IMessageFilter>? filters = null)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyCollection<IMessageFilter> | filters | The filters to be applied. |
Returns
Type | Description |
---|---|
IMessageStreamEnumerable<TMessage> |
Type Parameters
Name | Description |
---|---|
TMessage | The type of the messages to be streamed. |
GetBrokerMessageIdentifiers()
Gets the identifiers of the messages belonging to the sequence.
Declaration
IReadOnlyList<IBrokerMessageIdentifier> GetBrokerMessageIdentifiers()
Returns
Type | Description |
---|---|
IReadOnlyList<IBrokerMessageIdentifier> | The list of identifiers. |