package bus

import (
	"box-cost/conf"

	"infish.cn/comm"
)

var NatsCenter *comm.NatsBus

func NewNatsBus(app *conf.AppConf) *comm.NatsBus {

	bus, _ := comm.NewNatsBus2(app.Nats.Url, app.Nats.MaxReconnect,
		app.Nats.ReconnDelaySecond,
		[]*comm.NatsStreamWather{},
		[]*comm.NatsMsgReplyer{})
	NatsCenter = bus
	return NatsCenter
}