mqx

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GeneralProducer

type GeneralProducer[T any] struct {
	// contains filtered or unexported fields
}

func NewGeneralProducer

func NewGeneralProducer[T any](q mq.MQ, topic string) (*GeneralProducer[T], error)

func (*GeneralProducer[T]) Produce

func (p *GeneralProducer[T]) Produce(ctx context.Context, evt T) error

type MultipleProducer

type MultipleProducer[T any] struct {
	// contains filtered or unexported fields
}

MultipleProducer 管理多个 GeneralProducer

func NewMultipleProducer

func NewMultipleProducer[T any](mq mq.MQ) (*MultipleProducer[T], error)

NewMultipleProducer 创建一个新的 ProducerManager

func (*MultipleProducer[T]) AddProducer

func (pm *MultipleProducer[T]) AddProducer(topic string) error

AddProducer 添加一个新的 producer 监听指定的 topic

func (*MultipleProducer[T]) DelProducer

func (pm *MultipleProducer[T]) DelProducer(topic string) error

DelProducer 删除 producer 监听指定的 topic

func (*MultipleProducer[T]) Produce

func (pm *MultipleProducer[T]) Produce(ctx context.Context, topic string, evt T) error

Produce 发送消息到指定的 topic

type Producer

type Producer[T any] interface {
	Produce(ctx context.Context, evt T) error
}

Jump to

Keyboard shortcuts

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