Table of Contents

Interface IMessageContextPool

Namespace
Excalibur.Dispatch.Messaging
Assembly
Excalibur.Dispatch.Abstractions.dll

Defines a pool for reusable message context instances.

public interface IMessageContextPool
Extension Methods

Methods

Rent()

Rents a message context from the pool without initializing it with a message.

IMessageContext Rent()

Returns

IMessageContext

A message context from the pool with Message unset.

Remarks

Use this overload when the message will be set later during the dispatch pipeline. This enables lazy message binding for scenarios where the context needs to be created before the message is available.

Rent(IDispatchMessage)

Rents a message context from the pool, initializing it with the specified message.

IMessageContext Rent(IDispatchMessage message)

Parameters

message IDispatchMessage

The dispatch message to associate with the context.

Returns

IMessageContext

A message context from the pool.

ReturnToPool(IMessageContext)

Returns a message context to the pool for reuse.

void ReturnToPool(IMessageContext context)

Parameters

context IMessageContext

The context to return.