Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Monitor ¶
type Monitor interface { // PoolStatus returns pool status PoolStatus() pool.Status // Error returns process's error by process id. Error(PID) error // WorkerList returns the list of worker names of the pool. WorkerList() []WorkerName // WorkerStatus returns worker status. It accepts worker name as input. WorkerStatus(name WorkerName) worker.Status // ProcessStatus returns process stats. It accepts process id as input. ProcessStats(pid PID) ProcessStats }
Monitor is a mechanism for observation processes and pool stats.
type Pool ¶
type Pool interface { // Start runs the pool. Start() error // Register adds the process to the pool queue. Register(p ...Process) // Close stops a running pool. Close() error // Kill cancel a process before it starts. Kill(pid PID) // Monitor returns pool monitor. Monitor() Monitor }
Pool is a mechanism to dispatch processes between a group of workers.
type Process ¶
type Process interface { // Start runs the process. It returns an error object if any thing wrong // happens in runtime. Start() error // Name returns process name. Name() string // PID returns process id. PID() PID }
Process is an interface that represents a process
type ProcessStats ¶
type ProcessStats struct { // WorkerName is the name of the worker that this process belongs to. WorkerName WorkerName // Process is process that this stats belongs to. Process Process // Status represents the current state of the process. Status process.Status // StartedAt represents the start date time of the process. StartedAt time.Time // FinishedAt represents the end date time of the process. FinishedAt time.Time // contains filtered or unexported fields }
ProcessStats represents process statistics.
type WorkerName ¶
type WorkerName string
WorkerName is a custom type of string that represents worker's name.
Click to show internal directories.
Click to hide internal directories.