camirmas / grapple

:green_apple: Webhook magic in Elixir
MIT License
50 stars 4 forks source link

Make Webhook requests run in parallel #8

Closed camirmas closed 8 years ago

camirmas commented 8 years ago

Right now we simply iterate through the list of Hooks with Enum. This can lead to bottlenecks in the case where we have a very large list of hooks to execute.

Possibly consider GenStage, which will allow us to execute hooks in parallel. Once finished, hooks can be added to Grapple.Logger. Since hooks do not depend on one another and ordering doesn't matter, this distributed approach should provide strong benefits.

https://hexdocs.pm/gen_stage/Experimental.Flow.html https://hexdocs.pm/gen_stage/Experimental.Flow.html#module-supervisable-flows

slurmulon commented 8 years ago

Having some clear-minded insomnia, going to take a slight stab at this.

slurmulon commented 8 years ago

Just did some basic wiring (added deps, imported into hook.ex). We should investigate this more: https://hexdocs.pm/gen_stage/Experimental.Flow.html#module-supervisable-flows