Documentation ¶
Overview ¶
Package notify provides a simple notification system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Publish ¶
Publish sends an event with a payload to all subscribers. If a callback is provided, it returns the first successful response that matches the response filter.
func Subscribe ¶
func Subscribe(event uint32, subscriber Subscriber[any])
Subscribe adds a subscriber to the specified event.
func UnSubscribe ¶
func UnSubscribe(event uint32, subscriber Subscriber[any])
UnSubscribe removes a subscriber from the specified event.
Types ¶
type Publisher ¶
type Publisher[T any] interface { Subscribe(event *int, subscriber Subscriber[T]) UnSubscribe(subscriber Subscriber[T]) }
Click to show internal directories.
Click to hide internal directories.