Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/chuckpreslar/emission
/ functions
Functions
23 in github.com/chuckpreslar/emission
⨍
Functions
23
◇
Types & classes
3
↓ 11 callers
Method
AddListener
AddListener appends the listener argument to the event arguments slice in the Emitter's events map. If the number of listeners for an event is greater
emitter.go:41
↓ 11 callers
Function
NewEmitter
NewEmitter returns a new Emitter object, defaulting the number of maximum listeners per event to the DefaultMaxListeners constant and initializing its
emitter.go:307
↓ 6 callers
Method
Emit
Emit attempts to use the reflect package to Call each listener stored in the Emitter's events map with the supplied arguments. Each listener is called
emitter.go:157
↓ 6 callers
Method
RemoveListener
RemoveListener removes the listener argument from the event arguments slice in the Emitter's events map. If the reflect Value of the listener does no
emitter.go:74
↓ 3 callers
Method
GetListenerCount
GetListenerCount gets count of listeners for a given event.
emitter.go:295
↓ 2 callers
Method
On
On is an alias for AddListener.
emitter.go:66
↓ 2 callers
Method
Once
Once generates a new function which invokes the supplied listener only once before removing itself from the event's listener slice in the Emitter's ev
emitter.go:117
↓ 1 callers
Method
EmitSync
EmitSync attempts to use the reflect package to Call each listener stored in the Emitter's events map with the supplied arguments. Each listener is ca
emitter.go:223
↓ 1 callers
Method
RecoverWith
RecoverWith sets the listener to call when a panic occurs, recovering from panics and attempting to keep the application from crashing.
emitter.go:276
Method
Off
Off is an alias for RemoveListener.
emitter.go:108
Method
Receiver
(evt string)
emitter_test.go:135
Method
SetMaxListeners
SetMaxListeners sets the maximum number of listeners per event for the Emitter. If -1 is passed as the maximum, all events may have unlimited listener
emitter.go:286
Function
TestAddListener
(t *testing.T)
emitter_test.go:7
Function
TestCountListener
(t *testing.T)
emitter_test.go:118
Function
TestEmit
(t *testing.T)
emitter_test.go:18
Function
TestEmitSync
(t *testing.T)
emitter_test.go:31
Function
TestEmitWithMultipleListeners
(t *testing.T)
emitter_test.go:44
Function
TestOnce
(t *testing.T)
emitter_test.go:75
Function
TestRecoveryWith
(t *testing.T)
emitter_test.go:89
Function
TestRemoveDoubleListener
(t *testing.T)
emitter_test.go:148
Function
TestRemoveListener
(t *testing.T)
emitter_test.go:62
Function
TestRemoveOnce
(t *testing.T)
emitter_test.go:103
Function
TestRemoveStructMethod
(t *testing.T)
emitter_test.go:137