Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscardEventMachine ¶
type DiscardEventMachine struct{}
DiscardEventMachine is an EventMachine which discards all emits.
func (*DiscardEventMachine) Emit ¶
func (*DiscardEventMachine) Emit(data interface{}, event Event)
func (*DiscardEventMachine) RegisterListener ¶
func (*DiscardEventMachine) RegisterListener(cb Callback, event Event) uint64
func (*DiscardEventMachine) UnregisterListener ¶
func (*DiscardEventMachine) UnregisterListener(id uint64) error
type Event ¶
type Event int32
Event is an event emitted by the account or account plugin.
const ( // emitted when a transfer was broadcasted. EventSentTransfer Event = iota // emitted when input selection is executed. EventDoingInputSelection // emitted when a new transfer is being prepared. EventPreparingTransfer // emitted when transactions to approve are fetched. EventGettingTransactionsToApprove // emitted when Proof-of-Work is being done. EventAttachingToTangle // emitted for internal errors of all kinds. EventError // emitted when the account got shutdown cleanly. EventShutdown )
type EventMachine ¶
type EventMachine interface { // Emit emits the given event with the given data. Emit(data interface{}, event Event) // Register registers the given channel to receive values for the given event. RegisterListener(cb Callback, event Event) uint64 // Unregister unregisters the given channel to receive events. UnregisterListener(uint64) error }
EventMachine defines an object which registers listeners and emits events.
func NewEventMachine ¶
func NewEventMachine() EventMachine
NewEventMachine creates a new EventMachine.
Click to show internal directories.
Click to hide internal directories.