Skip to content

IInbox

interface

Namespace: Orleans.Durable.Messaging

Registers handlers for the messages delivered to a grain's inbox.
public interface IInbox

Remarks

Each message is dispatched to the first registered handler which can handle it. Handlers can be registered at any time. InboxExtensions registers typed subject handlers.

A grain receives messages by resolving its inbox during construction or activation setup, typically by constructor injection, so the inbox recovers with the grain's journal.

A handler decodes the body, performs asynchronous I/O, validates local results, and checks cancellation before the first shared business or journaled mutation. From that mutation until it returns, it executes synchronously: it applies safe-to-commit business changes, stages outgoing messages through IOutbox, and calls IInboxHandlerContext or IInboxHandlerContext. The runtime persists the outcome with those changes. Failures before a terminal operation follow the inbox retry and dead-letter policy.

Methods