Decruft the broker by removing Event interface (#1940)

This commit is contained in:
Asim Aslam
2020-08-18 14:00:51 +01:00
committed by GitHub
parent a2a808f2d6
commit 4413372a3f
14 changed files with 45 additions and 226 deletions

View File

@@ -6,6 +6,8 @@ import (
"github.com/micro/go-micro/v3/registry"
"github.com/micro/go-micro/v3/server"
"github.com/micro/go-micro/v3/broker"
"github.com/micro/go-micro/v3/transport"
)
const (
@@ -28,6 +30,13 @@ type subscriber struct {
opts server.SubscriberOptions
}
func newMessage(msg transport.Message) *broker.Message {
return &broker.Message{
Header: msg.Header,
Body: msg.Body,
}
}
func newSubscriber(topic string, sub interface{}, opts ...server.SubscriberOption) server.Subscriber {
options := server.SubscriberOptions{
AutoAck: true,