acutario / ravenx

Notification dispatch library for Elixir applications
MIT License
110 stars 8 forks source link

Run Synchronous Dispatch outside the context of a Supervisor #36

Closed ponty96 closed 6 years ago

ponty96 commented 6 years ago

In PR #35 notifications are all dispatched using a Task.Supervisor which is the right way to go! Unfortunately not all possible use cases are covered.

Example: A user might want to dispatch a stream of notifications using Task.Supervisor.async_stream/4 which is currently not provided!

The solution to this kind of problems which could easily arise, it did for me, is to provide a function that is totally synchronous and is not run under the context of a Task or a Task.Supervisor.

This way users can easily use whatever method, either a Task or a Task.Supervisor, which suits their use case better

odarriba commented 6 years ago

Sorry for the delay on checking this!

Looks good to me, and it make sense on the usecase you provided.