Documentation ¶
Index ¶
- type Config
- type EventStateMachine
- type Processor
- func (processor *Processor) AcknowledgeEvent(ack types.Ack)
- func (processor *Processor) AddResult(result types.Result)
- func (processor *Processor) CompleteEvent(idbytes []byte)
- func (processor *Processor) GetEvent(idbytes []byte) (ulid.ULID, *EventStateMachine, bool)
- func (processor *Processor) NewEvent(event types.Event, dispatching bool)
- func (processor *Processor) Prune()
- func (processor *Processor) Start()
- func (processor *Processor) WaitForResult(idbytes []byte) *types.Result
- type ServerNode
- func (server *ServerNode) DispatchRandom(msg types.Event)
- func (server *ServerNode) Handle(ctx noise.HandlerContext) error
- func (server *ServerNode) Peers() (int, []noise.ID)
- func (server *ServerNode) ProcessEvent(event types.Event)
- func (server *ServerNode) SendToID(id noise.ID, msg noise.Serializable) error
- func (server *ServerNode) SendToIdBytes(id []byte, msg noise.Serializable)
- func (server *ServerNode) SendToNetwork(msg noise.Serializable)
- func (server *ServerNode) SendToNetworkSync(msg noise.Serializable)
- func (server *ServerNode) SetEventHandler(handler func(event types.Event) (types.Result, error))
- func (server *ServerNode) SetEventProcessor(handler func(event types.Event))
- func (server *ServerNode) SetResultHandler(handler func(event types.Result) error)
- func (server *ServerNode) Start()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventStateMachine ¶
type Processor ¶
type Processor struct { State map[string]*EventStateMachine Events *queue.Queue Process func(event types.Event) EventHandler func(event types.Event) (types.Result, error) ResultHandler func(event types.Result) error Standalone bool Lock sync.Mutex //required to protect queue during removal }
func NewEventProcessor ¶
func NewEventProcessor() *Processor
func (*Processor) AcknowledgeEvent ¶
func (*Processor) CompleteEvent ¶
func (*Processor) GetEvent ¶
func (processor *Processor) GetEvent(idbytes []byte) (ulid.ULID, *EventStateMachine, bool)
type ServerNode ¶
type ServerNode struct { Config Config Node *noise.Node Overlay *kademlia.Protocol EventProcessor *Processor }
func NewServerNode ¶
func NewServerNode(config Config) *ServerNode
func (*ServerNode) DispatchRandom ¶
func (server *ServerNode) DispatchRandom(msg types.Event)
func (*ServerNode) Handle ¶
func (server *ServerNode) Handle(ctx noise.HandlerContext) error
func (*ServerNode) ProcessEvent ¶
func (server *ServerNode) ProcessEvent(event types.Event)
func (*ServerNode) SendToID ¶
func (server *ServerNode) SendToID(id noise.ID, msg noise.Serializable) error
func (*ServerNode) SendToIdBytes ¶
func (server *ServerNode) SendToIdBytes(id []byte, msg noise.Serializable)
func (*ServerNode) SendToNetwork ¶
func (server *ServerNode) SendToNetwork(msg noise.Serializable)
func (*ServerNode) SendToNetworkSync ¶
func (server *ServerNode) SendToNetworkSync(msg noise.Serializable)
func (*ServerNode) SetEventHandler ¶
External method- for devs
func (*ServerNode) SetEventProcessor ¶
func (server *ServerNode) SetEventProcessor(handler func(event types.Event))
Internal method
func (*ServerNode) SetResultHandler ¶
func (server *ServerNode) SetResultHandler(handler func(event types.Result) error)
External method- for devs
func (*ServerNode) Start ¶
func (server *ServerNode) Start()
Click to show internal directories.
Click to hide internal directories.