Interface IMessagePool
Provides a mechanism to recycle IMessage instances, reducing garbage allocation.
Namespace: Unity.SimulationPro.Foundation
Assembly: Unity.SimulationPro.Foundation.dll
Syntax
public interface IMessagePool
Remarks
Assign an IMessagePool to an IPublisher via SetMessagePool(IMessagePool) to enable message pooling on that publisher.
Methods
AddMessage(IMessage)
Returns a message to the pool so it can be reused.
Declaration
void AddMessage(IMessage messageToRecycle)
Parameters
| Type | Name | Description |
|---|---|---|
| IMessage | messageToRecycle | The message instance to recycle. Must match the message type managed by this pool. |