MCPcopy
hub / github.com/tmrts/go-patterns / Notifier

Interface Notifier

behavioral/observer/main.go:28–39  ·  view source on GitHub ↗

Notifier is the instance being observed. Publisher is perhaps another decent name, but naming things is hard.

Source from the content-addressed store, hash-verified

26 // Notifier is the instance being observed. Publisher is perhaps another decent
27 // name, but naming things is hard.
28 Notifier interface {
29 // Register allows an instance to register itself to listen/observe
30 // events.
31 Register(Observer)
32 // Deregister allows an instance to remove itself from the collection
33 // of observers/listeners.
34 Deregister(Observer)
35 // Notify publishes new events to listeners. The method is not
36 // absolutely necessary, as each implementation could define this itself
37 // without losing functionality.
38 Notify(Event)
39 }
40)
41
42type (

Callers

nothing calls this directly

Implementers 1

eventNotifierbehavioral/observer/main.go

Calls

no outgoing calls

Tested by

no test coverage detected