member_gateway_rpc/subscribe/subscribe.go
crusader 5e46d9e576 ing
2018-04-09 22:37:03 +09:00

33 lines
582 B
Go

package subscribe
import (
"git.loafle.net/commons/logging-go"
oger "git.loafle.net/overflow/gateway/external/redis"
ogsr "git.loafle.net/overflow/gateway/subscribe/redis"
)
var Subscriber *ogsr.Subscribers
func InitPackage() {
Subscriber = &ogsr.Subscribers{}
}
func StartPackage() {
Subscriber.Conn = oger.Pool.Get()
if err := Subscriber.Start(); nil != err {
logging.Logger().Panic(err)
}
}
func StopPackage() {
if nil != Subscriber {
if err := Subscriber.Stop(); nil != err {
logging.Logger().Error(err)
}
}
}
func DestroyPackage() {
Subscriber = nil
}