queue

package
v0.0.0-...-b7a815f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsIn

func IsIn(str string, array []string) bool

func ParseAck

func ParseAck(messageId string) (string, []uint64, error)

ParseAck:

dato un id di un messaggio ne ricava il mittente e il suo clock.
Un ID di un messaggio è della forma "mittente:clock"
es: "user:[0 1 2 1 0 0 1]"

Types

type AckTable

type AckTable struct {
	// contains filtered or unexported fields
}

func NewAckTracker

func NewAckTracker() *AckTable

func (*AckTable) GetNumAcks

func (table *AckTable) GetNumAcks() int

func (*AckTable) Insert

func (table *AckTable) Insert(messageId string)

type MessageHeap

type MessageHeap []*pb.MessageVC

func (MessageHeap) IsEmpty

func (queue MessageHeap) IsEmpty() bool

func (MessageHeap) Len

func (queue MessageHeap) Len() int

func (MessageHeap) Less

func (queue MessageHeap) Less(i, j int) bool

func (MessageHeap) Peek

func (queue MessageHeap) Peek() *pb.MessageVC

func (*MessageHeap) Pop

func (queue *MessageHeap) Pop() interface{}

func (*MessageHeap) Push

func (queue *MessageHeap) Push(x interface{})

func (MessageHeap) Swap

func (queue MessageHeap) Swap(i, j int)

type MessageTable

type MessageTable struct {
	// contains filtered or unexported fields
}

func NewMessageTable

func NewMessageTable(groupsize int) *MessageTable

func (*MessageTable) Insert

func (table *MessageTable) Insert(message *api.MessageVC) error

func (*MessageTable) IsReady

func (table *MessageTable) IsReady(messageID string) (bool, error)

IsReady:

La funzione IsReady si occupa di stabilire se un messaggio è pronto per essere rilasciato all utente oppure no.
Controlla che il messaggio input abbia ricevuto tutti gli ack e che non ci siano messaggi in arrivo
con clock minore del suo.

func (*MessageTable) Remove

func (table *MessageTable) Remove(messageID string) error

type MessageVCFIFO

type MessageVCFIFO struct {
	// contains filtered or unexported fields
}

func NewMessageVCFifo

func NewMessageVCFifo() *MessageVCFIFO

func (*MessageVCFIFO) Len

func (queue *MessageVCFIFO) Len() int

func (*MessageVCFIFO) Pop

func (queue *MessageVCFIFO) Pop() *api.MessageVC

func (*MessageVCFIFO) Push

func (queue *MessageVCFIFO) Push(message *api.MessageVC)

type MessageVCRecvQueue

type MessageVCRecvQueue struct {
	// contains filtered or unexported fields
}

func NewMessageVCRecvQueue

func NewMessageVCRecvQueue(groups []string, verbose bool) *MessageVCRecvQueue

func (*MessageVCRecvQueue) IsEmpty

func (queue *MessageVCRecvQueue) IsEmpty() bool

func (*MessageVCRecvQueue) Len

func (queue *MessageVCRecvQueue) Len() int

func (*MessageVCRecvQueue) Pop

func (queue *MessageVCRecvQueue) Pop() *pb.MessageVC

func (*MessageVCRecvQueue) Push

func (queue *MessageVCRecvQueue) Push(message *pb.MessageVC) error

type TableEntry

type TableEntry struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL