Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveObject ¶
type ActiveObject struct {
// contains filtered or unexported fields
}
ActiveObject provides an API for implements Active Object Pattern
func NewActiveObject ¶
func NewActiveObject() *ActiveObject
NewActiveObject creates an instance of ActiveObject
func (*ActiveObject) Call ¶
func (a *ActiveObject) Call(fName string, args ...interface{}) chan interface{}
Call schedules a function call. It panics if no function has been registered under the fName. It returns a channel which will be sent the result of the call.
func (*ActiveObject) RegisterFunc ¶
func (a *ActiveObject) RegisterFunc(fName string, f SchedulerFunc)
RegisterFunc registers a function to execute against a call request that matches fName.
func (*ActiveObject) Start ¶
func (a *ActiveObject) Start()
Start the active object engine. It will start the scheduler on a goroutine and return.
type CallRequest ¶
type CallRequest struct {
// contains filtered or unexported fields
}
CallRequest represents a request for a function call.
type Scheduler ¶
Scheduler manages method calls and execute already scheduled calls in a FIFO order.
type SchedulerFunc ¶
type SchedulerFunc func(args ...interface{}) interface{}
SchedulerFunc describes the signature of a scheduled method