events

package
v0.0.0-...-0cbfbfe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2013 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QueueName

func QueueName(event string, src EventSource) string

QueueName returns a canonical name for the channel that should be used for events of the given type and for the specified event source.

Types

type Cancellation

type Cancellation struct {
	Subscription
}

func (Cancellation) EventName

func (s Cancellation) EventName() string

type Event

type Event interface {
	EventName() string
}

type EventBus

type EventBus struct {
	// contains filtered or unexported fields
}

func (*EventBus) Init

func (bus *EventBus) Init()

func (*EventBus) Run

func (bus *EventBus) Run()

func (*EventBus) Shutdown

func (bus *EventBus) Shutdown()

func (*EventBus) Subscribe

func (bus *EventBus) Subscribe(subscriber EventSource, event string, source EventSource)

func (*EventBus) Trigger

func (bus *EventBus) Trigger(event Event, source EventSource)

func (*EventBus) Unsubscribe

func (bus *EventBus) Unsubscribe(subscriber EventSource, event string, source EventSource)

type EventChannel

type EventChannel chan Event

type EventMessage

type EventMessage struct {
	Content Event
	Source  EventSource
}

func (EventMessage) EventName

func (msg EventMessage) EventName() string

type EventQueue

type EventQueue struct {
	Relay       EventChannel
	Subscribers map[Subscription]EventSource
}

func NewEventQueue

func NewEventQueue() *EventQueue

type EventSource

type EventSource interface {
	// Channel that triggered events are send into
	EventChannel() EventChannel

	// Unique Identifier for this event source
	EventSourceID() uint64
}

type EventTransmitter

type EventTransmitter interface {
	// Subscribes to events of given type and optionally (source > 0) to events
	// triggered by a specific other entity only
	Subscribe(subscriber EventSource, event string, source EventSource)
	Unsubscribe(subscriber EventSource, event string, source EventSource)

	// Triggers an event providing the ID of the originating entity
	Trigger(event Event, source EventSource)
}

type PropertyChanged

type PropertyChanged struct {
}

type Subscription

type Subscription struct {
	Subscriber EventSource
	EventType  string
	Source     EventSource
}

func (Subscription) EventName

func (s Subscription) EventName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL