diff --git a/daemon.go b/daemon.go index 15ee5c3..c731aaa 100644 --- a/daemon.go +++ b/daemon.go @@ -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. diff --git a/shezmu.go b/shezmu.go index 7147b49..6ee5394 100644 --- a/shezmu.go +++ b/shezmu.go @@ -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() }