Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IBFTRoundIndexKey ¶
IBFTRoundIndexKey is the ibft index key
func SigRoundIndexKey ¶
SigRoundIndexKey is the SSV node signature collection index key
Types ¶
type IndexFunc ¶
IndexFunc is the function that indexes messages to be later pulled by those indexes
type MessageQueue ¶
type MessageQueue struct {
// contains filtered or unexported fields
}
MessageQueue is a broker of messages for the IBFT instance to process. Messages can come in various times, even next round's messages can come "early" as other nodes can change round before this node. To solve this issue we have a message broker from which the instance pulls new messages, this also reduces concurrency issues as the instance is now single threaded. The message queue has internal logic to organize messages by their round.
func (*MessageQueue) AddIndexFunc ¶
func (q *MessageQueue) AddIndexFunc(f IndexFunc)
AddIndexFunc adds an index function that will be activated every new message the queue receives
func (*MessageQueue) AddMessage ¶
func (q *MessageQueue) AddMessage(msg *network.Message)
AddMessage adds a message the queue based on the message round. AddMessage is thread safe
func (*MessageQueue) MsgCount ¶
func (q *MessageQueue) MsgCount(index string) int
MsgCount will return a count of messages by their index
func (*MessageQueue) PopMessage ¶
func (q *MessageQueue) PopMessage(index string) *network.Message
PopMessage will return a message by its index if found, will also delete all other index occurrences of that message
func (*MessageQueue) PurgeIndexedMessages ¶
func (q *MessageQueue) PurgeIndexedMessages(index string)
PurgeIndexedMessages will delete all indexed messages for the given index