Merge pull request 'Ammending Event Bus Api to remove Pointers' (#340) from newui-bugfix into master
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone/push Build is failing Details

Reviewed-on: #340
This commit is contained in:
Dan Ballard 2021-03-24 13:27:05 -07:00
commit afd6201a98
3 changed files with 8 additions and 7 deletions

View File

@ -19,7 +19,7 @@ type simpleQueue struct {
// the event.Manager.
type Queue interface {
Publish(event Event)
Next() *Event
Next() Event
Shutdown()
OutChan() <-chan Event
Len() int
@ -52,9 +52,9 @@ func (sq *simpleQueue) Len() int {
}
// 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
return &event
return event
}
// 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
func (iq *queue) Next() *Event {
func (iq *queue) Next() Event {
event := <-iq.infChan.Out()
return &event
return event
}
func (iq *queue) Len() int {

View File

@ -7,7 +7,8 @@ import (
"sync"
)
// Event is a structure which binds a given set of data to an Type
// Event is the core struct type passed around between various subsystems. Events 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 {
EventType Type
EventID string

View File

@ -383,7 +383,7 @@ func (ps *ProfileStoreV1) eventHandler() {
log.Errorf("error storing new group invite: %v (%v)", err, ev)
}
case event.SendMessageToPeer: // cache the message till an ack, then it's given to stream store.
// stream store doesn't support updates, so we don't want to commit it till ack'd
// stream store doesn't support updates, so we don't want to commit it till ack'd
ps.profile.AddSentMessageToContactTimeline(ev.Data[event.RemotePeer], ev.Data[event.Data], time.Now(), ev.EventID)
case event.NewMessageFromPeer:
ps.attemptSavePeerMessage(ev.Data[event.RemotePeer], ev.Data[event.Data], ev.Data[event.TimestampReceived], true)