-
Notifications
You must be signed in to change notification settings - Fork 0
IActivateHandlers
IActivateHandlers
is the handler activator, and it should be able to instantiate and release handlers.
When a message comes in and needs to be handled, Rebus will call GetHandlerInstancesFor<TMessage>()
on it, expecting in return a sequence of objects that implements IHandleMessages<TMessage>
.
After passing the gross sequence of handlers through the available implementation of IInspectHandlerPipeline
, the resulting pipeline will be invoked for each logical message contained in the received physical transport message.
In the end, the entire sequence of handler instances (i.e. the union of those returned by the handler activator and those returned by the pipeline inspector) will be passed to the Release
function of the handler activator, allowing it to clean up resources and dispose of stuff that needs to be disposed.
This also means that the handler activator will get to release handlers that it did not create if your implementation of IInspectHandlerPipeline
adds new handlers.