summaryrefslogtreecommitdiff
path: root/service/http/service.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-07-08 10:23:30 -0700
committerWolfy-J <[email protected]>2018-07-08 10:23:30 -0700
commit3c3a7801100f29c99a5e446646c818bf16ccd5f0 (patch)
tree4d558ae6e799b5e76e8e56b192cf057d47f3527f /service/http/service.go
parent466383c72d921aba728de40b60910741e561c1d1 (diff)
minor attributes refactoring
Diffstat (limited to 'service/http/service.go')
-rw-r--r--service/http/service.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/service/http/service.go b/service/http/service.go
index 710cd60c..7405bf37 100644
--- a/service/http/service.go
+++ b/service/http/service.go
@@ -8,6 +8,7 @@ import (
"net/http"
"sync"
"sync/atomic"
+ "github.com/spiral/roadrunner/service/http/attributes"
)
// ID contains default svc name.
@@ -113,16 +114,17 @@ func (s *Service) Stop() {
// middleware handles connection using set of mdws and rr PSR-7 server.
func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request) {
- r = InitAttributes(r)
+ r = attributes.Init(r)
+ // chaining middlewares
f := s.srv.ServeHTTP
for _, m := range s.mdws {
f = m(f)
}
-
f(w, r)
}
+// listener handles service, server and pool events.
func (s *Service) listener(event int, ctx interface{}) {
for _, l := range s.lsns {
l(event, ctx)