Documentation
¶
Overview ¶
Package genserver is a set of actor model helper functions https://www.gophercon.co.uk/videos/2016/an-actor-model-in-go/ Ensure all accesses are wrapped in port.cmdChan <- func() { ... }
Index ¶
- func DefaultDeadlockCallback(server *GenServer, trace string)
- type GenServer
- func (server *GenServer) Call(fun func())
- func (server *GenServer) CallTimeout(fun func(), timeout time.Duration) error
- func (server *GenServer) Cast(fun func())
- func (server *GenServer) Name() string
- func (server *GenServer) Shutdown(lingerTimer time.Duration)
- func (server *GenServer) TryToCast(fun func()) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultDeadlockCallback ¶
DefaultDeadlockCallback is the default handler for deadlock detection
Types ¶
type GenServer ¶
type GenServer struct {
Terminate func()
DeadlockTimeout time.Duration
DeadlockCallback func(*GenServer, string)
// contains filtered or unexported fields
}
GenServer structure
func New ¶
New creates a new genserver Assign the Terminate function to define a callback just before the worker stops
func (*GenServer) Call ¶
func (server *GenServer) Call(fun func())
Call executes a synchronous call operation
func (*GenServer) CallTimeout ¶ added in v1.1.0
Call executes a synchronous call operation
func (*GenServer) Cast ¶
func (server *GenServer) Cast(fun func())
Cast executes an asynchrounous operation
Click to show internal directories.
Click to hide internal directories.
