consumer

package module
v0.0.0-...-585631c Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 11 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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