# Dry-events & async

**URL:** <https://discourse.dry-rb.org/t/dry-events-async/1265>\
**Category:** Ideas\
**Created:** [May 13, 2021, 9:42am UTC](https://discourse.dry-rb.org/t/dry-events-async/1265 "2021-05-13T09:42:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MicMicMon](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/micmicmon/32/495_2.png) [@MicMicMon](https://discourse.dry-rb.org/u/MicMicMon)\
**Post date:** [May 13, 2021, 9:42am UTC](https://discourse.dry-rb.org/t/dry-events-async/1265/1 "2021-05-13T09:42:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![solnic](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/solnic/32/779_2.png) [@solnic](https://discourse.dry-rb.org/u/solnic)\
**Post date:** [May 15, 2021, 9:00am UTC](https://discourse.dry-rb.org/t/dry-events-async/1265/2 "2021-05-15T09:00:34Z")

</div>

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 😕

---

<div class="post-metadata">

**Author:** ![solnic](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/solnic/32/779_2.png) [@solnic](https://discourse.dry-rb.org/u/solnic)\
**Post date:** [May 15, 2021, 9:14am UTC](https://discourse.dry-rb.org/t/dry-events-async/1265/3 "2021-05-15T09:14:25Z")

</div>

> [@MicMicMon](#):
>
> 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)

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](https://github.com/dry-rb/dry-events/blob/b627942f0a375a835a3aabda0a9cd63c1dc86208/lib/dry/events/bus.rb#L46)
