diff options
Diffstat (limited to 'service/reload/service.go')
-rw-r--r-- | service/reload/service.go | 40 |
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 |