summaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-12 20:45:24 +0300
committerWolfy-J <[email protected]>2018-06-12 20:45:24 +0300
commit99c1121d8fd31b7b61b6c22e181dc3c05a3f9f82 (patch)
tree25e6baf4eaf4e4ebd37c2431e485dfe3f4e3ac11 /server.go
parentf8d8e9a55d31c6ee98b1f292e49b31b474883a4f (diff)
static pool logic update, better watching techniques
Diffstat (limited to 'server.go')
-rw-r--r--server.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/server.go b/server.go
index c194bc78..75cf3691 100644
--- a/server.go
+++ b/server.go
@@ -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)
}
}