Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultPolling = time.Millisecond * time.Duration(200)
Variables ¶
View Source
var (
Error = New("error")
)
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { ID ID Data interface{} }
Event represents a system event that is returned from an event source
type GenericSource ¶ added in v0.10.0
type GenericSource struct {
// contains filtered or unexported fields
}
GenericSource represents a helper struct for generating custom event sources
func (*GenericSource) Close ¶ added in v0.10.0
func (src *GenericSource) Close() error
func (*GenericSource) EventID ¶ added in v0.10.0
func (src *GenericSource) EventID() ID
func (*GenericSource) Ready ¶ added in v0.10.0
func (src *GenericSource) Ready() <-chan struct{}
func (*GenericSource) Recv ¶ added in v0.10.0
func (src *GenericSource) Recv() (Event, error)
func (*GenericSource) RecvMsg ¶ added in v0.10.0
func (src *GenericSource) RecvMsg(m interface{}) error
type Handler ¶ added in v0.10.0
Handler represents a function that is called when a particular event occurs Returned boolean value indicates whether the handler needs to be called again False value indicated that it needs to be removed and never called again
type Listener ¶ added in v0.10.0
type Listener struct { ID ListenerID EventID ID Handler Handler }
Listener is an internal listener representation
type ListenerCollection ¶ added in v0.10.0
type ListenerCollection struct {
// contains filtered or unexported fields
}
func NewListenerCollection ¶ added in v0.10.0
func NewListenerCollection() *ListenerCollection
func (*ListenerCollection) Add ¶ added in v0.10.0
func (lc *ListenerCollection) Add(listener Listener)
func (*ListenerCollection) Remove ¶ added in v0.10.0
func (lc *ListenerCollection) Remove(eventID ID, listenerID ListenerID)
func (*ListenerCollection) Size ¶ added in v0.10.0
func (lc *ListenerCollection) Size(eventID ID) int
func (*ListenerCollection) Values ¶ added in v0.10.0
func (lc *ListenerCollection) Values(eventID ID) []Listener
type ListenerID ¶ added in v0.10.0
type ListenerID int
ListenerID is an internal listener ID that can be used to unsubscribe from a particular event
type Loop ¶ added in v0.10.0
type Loop struct {
// contains filtered or unexported fields
}
func (*Loop) AddListener ¶ added in v0.10.0
func (loop *Loop) AddListener(eventID ID, handler Handler) ListenerID
func (*Loop) RemoveListener ¶ added in v0.10.0
func (loop *Loop) RemoveListener(eventID ID, listenerID ListenerID)
func (*Loop) RemoveSource ¶ added in v0.10.0
type SourceCollection ¶ added in v0.10.0
type SourceCollection struct {
// contains filtered or unexported fields
}
func NewSourceCollection ¶ added in v0.10.0
func NewSourceCollection() *SourceCollection
func (*SourceCollection) Add ¶ added in v0.10.0
func (sc *SourceCollection) Add(source Source)
func (*SourceCollection) Close ¶ added in v0.10.0
func (sc *SourceCollection) Close() error
func (*SourceCollection) Get ¶ added in v0.10.0
func (sc *SourceCollection) Get(idx int) (Source, error)
func (*SourceCollection) Remove ¶ added in v0.10.0
func (sc *SourceCollection) Remove(source Source) bool
func (*SourceCollection) Size ¶ added in v0.10.0
func (sc *SourceCollection) Size() int
type WaitTask ¶
type WaitTask struct {
// contains filtered or unexported fields
}
func NewEvalWaitTask ¶
func NewValueWaitTask ¶ added in v0.7.0
Click to show internal directories.
Click to hide internal directories.