refactoring

This commit is contained in:
Chris Lu
2020-04-29 13:26:02 -07:00
parent 7c10602b49
commit ed3cf811f5
11 changed files with 27 additions and 6 deletions

View File

@@ -98,6 +98,8 @@ func (broker *MessageBroker) assignAndUpload(topicConfig *messaging_pb.TopicConf
return assignResult, uploadResult, nil
}
var _ = filer_pb.FilerClient(&MessageBroker{})
func (broker *MessageBroker) WithFilerClient(fn func(filer_pb.SeaweedFilerClient) error) (err error) {
for _, filer := range broker.option.Filers {
@@ -111,3 +113,7 @@ func (broker *MessageBroker) WithFilerClient(fn func(filer_pb.SeaweedFilerClient
return
}
func (broker *MessageBroker) AdjustedUrl(hostAndPort string) string {
return hostAndPort
}

View File

@@ -85,7 +85,7 @@ func (s *Subscriber) doSubscribe(partition int, processFn func(m *messaging_pb.M
// Subscribe starts goroutines to process the messages
func (s *Subscriber) Subscribe(processFn func(m *messaging_pb.Message)) {
for i:=0;i<len(s.subscriberClients);i++{
for i := 0; i < len(s.subscriberClients); i++ {
go s.doSubscribe(i, processFn)
}
}