Class ChunkSequence
A sequence of chunks that belong to the same message.
Inherited Members
Namespace: Silverback.Messaging.Sequences.Chunking
Assembly: Silverback.Integration.dll
Syntax
public class ChunkSequence : RawSequence, ISequence, IDisposable
Constructors
ChunkSequence(string, int?, ConsumerPipelineContext)
Initializes a new instance of the ChunkSequence class.
Declaration
public ChunkSequence(string sequenceId, int? totalLength, ConsumerPipelineContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| string | sequenceId | The identifier that is used to match the consumed messages with their belonging sequence. |
| int? | totalLength | The expected total length of the sequence. |
| ConsumerPipelineContext | context | The current ConsumerPipelineContext, assuming that it will be the one from which the sequence gets published via the message bus. |
Methods
AddCoreAsync(IRawInboundEnvelope, ISequence?, bool)
Adds the message to the sequence.
Declaration
protected override ValueTask<AddToSequenceResult> AddCoreAsync(IRawInboundEnvelope envelope, ISequence? sequence, bool throwIfUnhandled)
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 |
|---|---|
| ValueTask<AddToSequenceResult> | A ValueTask<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. |
Overrides
IsLastMessage(IRawInboundEnvelope)
Implements the logic to recognize the last message in the sequence without relying on the TotalCount property.
Declaration
protected override bool IsLastMessage(IRawInboundEnvelope envelope)
Parameters
| Type | Name | Description |
|---|---|---|
| IRawInboundEnvelope | envelope | The envelope to be added to the sequence. |
Returns
| Type | Description |
|---|---|
| bool |
|