Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Register ¶
Register your message handler with the message system. Name is the lookup name for the message, id is a free text field that you can use to identify your handler, and handler is the function that will be called when the message is sent.
There can be as many handlers as you want for a message. The id is used to identify the handler, so you can remove it later. Registering another handler with the same id will replace the old handler.
func SendMessage ¶
func SendMessage(name string, args interface{})
Send a message. The name is the lookup name for the message, and args is the data to be sent to the handler. Sendmessage calls the handler immediately (i.e. synchronously)
func Unregister ¶
Delete a handler. The name and id must be the same as the ones used to register the handler.
Types ¶
This section is empty.