Registering an event handler is easy: just provide a function with the right signature, and off you go. However, event handlers are triggered by events, and events might come in a different order than the one in which they need to be processed. Note that while this is not true with synchronous messaging - as it’s the case here - it’s still is harder to reason about than direct API calls.

To benefit from ordering anyway, one can store event handlers in different "buckets". Buckets can store handlers that don’t need to be ordered. At that point, one can invoke handlers from those buckets, starting with "Bucket 1", then "Bucket 2", etc. In the above design, there are 3 buckets: one for initialization handlers, one for work handlers, and the