Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stream ¶
type Stream struct { // Program specifies the source of the events - libvirt or QEMU. Program uint32 // CallbackID is returned by the event registration call. CallbackID int32 // contains filtered or unexported fields }
Stream is an unbounded buffered event channel. The implementation consists of a pair of unbuffered channels and a goroutine to manage them. Client behavior will not cause incoming events to block.
func NewStream ¶
NewStream configures a new Event Stream. Incoming events are appended to a queue, which is then relayed to the listening client. Client behavior will not cause incoming events to block. It is the responsibility of the caller to terminate the Stream via Shutdown() when no longer in use.
func (*Stream) Len ¶
Len will return the current count of events in the internal queue for a stream. It does this by sending a message to the stream's process() loop, which will then write the current length to the channel contained in that message.