1
0
Fork 0

Add topic argument to Publisher.Publish function

This commit is contained in:
Gregory Eremin 2016-01-25 03:21:51 +03:00
parent 437c60b018
commit 9269f41051
2 changed files with 3 additions and 3 deletions

View File

@ -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.

View File

@ -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()
}