diff options
author | Valery Piashchynski <[email protected]> | 2020-12-21 19:42:23 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-12-21 19:42:23 +0300 |
commit | ee8b4075c0f836d698d1ae505c87c17147de447a (patch) | |
tree | 531d980e5bfb94ee39b03952a97e0445f7955409 /plugins/informer/rpc.go | |
parent | 0ad45031047bb479e06ce0a0f496c6db9b2641c9 (diff) |
Move plugins to the roadrunner-plugins repository
Diffstat (limited to 'plugins/informer/rpc.go')
-rw-r--r-- | plugins/informer/rpc.go | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/plugins/informer/rpc.go b/plugins/informer/rpc.go deleted file mode 100644 index d6b7bf01..00000000 --- a/plugins/informer/rpc.go +++ /dev/null @@ -1,53 +0,0 @@ -package informer - -import ( - "github.com/spiral/roadrunner/v2" - "github.com/spiral/roadrunner/v2/interfaces/log" -) - -type rpc struct { - srv *Plugin - log log.Logger -} - -// WorkerList contains list of workers. -type WorkerList struct { - // Workers is list of workers. - Workers []roadrunner.ProcessState `json:"workers"` -} - -// List all resettable services. -func (rpc *rpc) List(_ bool, list *[]string) error { - rpc.log.Debug("Started List method") - *list = make([]string, 0, len(rpc.srv.registry)) - - for name := range rpc.srv.registry { - *list = append(*list, name) - } - rpc.log.Debug("list of services", "list", *list) - - rpc.log.Debug("successfully finished List method") - return nil -} - -// Workers state of a given service. -func (rpc *rpc) Workers(service string, list *WorkerList) error { - rpc.log.Debug("started Workers method", "service", service) - workers, err := rpc.srv.Workers(service) - if err != nil { - return err - } - - list.Workers = make([]roadrunner.ProcessState, 0) - for _, w := range workers { - ps, err := roadrunner.WorkerProcessState(w) - if err != nil { - continue - } - - list.Workers = append(list.Workers, ps) - } - rpc.log.Debug("list of workers", "workers", list.Workers) - rpc.log.Debug("successfully finished Workers method") - return nil -} |