Dry-events & async

Right now, dry-events is fully synchronous.

I experience drawbacks in my app: when a single event handler fails (exception), then the whole parent workflow fails. Typically with no retry unless it’s in a job (not the case when responding to a request).

I would like to turn part or all of the events subscriptions to async without writing a specific job for each event handler.

Maybe this topic has already been thought upon by the team? If not, I am willing to contribute a general way of doing that to dry-events if the team thinks it’s a good direction.

I don’t know how to do that yet, and that would require designing a proper abstraction to be async-framework agnostic (Sidekiq or other). But if it sounds good, I would put some time into it.

Yes that’s pretty much on purpose. For now dry-events is a very very basic pub/sub and I’m not yet sure if we want to turn it into a bigger project. It’s possible that I’ll end up moving it to dry-core, actually. Calling it dry-events was probably a mistake :confused:

This could be handled via config, something like fail_fast and used here https://github.com/dry-rb/dry-events/blob/b627942f0a375a835a3aabda0a9cd63c1dc86208/lib/dry/events/bus.rb#L46