summaryrefslogtreecommitdiff
path: root/state.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-11 22:02:15 +0300
committerWolfy-J <[email protected]>2018-06-11 22:02:15 +0300
commit6c94e7aee2a61e9b073ab574faa7c243ec8f6064 (patch)
tree6b7891c25d526c16333e04276f6b81d43e6c8119 /state.go
parentfe104ea854572c7033a471e0f5dd0749d8180a70 (diff)
no library dependency
Diffstat (limited to 'state.go')
-rw-r--r--state.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/state.go b/state.go
index af29de50..4d8b1eaa 100644
--- a/state.go
+++ b/state.go
@@ -68,6 +68,11 @@ func (s *state) String() string {
return "undefined"
}
+// NumExecs returns number of registered worker execs.
+func (s *state) NumExecs() int64 {
+ return atomic.LoadInt64(&s.numExecs)
+}
+
// Value state returns state value
func (s *state) Value() int64 {
return atomic.LoadInt64(&s.value)
@@ -79,10 +84,6 @@ func (s *state) IsActive() bool {
return state == StateWorking || state == StateReady
}
-func (s *state) NumExecs() int64 {
- return atomic.LoadInt64(&s.numExecs)
-}
-
// change state value (status)
func (s *state) set(value int64) {
atomic.StoreInt64(&s.value, value)