strip broker address

This commit is contained in:
Asim Aslam
2019-07-07 12:33:47 +01:00
parent 5f664faeba
commit c1097a4509
4 changed files with 10 additions and 4 deletions

View File

@@ -3,11 +3,10 @@ package broker
// Broker is an interface used for asynchronous messaging.
type Broker interface {
Init(...Option) error
Options() Options
Address() string
Connect() error
Disconnect() error
Init(...Option) error
Publish(string, *Message, ...PublishOption) error
Subscribe(string, Handler, ...SubscribeOption) (Subscriber, error)
String() string

View File

@@ -403,6 +403,7 @@ func (h *httpBroker) Connect() error {
go func() {
h.run(l)
h.Lock()
h.opts.Addrs = []string{addr}
h.address = addr
h.Unlock()
}()