Skip to content

Commit e2bac56

Browse files
author
José Valim
committed
Reply to GenEvent manager from stream right away
This way the GenEvent can start processing the other handlers, reducing the processing time for each event from sum(handlers) to max(handlers).
1 parent a38e6b7 commit e2bac56

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/elixir/lib/gen_event.ex

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -518,11 +518,8 @@ defimpl Enumerable, for: GenEvent.Stream do
518518
{nil, _manager, event}, acc ->
519519
fun.(event, acc)
520520
{ref, manager, event}, acc ->
521-
try do
522-
fun.(event, acc)
523-
after
524-
send manager, {ref, :next}
525-
end
521+
send manager, {ref, :next}
522+
fun.(event, acc)
526523
end
527524
end
528525

0 commit comments

Comments
 (0)