summaryrefslogtreecommitdiff
path: root/service/limit
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-02-20 14:14:11 +0300
committerValery Piashchynski <[email protected]>2020-02-20 14:14:11 +0300
commit2efcfeb89861ba981f980bb4503c31ca6c7a92e0 (patch)
tree22269a5cecc888cd26d6b1bd8477f30ea604ba21 /service/limit
parentec7975355a8acea632e5c9b7e912b3e9ad6907ca (diff)
Declare general interfaces, Controllable and Attacher instead of private
First dirty working example of reload
Diffstat (limited to 'service/limit')
-rw-r--r--service/limit/service.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/service/limit/service.go b/service/limit/service.go
index 6af571e2..c0b4139c 100644
--- a/service/limit/service.go
+++ b/service/limit/service.go
@@ -8,12 +8,6 @@ import (
// ID defines controller service name.
const ID = "limit"
-// controllable defines the ability to attach rr controller.
-type controllable interface {
- // Attach attaches controller to the service.
- Attach(c roadrunner.Controller)
-}
-
// Service to control the state of rr service inside other services.
type Service struct {
lsns []func(event int, ctx interface{})
@@ -24,7 +18,7 @@ func (s *Service) Init(cfg *Config, c service.Container) (bool, error) {
// mount Services to designated services
for id, watcher := range cfg.Controllers(s.throw) {
svc, _ := c.Get(id)
- if ctrl, ok := svc.(controllable); ok {
+ if ctrl, ok := svc.(roadrunner.Attacher); ok {
ctrl.Attach(watcher)
}
}