diff options
author | Wolfy-J <[email protected]> | 2018-06-12 20:45:24 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-12 20:45:24 +0300 |
commit | 99c1121d8fd31b7b61b6c22e181dc3c05a3f9f82 (patch) | |
tree | 25e6baf4eaf4e4ebd37c2431e485dfe3f4e3ac11 /server.go | |
parent | f8d8e9a55d31c6ee98b1f292e49b31b474883a4f (diff) |
static pool logic update, better watching techniques
Diffstat (limited to 'server.go')
-rw-r--r-- | server.go | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -29,7 +29,7 @@ type Server struct { cfg *ServerConfig // observes pool events (can be attached to multiple pools at the same time) - listener func(event int, ctx interface{}) + lsn func(event int, ctx interface{}) // protects pool while the re-configuration mu sync.Mutex @@ -51,7 +51,7 @@ func NewServer(cfg *ServerConfig) *Server { // AddListener attaches server event watcher. func (srv *Server) Listen(l func(event int, ctx interface{})) { - srv.listener = l + srv.lsn = l } // Start underlying worker pool, configure factory and command provider. @@ -171,7 +171,7 @@ func (srv *Server) Pool() Pool { // AddListener pool events. func (srv *Server) poolListener(event int, ctx interface{}) { - // bypassing to user specified listener + // bypassing to user specified lsn srv.throw(event, ctx) if event == EventPoolError { @@ -192,7 +192,7 @@ func (srv *Server) poolListener(event int, ctx interface{}) { // throw invokes event handler if any. func (srv *Server) throw(event int, ctx interface{}) { - if srv.listener != nil { - srv.listener(event, ctx) + if srv.lsn != nil { + srv.lsn(event, ctx) } } |