Ammending Event Bus Api to remove Pointers
This commit is contained in:
parent
5d1d057d6a
commit
044f726ae4
|
@ -19,7 +19,7 @@ type simpleQueue struct {
|
||||||
// the event.Manager.
|
// the event.Manager.
|
||||||
type Queue interface {
|
type Queue interface {
|
||||||
Publish(event Event)
|
Publish(event Event)
|
||||||
Next() *Event
|
Next() Event
|
||||||
Shutdown()
|
Shutdown()
|
||||||
OutChan() <-chan Event
|
OutChan() <-chan Event
|
||||||
Len() int
|
Len() int
|
||||||
|
@ -52,9 +52,9 @@ func (sq *simpleQueue) Len() int {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Next returns the next available event from the front of the queue
|
// Next returns the next available event from the front of the queue
|
||||||
func (sq *simpleQueue) Next() *Event {
|
func (sq *simpleQueue) Next() Event {
|
||||||
event := <-sq.eventChannel
|
event := <-sq.eventChannel
|
||||||
return &event
|
return event
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shutdown closes our eventChannel
|
// Shutdown closes our eventChannel
|
||||||
|
@ -83,9 +83,9 @@ func (iq *queue) OutChan() <-chan Event {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Out returns the next available event from the front of the queue
|
// Out returns the next available event from the front of the queue
|
||||||
func (iq *queue) Next() *Event {
|
func (iq *queue) Next() Event {
|
||||||
event := <-iq.infChan.Out()
|
event := <-iq.infChan.Out()
|
||||||
return &event
|
return event
|
||||||
}
|
}
|
||||||
|
|
||||||
func (iq *queue) Len() int {
|
func (iq *queue) Len() int {
|
||||||
|
|
|
@ -7,7 +7,8 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Event is a structure which binds a given set of data to an Type
|
// Events are the core struct passed around between various subsystems, they consist of a type which can be
|
||||||
|
// filtered on, an event ID for tracing and a map of Fields to string values.
|
||||||
type Event struct {
|
type Event struct {
|
||||||
EventType Type
|
EventType Type
|
||||||
EventID string
|
EventID string
|
||||||
|
|
Loading…
Reference in New Issue