Documentation ¶
Index ¶
- func BytesToString(bytes []byte) string
- func StringToBytes(s string) []byte
- type Actor
- type Context
- type Coordinates
- type ProcessMessage
- type Pusher
- type ReceiverFunction
- type Subber
- type System
- func (s *System) ActorOf(name string) (*Actor, error)
- func (s *System) RegisterActor(ref *Actor) error
- func (s *System) RegisterOnMessage(f ProcessMessage)
- func (s *System) SendMessage(msg string, to Coordinates, from Coordinates)
- func (s *System) Start()
- func (s *System) Stop()
- func (s *System) UnregisterActor(name string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToString ¶ added in v1.4.2
BytesToString casts []byte type to string, this does not copy the original value so if original slice is changed string will also change
func StringToBytes ¶ added in v1.4.2
StringToBytes casts string type to []byte, this does not copy the original value so if original string is changed []byte will also change
Types ¶
type Actor ¶ added in v1.2.0
type Actor struct { Name string Backlog chan Context Exit chan interface{} // contains filtered or unexported fields }
Actor represents single actor
func NewActor ¶ added in v1.2.0
func NewActor(name string, receive ReceiverFunction) *Actor
NewActor returns new actor instance
func (*Actor) Tell ¶ added in v1.2.0
func (ref *Actor) Tell(data interface{}, receiver Coordinates, sender Coordinates) (err error)
Tell queues message to actor
type Context ¶
type Context struct { Data interface{} Self *Actor Receiver Coordinates Sender Coordinates }
Context represents actor message envelope
type Coordinates ¶
Coordinates represents actor namespace
func (Coordinates) String ¶
func (ref Coordinates) String() string
type ProcessMessage ¶ added in v1.0.1
type ProcessMessage func(msg string, to Coordinates, from Coordinates)
ProcessMessage is a function signature definition for remote message processing
type Pusher ¶ added in v1.2.2
type Pusher struct { Data chan string // contains filtered or unexported fields }
Pusher holds PUSH socket wrapper
type ReceiverFunction ¶ added in v1.5.0
type ReceiverFunction func(data Context) ReceiverFunction
ReceiverFunction is function that processes Context and transitions state
type Subber ¶ added in v1.2.2
type Subber struct { Data chan string // contains filtered or unexported fields }
Subber holds SUB socket wrapper
type System ¶ added in v1.0.1
type System struct { Name string // contains filtered or unexported fields }
System provides support for graceful shutdown
func (*System) RegisterActor ¶ added in v1.0.1
RegisterActor register new actor into actor system
func (*System) RegisterOnMessage ¶ added in v1.0.1
func (s *System) RegisterOnMessage(f ProcessMessage)
RegisterOnMessage register callback on message receive
func (*System) SendMessage ¶ added in v1.0.1
func (s *System) SendMessage(msg string, to Coordinates, from Coordinates)
SendMessage send message to to local of remote actor system
func (*System) UnregisterActor ¶ added in v1.0.1
UnregisterActor stops actor and removes it from actor system