consumer

package module
v0.0.0-...-4cd6c04 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer struct {
	Mrn            string                       // the MRN of the Consumer
	Interests      []string                     // the Interests that the Consumer wants to subscribe to
	Messages       map[string]*mmtp.MmtpMessage // the incoming messages for this Consumer
	MsgMu          *sync.RWMutex                // RWMutex for locking the Messages map
	ReconnectToken string                       // token for reconnecting to a previous session
	Notifications  map[string]*mmtp.MmtpMessage // Map containing pointers to messages, which the Consumer should be notified about
	NotifyMu       *sync.RWMutex                // a Mutex for Notifications map
}

func (*Consumer) BulkQueueMessages

func (c *Consumer) BulkQueueMessages(mmtpMessages []*mmtp.MmtpMessage)

func (*Consumer) CheckNewMessages

func (c *Consumer) CheckNewMessages(ctx context.Context, conn *websocket.Conn, wg *sync.WaitGroup)

CheckNewMessages Checks if there are messages the Agent has not been notified about and notifies about these

func (*Consumer) HandleDisconnect

func (c *Consumer) HandleDisconnect(mmtpMessage *mmtp.MmtpMessage, request *http.Request, conn *websocket.Conn) error

HandleDisconnect handles a request from a consumer to disconnect, by responding to the consumer and closing the socket

func (*Consumer) HandleFetch

func (c *Consumer) HandleFetch(mmtpMessage *mmtp.MmtpMessage, request *http.Request, conn *websocket.Conn) error

HandleFetch fetches message metadata for messages addressed to consumer, and informs consumer about these (metadata only)

func (*Consumer) HandleReceive

func (c *Consumer) HandleReceive(mmtpMessage *mmtp.MmtpMessage, request *http.Request, conn *websocket.Conn) error

HandleReceive handles request from consumer to receive messages, i.e. lookups buffered messages for the consumer and sends these messages to that consumer

func (*Consumer) QueueMessage

func (c *Consumer) QueueMessage(mmtpMessage *mmtp.MmtpMessage) error

Jump to

Keyboard shortcuts

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