broker: add profiling
This commit is contained in:
@@ -23,12 +23,12 @@ func NewMessagingClient(bootstrapBrokers []string) (*MessagingClient, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
util.OnInterrupt(func() {
|
||||
grpcConnection.Close()
|
||||
})
|
||||
|
||||
return &MessagingClient{
|
||||
bootstrapBrokers: bootstrapBrokers,
|
||||
grpcConnection: grpcConnection,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (mc *MessagingClient) Shutdown() {
|
||||
mc.grpcConnection.Close()
|
||||
}
|
||||
|
||||
@@ -69,8 +69,7 @@ func (p *Publisher) Publish(m *messaging_pb.RawData) error {
|
||||
|
||||
}
|
||||
|
||||
func (p *Publisher) Shutdown() {
|
||||
|
||||
p.publishClient.CloseSend()
|
||||
func (p *Publisher) Close() error {
|
||||
|
||||
return p.publishClient.CloseSend()
|
||||
}
|
||||
|
||||
@@ -59,7 +59,3 @@ func (s *Subscriber) Subscribe(processFn func(m *messaging_pb.Message)) error {
|
||||
processFn(resp.Data)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Subscriber) Shutdown() {
|
||||
s.subscriberClient.CloseSend()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user