mq: add service type mq

This commit is contained in:
singchia
2024-02-18 13:51:45 +08:00
parent 94483c254f
commit 16cbb7780b
8 changed files with 236 additions and 14 deletions

View File

@@ -47,9 +47,21 @@ type ServiceInformer interface {
ServiceHeartbeat(serviceID uint64, service string, addr net.Addr)
}
// mq related
// mq manager and mq related
type MQM interface {
// MQM is a MQ wrapper
MQ
AddMQ(topics []string, mq MQ)
AddMQByEnd(topics []string, end geminio.End)
DelMQ(mq MQ)
DelMQByEnd(end geminio.End)
GetMQ(topic string) MQ
GetMQs(topic string) []MQ
}
type MQ interface {
Produce(topic string, data []byte, opts ...OptionProduce) error
Close() error
}
type ProduceOption struct {