Documentation ¶
Overview ¶
Provide simplistic application-wide message bus.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Call ¶ added in v1.0.58
Call sends a message to the address specified as an argument, and waits for the response.
func CallWithContext ¶ added in v1.0.59
CallWithContext sends a message to the address specified as an argument, and waits for the response.
func Consume ¶
func Consume[M any](address string, handler func(*M, CallContext)) func()
Consume registers a consumer for messages sent to the address specified as an argument. Handler is called for each published message inside its own panic-safe goroutine.
Types ¶
type CallContext ¶ added in v1.0.58
type CallContext interface { // Reply sends a reply back to caller. Reply(reply any) }
CallContext is a context passed to an event bus handler. It allows consumers to send replies.
Click to show internal directories.
Click to hide internal directories.