Table of Contents

Class MessageBatch

Namespace
DotCompute.Abstractions.Messaging
Assembly
DotCompute.Abstractions.dll

Represents a batch of messages ready for transmission.

public sealed class MessageBatch : IDisposable
Inheritance
MessageBatch
Implements
Inherited Members
Extension Methods

Constructors

MessageBatch(Guid, int, long, DateTimeOffset, DateTimeOffset, ReadOnlyMemory<byte>, IReadOnlyList<BatchedMessageInfo>, bool)

Creates a new message batch.

public MessageBatch(Guid batchId, int messageCount, long payloadSize, DateTimeOffset createdAt, DateTimeOffset flushedAt, ReadOnlyMemory<byte> payload, IReadOnlyList<BatchedMessageInfo> messageInfos, bool isCompressed = false)

Parameters

batchId Guid
messageCount int
payloadSize long
createdAt DateTimeOffset
flushedAt DateTimeOffset
payload ReadOnlyMemory<byte>
messageInfos IReadOnlyList<BatchedMessageInfo>
isCompressed bool

Properties

BatchId

Gets the unique identifier for this batch.

public Guid BatchId { get; }

Property Value

Guid

CreatedAt

Gets when the batch was created.

public DateTimeOffset CreatedAt { get; }

Property Value

DateTimeOffset

FlushedAt

Gets when the batch was flushed.

public DateTimeOffset FlushedAt { get; }

Property Value

DateTimeOffset

IsCompressed

Gets whether the payload is compressed.

public bool IsCompressed { get; }

Property Value

bool

MessageCount

Gets the number of messages in the batch.

public int MessageCount { get; }

Property Value

int

MessageInfos

Gets the message type information for deserializing the batch.

public IReadOnlyList<BatchedMessageInfo> MessageInfos { get; }

Property Value

IReadOnlyList<BatchedMessageInfo>

Payload

Gets the serialized batch payload.

public ReadOnlyMemory<byte> Payload { get; }

Property Value

ReadOnlyMemory<byte>

PayloadSize

Gets the total payload size in bytes.

public long PayloadSize { get; }

Property Value

long

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()