Documentation ¶
Overview ¶
Package event provides some primitives that are used for message passing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { Name EventName Resp Resp // channel to send an ack response on, nil to skip //Wg *sync.WaitGroup // receiver barrier to Wait() for everyone else on Msg string // some words for fun Activity bool // did something interesting happen? }
Event is the main struct that stores event information and responses.
func (*Event) ACK ¶
func (event *Event) ACK()
ACK sends a single acknowledgement on the channel if one was requested.
func (*Event) ACKNACK ¶
ACKNACK sends a custom ACK or NACK message on the channel if one was requested.
func (*Event) GetActivity ¶
GetActivity returns the activity value.
type Resp ¶
type Resp chan error
Resp is a channel to be used for boolean responses. A nil represents an ACK, and a non-nil represents a NACK (false). This also lets us use custom errors.
func NewResp ¶
func NewResp() Resp
NewResp is just a helper to return the right type of response channel.
Click to show internal directories.
Click to hide internal directories.