summaryrefslogtreecommitdiff
path: root/http/service.go
diff options
context:
space:
mode:
Diffstat (limited to 'http/service.go')
-rw-r--r--http/service.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/http/service.go b/http/service.go
index bf25667d..dc996147 100644
--- a/http/service.go
+++ b/http/service.go
@@ -51,16 +51,15 @@ func (s *Service) Configure(cfg service.Config, c service.Container) (bool, erro
}
s.cfg = config
+
+ // todo: RPC
+
return true, nil
}
// Serve serves the service.
func (s *Service) Serve() error {
rr := roadrunner.NewServer(s.cfg.Workers)
- if err := rr.Start(); err != nil {
- return err
- }
- defer s.rr.Stop()
s.rr = rr
s.srv = &Server{cfg: s.cfg, rr: s.rr}
@@ -75,6 +74,11 @@ func (s *Service) Serve() error {
s.http.Handler = s
}
+ if err := rr.Start(); err != nil {
+ return err
+ }
+ defer s.rr.Stop()
+
if err := s.http.ListenAndServe(); err != nil {
return err
}