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{}
	Subscriber.Conn = oger.Pool.Get()
	if err := Subscriber.Start(); nil != err {
		logging.Logger().Panic(err)
	}
}

func StartPackage() {
}

func StopPackage() {
}

func DestroyPackage() {
	if nil != Subscriber {
		if err := Subscriber.Stop(); nil != err {
			logging.Logger().Error(err)
		}
	}
	Subscriber = nil
}
