summaryrefslogtreecommitdiff
path: root/pool.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-04-15 12:48:53 +0300
committerGitHub <[email protected]>2018-04-15 12:48:53 +0300
commit16fdc1e896278bf64550d508063d4cdf77409941 (patch)
tree76db075971f2fe683ed3bf643bbf097b47178a5a /pool.go
parentca63ec7aec2d7ba5d107d54091489612e4b12dc5 (diff)
parente2c1c66d7a35a9c60a4f05126691242068ebb589 (diff)
Merge pull request #6 from spiral/develop
Develop
Diffstat (limited to 'pool.go')
-rw-r--r--pool.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pool.go b/pool.go
index 1a134a6a..d22830a6 100644
--- a/pool.go
+++ b/pool.go
@@ -13,9 +13,15 @@ const (
// Pool managed set of inner worker processes.
type Pool interface {
+ // Report attaches pool event watcher.
+ Watch(o func(event int, w *Worker, ctx interface{}))
+
// Exec one task with given payload and context, returns result or error.
Exec(rqs *Payload) (rsp *Payload, err error)
+ // Workers returns worker list associated with the pool.
+ Workers() (workers []*Worker)
+
// Destroy all underlying workers (but let them to complete the task).
Destroy()
}