controlcommunication

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 5 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 AbstractControlMessageBroker

type AbstractControlMessageBroker struct {
	Consumers []*ControlConsumer
	// contains filtered or unexported fields
}

func NewAbstractControlMessageBroker

func NewAbstractControlMessageBroker() *AbstractControlMessageBroker

NewAbstractControlMessageBroker creates a new abstract control message broker

func (*AbstractControlMessageBroker) ReadControlMessage

func (acmb *AbstractControlMessageBroker) ReadControlMessage(reader *bufio.Reader) (*ControlMessage, error)

func (*AbstractControlMessageBroker) SendToConsumers

func (acmb *AbstractControlMessageBroker) SendToConsumers(message *ControlMessage) error

func (*AbstractControlMessageBroker) Subscribe

func (acmb *AbstractControlMessageBroker) Subscribe(kind ControlMessageKind, channel chan *ControlMessage) error

func (*AbstractControlMessageBroker) Unsubscribe

func (acmb *AbstractControlMessageBroker) Unsubscribe(kind ControlMessageKind, channel chan *ControlMessage) error

func (*AbstractControlMessageBroker) WriteControlMessage

func (acmb *AbstractControlMessageBroker) WriteControlMessage(message *ControlMessage) error

type ControlConsumer

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

func NewControlConsumer

func NewControlConsumer(kind ControlMessageKind) *ControlConsumer

NewControlConsumer creates a new control consumer

func (*ControlConsumer) GetKind

func (c *ControlConsumer) GetKind() ControlMessageKind

GetKind returns the kind of the consumer

func (*ControlConsumer) Send

func (c *ControlConsumer) Send(message *ControlMessage) error

Send broadcasts a message to all subscribed channels

type ControlMessage

type ControlMessage struct {
	Kind       ControlMessageKind
	Attributes map[string]interface{}
}

TODO: move to nuclio-sdk-go

type ControlMessageAttributesExplicitAck

type ControlMessageAttributesExplicitAck struct {
	Topic     string `json:"topic"`
	Partition int32  `json:"partition"`
	Offset    int64  `json:"offset"`
}

type ControlMessageBroker

type ControlMessageBroker interface {

	// WriteControlMessage writes a control message to the control communication
	WriteControlMessage(message *ControlMessage) error

	// ReadControlMessage reads a control message from the control communication
	ReadControlMessage(reader *bufio.Reader) (*ControlMessage, error)

	// SendToConsumers sends a control message to all consumers
	SendToConsumers(message *ControlMessage) error

	// Subscribe subscribes channel to a control message kind
	Subscribe(kind ControlMessageKind, channel chan *ControlMessage) error

	// Unsubscribe unsubscribes channel from a control message kind
	Unsubscribe(kind ControlMessageKind, channel chan *ControlMessage) error
}

type ControlMessageEvent

type ControlMessageEvent struct {
	nuclio.AbstractEvent
	// contains filtered or unexported fields
}

func NewControlMessageEvent

func NewControlMessageEvent(message *ControlMessage) *ControlMessageEvent

func (*ControlMessageEvent) GetBodyObject

func (cme *ControlMessageEvent) GetBodyObject() interface{}

GetBodyObject returns the control message body of the event

func (*ControlMessageEvent) GetID

func (cme *ControlMessageEvent) GetID() nuclio.ID

GetID returns the ID of the event

type ControlMessageKind

type ControlMessageKind string
const (
	StreamMessageAckKind ControlMessageKind = "streamMessageAck"
)

Jump to

Keyboard shortcuts

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