-
Notifications
You must be signed in to change notification settings - Fork 36
broker
gojuukaze edited this page Aug 27, 2022
·
5 revisions
import "github.com/gojuukaze/YTask/drives/redis/v3"
// 127.0.0.1 : host
// 6379 : port
// "" : password
// 0 : db
// 10 : Maximum number of idle connections in the client pool.
redis.NewRedisBroker("127.0.0.1", "6379", "", 0, 10)
import "github.com/gojuukaze/YTask/drives/rabbitmq/v3"
// 127.0.0.1 : host
// 5672 : port
// guest : username
// guest : password
rabbitmq.NewRabbitMqBroker("127.0.0.1", "5672", "guest", "guest", "")
type BrokerInterface interface {
// get task
Next(queryName string) (message.Message, error)
// send task
Send(queryName string, msg message.Message) error
// left send task
LSend(queryName string, msg message.Message) error
// Activate connection
Activate()
SetPoolSize(int)
GetPoolSize()int
// clone config
Clone() BrokerInterface
}