Decruft the broker by removing Event interface (#1940)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user