summaryrefslogtreecommitdiff
path: root/service/reload/service.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-02-17 19:13:15 +0300
committerValery Piashchynski <[email protected]>2020-02-17 19:13:15 +0300
commit50b46c8d3c0e1f13623e2cd7cbb1302ae66ed308 (patch)
tree71f1ac71fe3e5bf024b199136584e601016ac0c7 /service/reload/service.go
parent25ef7646e2149b6e35945eb4ce50c19db2ef8e27 (diff)
Add reload service
Start to implement Watcher
Diffstat (limited to 'service/reload/service.go')
-rw-r--r--service/reload/service.go40
1 files changed, 40 insertions, 0 deletions
diff --git a/service/reload/service.go b/service/reload/service.go
new file mode 100644
index 00000000..db10b6f4
--- /dev/null
+++ b/service/reload/service.go
@@ -0,0 +1,40 @@
+package reload
+
+import "github.com/spiral/roadrunner/service"
+
+// ID contains default service name.
+const ID = "reload"
+
+type Service struct {
+ reloadConfig *Config
+}
+
+// Init controller service
+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 {
+ // ctrl.Attach(watcher)
+ // }
+ //}
+
+ s.reloadConfig = cfg
+
+ return true, nil
+}
+
+func (s *Service) Serve() error {
+ w, err := NewWatcher(s.reloadConfig, SetMaxFileEvents(100))
+ if err != nil {
+ return err
+ }
+
+ _ = w
+
+ return nil
+}
+
+func (s *Service) Stop() {
+
+} \ No newline at end of file