mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-17 21:44:24 +00:00
pubsub: Refactor Event Subscription (#6634)
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/tendermint/tendermint/abci/types"
|
||||
tmsync "github.com/tendermint/tendermint/internal/libs/sync"
|
||||
)
|
||||
|
||||
@@ -89,10 +90,10 @@ func (s *Subscription) cancel(err error) {
|
||||
type Message struct {
|
||||
subID string
|
||||
data interface{}
|
||||
events map[string][]string
|
||||
events []types.Event
|
||||
}
|
||||
|
||||
func NewMessage(subID string, data interface{}, events map[string][]string) Message {
|
||||
func NewMessage(subID string, data interface{}, events []types.Event) Message {
|
||||
return Message{
|
||||
subID: subID,
|
||||
data: data,
|
||||
@@ -108,4 +109,4 @@ func (msg Message) SubscriptionID() string { return msg.subID }
|
||||
func (msg Message) Data() interface{} { return msg.data }
|
||||
|
||||
// Events returns events, which matched the client's query.
|
||||
func (msg Message) Events() map[string][]string { return msg.events }
|
||||
func (msg Message) Events() []types.Event { return msg.events }
|
||||
|
||||
Reference in New Issue
Block a user