From 9269f41051867c8e64241a7f615d41c6c364ea76 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Mon, 25 Jan 2016 03:21:51 +0300 Subject: [PATCH] Add topic argument to Publisher.Publish function --- daemon.go | 4 ++-- shezmu.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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() }