resurrect broker event (#26)

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-08-27 11:18:02 +03:00
committed by GitHub
parent 36c53b4917
commit b4ccde2228
6 changed files with 56 additions and 23 deletions

View File

@@ -14,7 +14,15 @@ type Broker interface {
}
// Handler is used to process messages via a subscription of a topic.
type Handler func(*Message) error
type Handler func(Event) error
// Event is given to a subscription handler for processing
type Event interface {
Topic() string
Message() *Message
Ack() error
Error() error
}
// Message is used to transfer data
type Message struct {