Add topic argument to Publisher.Publish function
This commit is contained in:
parent
437c60b018
commit
9269f41051
|
@ -118,12 +118,12 @@ func (d *BaseDaemon) Subscribe(topic string, fun interface{}) {
|
|||
}
|
||||
|
||||
// Publish sends a message to the publisher.
|
||||
func (d *BaseDaemon) Publish(msg []byte) {
|
||||
func (d *BaseDaemon) Publish(topic string, msg []byte, meta interface{}) {
|
||||
if d.publisher == nil {
|
||||
panic(errMissingPublisher)
|
||||
}
|
||||
|
||||
d.publisher.Publish(msg)
|
||||
d.publisher.Publish(topic, msg, meta)
|
||||
}
|
||||
|
||||
// LimitRate limits the daemons' processing rate.
|
||||
|
|
|
@ -47,7 +47,7 @@ type Streamer interface {
|
|||
// Publisher is the interface that wraps message publishers. Error handling
|
||||
// should be provided by the implementation. Feel free to panic.
|
||||
type Publisher interface {
|
||||
Publish(msg []byte)
|
||||
Publish(topic string, msg []byte, meta interface{})
|
||||
Close()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue