kataras / go-events

:mega: Pure nodejs EventEmmiter for the Go Programming Language.
MIT License
98 stars 15 forks source link

Calling the RemoveListener event in the Emit event will cause a deadlock #7

Open zishang520 opened 2 years ago

zishang520 commented 2 years ago

Calling the RemoveListener event in the Emit event will cause a deadlock:

foo := func(...any){
}
event.On("test", func(...any){
    event.RemoveListener("other",foo)
})

event.Emit("test")
zishang520 commented 2 years ago

And RemoveListener cannot remove events added by Once