Class ChunkSequence
- Namespace
- Silverback.Messaging.Sequences.Chunking
- Assembly
- Silverback.Integration.dll
A sequence of chunks that belong to the same message.
public class ChunkSequence : RawSequence, ISequence, IDisposable
- Inheritance
-
ChunkSequence
- Implements
- Inherited Members
Constructors
ChunkSequence(string, int?, ConsumerPipelineContext)
Initializes a new instance of the ChunkSequence class.
public ChunkSequence(string sequenceId, int? totalLength, ConsumerPipelineContext context)
Parameters
sequenceIdstringThe identifier that is used to match the consumed messages with their belonging sequence.
totalLengthint?The expected total length of the sequence.
contextConsumerPipelineContextThe 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.
protected override Task<AddToSequenceResult> AddCoreAsync(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.
IsLastMessage(IRawInboundEnvelope)
Implements the logic to recognize the last message in the sequence without relying on the TotalCount property.
protected override bool IsLastMessage(IRawInboundEnvelope envelope)
Parameters
envelopeIRawInboundEnvelopeThe envelope to be added to the sequence.
Returns
- bool
trueif it is the last message, otherwisefalse.