channel

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = Options{
	SingleChannelBufferSize: 1024,
	PublishToChannelDelay:   1 * time.Second,
	Logger:                  nil,
}

Functions

This section is empty.

Types

type ChannelBrokerHandler

type ChannelBrokerHandler struct {
	Options
	// contains filtered or unexported fields
}

func NewChannelBrokerHandler

func NewChannelBrokerHandler(optsSetters ...OptionsSetter) *ChannelBrokerHandler

func (*ChannelBrokerHandler) CloseConnection

func (h *ChannelBrokerHandler) CloseConnection()

func (*ChannelBrokerHandler) ConnectedEndpoints

func (h *ChannelBrokerHandler) ConnectedEndpoints() (endpoints []string)

func (*ChannelBrokerHandler) DeepCopy

func (h *ChannelBrokerHandler) DeepCopy() broker.Handler

DeepCopy is a deepcopy function, copying the receiver, creating a new ChannelBrokerHandler.

func (*ChannelBrokerHandler) DeepCopyInto

func (h *ChannelBrokerHandler) DeepCopyInto(out broker.Handler)

DeepCopyInto is a deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ChannelBrokerHandler) DeepCopyObject

func (h *ChannelBrokerHandler) DeepCopyObject() broker.Handler

DeepCopyObject is a deepcopy function, copying the receiver, creating a new broker.Handler.

func (*ChannelBrokerHandler) Info

func (h *ChannelBrokerHandler) Info() string

func (*ChannelBrokerHandler) IsConnected added in v1.0.21

func (h *ChannelBrokerHandler) IsConnected() bool

IsConnected reports whether this in-process channel broker is usable. It has no network connection to drop, so it is "connected" whenever the handler exists.

func (*ChannelBrokerHandler) IsEmpty

func (h *ChannelBrokerHandler) IsEmpty() bool

Check if the connection object is empty

func (*ChannelBrokerHandler) Publish

func (h *ChannelBrokerHandler) Publish(subject string, message *broker.Message) error

Publish - to publish messages

func (*ChannelBrokerHandler) PublishWithChannel

func (h *ChannelBrokerHandler) PublishWithChannel(subject string, msgch chan *broker.Message) error

PublishWithChannel - to publish messages with channel

func (*ChannelBrokerHandler) Subscribe

func (h *ChannelBrokerHandler) Subscribe(subject, queue string, message []byte) error

Subscribe - for subscribing messages

func (*ChannelBrokerHandler) SubscribeWithChannel

func (h *ChannelBrokerHandler) SubscribeWithChannel(subject, queue string, msgch chan *broker.Message) error

SubscribeWithChannel will publish all the messages received to the given channel

type ErrChannelBrokerPublishType

type ErrChannelBrokerPublishType struct {
	Err              error
	SuccessQueueList []string
	FailedQueueList  []string
}

func NewErrChannelBrokerPublish

func NewErrChannelBrokerPublish(
	err error,
	successQueueList []string,
	failedQueueList []string,
) *ErrChannelBrokerPublishType

func (*ErrChannelBrokerPublishType) Error

type Options

type Options struct {
	SingleChannelBufferSize uint
	PublishToChannelDelay   time.Duration
	Logger                  logger.Handler
}

type OptionsSetter

type OptionsSetter func(*Options)

func WithLogger

func WithLogger(log logger.Handler) OptionsSetter

func WithPublishToChannelDelay

func WithPublishToChannelDelay(value time.Duration) OptionsSetter

func WithSingleChannelBufferSize

func WithSingleChannelBufferSize(value uint) OptionsSetter

Jump to

Keyboard shortcuts

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