Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface { // Return number of active listeners NumListeners() int // AddListener adds lister to the publisher AddListener(listener Listener) // Push pushes event to the listeners Push(e interface{}) }
Handler interface
type Listener ¶
type Listener func(event interface{})
Event listener listens for the events produced by worker, worker pool or other service.
type P ¶
type P int64
const ( // EventWorkerConstruct thrown when new worker is spawned. EventWorkerConstruct P = iota + 7800 // EventWorkerDestruct thrown after worker destruction. EventWorkerDestruct // EventPoolError caused on pool wide errors. EventPoolError // EventSupervisorError triggered when supervisor can not complete work. EventSupervisorError // EventNoFreeWorkers triggered when there are no free workers in the stack and timeout for worker allocate elapsed EventNoFreeWorkers // EventMaxMemory caused when worker consumes more memory than allowed. EventMaxMemory // EventTTL thrown when worker is removed due TTL being reached. TTL defines maximum time worker is allowed to live (seconds) EventTTL // EventIdleTTL triggered when worker spends too much time at rest. EventIdleTTL // EventExecTTL triggered when worker spends too much time doing the task (max_execution_time). EventExecTTL )
TODO event numbers
type PoolEvent ¶
type PoolEvent struct { // Event type, see below. Event P // Payload depends on event type, typically it's worker or error. Payload interface{} }
PoolEvent triggered by pool on different events. Pool as also trigger WorkerEvent in case of log.
type WorkerEvent ¶
type WorkerEvent struct { // Event id, see below. Event W // Worker triggered the event. Worker interface{} // Event specific payload. Payload interface{} }
WorkerEvent wraps worker events.
Click to show internal directories.
Click to hide internal directories.