withHandler

Registers an event handler for the specified event type.

This method allows dynamic registration of event handlers after the container has been created. The operation is thread-safe.

Return

A new EventDrivenStateContainer with the added handler

Parameters

eventClass

The class of events to handle

handler

The handler for the events