@@ -601,19 +601,15 @@ defmodule GenEvent do
601
601
reply ( tag , reply )
602
602
loop ( parent , name , handlers , debug , hib )
603
603
{ _from , tag , { :add_handler , handler , args } } ->
604
- { hib , reply , handlers } = server_add_handler ( handler , args , handlers , nil )
605
- reply ( tag , reply )
606
- loop ( parent , name , handlers , debug , hib )
607
- { _from , tag , { :add_handler , handler , args , notify } } ->
608
- { hib , reply , handlers } = server_add_handler ( handler , args , handlers , notify )
604
+ { hib , reply , handlers } = server_add_handler ( handler , args , handlers )
609
605
reply ( tag , reply )
610
606
loop ( parent , name , handlers , debug , hib )
611
607
{ _from , tag , { :add_mon_handler , handler , args , notify } } ->
612
608
{ hib , reply , handlers } = server_add_mon_handler ( handler , args , handlers , notify )
613
609
reply ( tag , reply )
614
610
loop ( parent , name , handlers , debug , hib )
615
- { _from , tag , { :add_process_handler , pid , notify , ref } } ->
616
- { hib , reply , handlers } = server_add_process_handler ( pid , handlers , notify , ref )
611
+ { _from , tag , { :add_process_handler , pid , notify } } ->
612
+ { hib , reply , handlers } = server_add_process_handler ( pid , handlers , notify )
617
613
reply ( tag , reply )
618
614
loop ( parent , name , handlers , debug , hib )
619
615
{ _from , tag , { :delete_handler , handler , args } } ->
@@ -739,13 +735,13 @@ defmodule GenEvent do
739
735
IO . puts dev , "*DBG* #{ inspect name } : #{ inspect dbg } "
740
736
end
741
737
742
- defp server_add_handler ( { module , id } , args , handlers , notify ) do
743
- handler = handler ( module: module , id: { module , id } , pid: notify )
738
+ defp server_add_handler ( { module , id } , args , handlers ) do
739
+ handler = handler ( module: module , id: { module , id } )
744
740
do_add_handler ( module , handler , args , handlers , :ok )
745
741
end
746
742
747
- defp server_add_handler ( module , args , handlers , notify ) do
748
- handler = handler ( module: module , id: module , pid: notify )
743
+ defp server_add_handler ( module , args , handlers ) do
744
+ handler = handler ( module: module , id: module )
749
745
do_add_handler ( module , handler , args , handlers , :ok )
750
746
end
751
747
@@ -761,8 +757,8 @@ defmodule GenEvent do
761
757
do_add_handler ( module , handler , args , handlers , :ok )
762
758
end
763
759
764
- defp server_add_process_handler ( pid , handlers , notify , ref ) do
765
- ref = ref || Process . monitor ( pid )
760
+ defp server_add_process_handler ( pid , handlers , notify ) do
761
+ ref = Process . monitor ( pid )
766
762
handler = handler ( module: GenEvent.Stream , id: { self ( ) , ref } ,
767
763
pid: notify , ref: ref )
768
764
do_add_handler ( GenEvent.Stream , handler , { pid , ref } , handlers , { self ( ) , ref } )
@@ -779,7 +775,7 @@ defmodule GenEvent do
779
775
if sup do
780
776
server_add_mon_handler ( module2 , { args2 , state } , handlers , sup )
781
777
else
782
- server_add_handler ( module2 , { args2 , state } , handlers , nil )
778
+ server_add_handler ( module2 , { args2 , state } , handlers )
783
779
end
784
780
end
785
781
0 commit comments