Documentation
¶
Index ¶
- type Consumer
- func (c *Consumer) BulkQueueMessages(mmtpMessages []*mmtp.MmtpMessage)
- func (c *Consumer) CheckNewMessages(ctx context.Context, conn *websocket.Conn, wg *sync.WaitGroup)
- func (c *Consumer) HandleDisconnect(mmtpMessage *mmtp.MmtpMessage, request *http.Request, conn *websocket.Conn) error
- func (c *Consumer) HandleFetch(mmtpMessage *mmtp.MmtpMessage, request *http.Request, conn *websocket.Conn) error
- func (c *Consumer) HandleReceive(mmtpMessage *mmtp.MmtpMessage, request *http.Request, conn *websocket.Conn) error
- func (c *Consumer) QueueMessage(mmtpMessage *mmtp.MmtpMessage) error
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 ¶
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
Click to show internal directories.
Click to hide internal directories.