summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-03-31 18:04:33 +0300
committerWolfy-J <[email protected]>2018-03-31 18:04:33 +0300
commite0c6b54b5b7dc3b9e7fc417f87f176fdbdb723f9 (patch)
tree6fe5c669f778b0b6e583cb99f5fac3409caf5e97
parent3d1b67afba6fcc674cf3c3de758188321253d5d8 (diff)
string state, pool workers list
-rw-r--r--pool.go3
-rw-r--r--state.go3
2 files changed, 6 insertions, 0 deletions
diff --git a/pool.go b/pool.go
index 1a134a6a..f491dfa5 100644
--- a/pool.go
+++ b/pool.go
@@ -16,6 +16,9 @@ type Pool 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()
}
diff --git a/state.go b/state.go
index 6e49a397..d1068ab3 100644
--- a/state.go
+++ b/state.go
@@ -1,6 +1,7 @@
package roadrunner
import (
+ "fmt"
"sync"
"sync/atomic"
"time"
@@ -8,6 +9,8 @@ import (
// State represents worker status and updated time.
type State interface {
+ fmt.Stringer
+
// Value returns state value
Value() int64