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 +}