From 6b6a375228e39715533de85cfe29e9c1af651cb7 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Fri, 13 Jan 2023 13:21:20 +0100 Subject: [PATCH] Adding transport/publisher.go --- transport/publisher.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 transport/publisher.go diff --git a/transport/publisher.go b/transport/publisher.go new file mode 100644 index 0000000..420af8a --- /dev/null +++ b/transport/publisher.go @@ -0,0 +1,13 @@ +package transport + +// Publisher interface defines the required methods +// to send messages over channel. +type Publisher interface { + // Publish a message to a channel. + // The message may or may not be buffered depending on the implementation. + Publish(channel string, payload []byte) error + + // Flush writes any buffered messages to the channel. + // If the implementation does not support buffering. this is a noop. + Flush() error +}