Change Publication to Event

This commit is contained in:
Asim Aslam
2019-07-07 12:44:09 +01:00
parent 79b03a6825
commit 4b4ad68eb9
15 changed files with 42 additions and 42 deletions

View File

@@ -15,15 +15,15 @@ type Broker interface {
// Handler is used to process messages via a subscription of a topic.
// The handler is passed a publication interface which contains the
// message and optional Ack method to acknowledge receipt of the message.
type Handler func(Publication) error
type Handler func(Event) error
type Message struct {
Header map[string]string
Body []byte
}
// Publication is given to a subscription handler for processing
type Publication interface {
// Event is given to a subscription handler for processing
type Event interface {
Topic() string
Message() *Message
Ack() error