Skip to content

OutboxExtensions Methods

Extensions for encoding and staging typed messages and replies.

Send(IOutbox, MessageType<T>, IEnumerable<MessageId MessageId, GrainId Destination, T Body)>)

staticextension
View source
public static void Send<T>(this IOutbox outbox, MessageType<T> messageType, IEnumerable<(MessageId MessageId, GrainId Destination, T Body)> messages)
Encodes and synchronously stages typed commands in enumeration order.

Parameters

outboxIOutbox
The owning grain's outbox.
messageTypeMessageType<T>
The subject and serializer binding.
messagesIEnumerable<MessageId MessageId, GrainId Destination, T Body)>
The application-defined identities, destinations, and bodies.

Send(IOutbox, MessageType<T>, MessageId, GrainId, T, DateTimeOffset?)

staticextension
View source
public static void Send<T>(this IOutbox outbox, MessageType<T> messageType, MessageId messageId, GrainId destination, T body, DateTimeOffset? deliverAt = null)
Encodes and synchronously stages one typed command.

Parameters

outboxIOutbox
The owning grain's outbox.
messageTypeMessageType<T>
The subject and serializer binding.
messageIdMessageId
The stable application command identity.
destinationGrainId
The destination inbox.
bodyT
The body to encode.
deliverAtDateTimeOffset?
The optional earliest time, on the Durable Jobs clock, at which the receiving inbox processes the message. The outbox still delivers the message immediately. See Envelope.

Send(IOutbox, MessageType<T>, MessageId, IAddressable, T, DateTimeOffset?)

staticextension
View source
public static void Send<T>(this IOutbox outbox, MessageType<T> messageType, MessageId messageId, IAddressable destination, T body, DateTimeOffset? deliverAt = null)
Encodes and synchronously stages one typed command to a grain reference.

Parameters

outboxIOutbox
The owning grain's outbox.
messageTypeMessageType<T>
The subject and serializer binding.
messageIdMessageId
The stable application command identity.
destinationIAddressable
The destination grain.
bodyT
The body to encode.
deliverAtDateTimeOffset?
The optional earliest time, on the Durable Jobs clock, at which the receiving inbox processes the message. The outbox still delivers the message immediately. See Envelope.

SendReply(IOutbox, MessageType<T>, IInboxHandlerContext, GrainId, T)

staticextension
View source
public static void SendReply<T>(this IOutbox outbox, MessageType<T> messageType, IInboxHandlerContext context, GrainId destination, T body)
Encodes and stages a reply under the received command's deterministic result child.

Parameters

outboxIOutbox
The replying grain's outbox.
messageTypeMessageType<T>
The reply subject and serializer binding.
contextIInboxHandlerContext
The current received message and completion context.
destinationGrainId
The application-selected reply destination.
bodyT
The reply body.

SendReply(IOutbox, MessageType<T>, IInboxHandlerContext, IAddressable, T)

staticextension
View source
public static void SendReply<T>(this IOutbox outbox, MessageType<T> messageType, IInboxHandlerContext context, IAddressable destination, T body)
Encodes and stages a deterministic result reply to a grain reference.

Parameters

outboxIOutbox
The replying grain's outbox.
messageTypeMessageType<T>
The reply subject and serializer binding.
contextIInboxHandlerContext
The current received message and completion context.
destinationIAddressable
The application-selected replying grain reference.
bodyT
The reply body.