noop

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package noop provides a no-op message queue for monolith scenarios. This message queue does nothing: Publish succeeds silently, Subscribe returns empty unsubscribe. Note: Message queue is not available in monolith mode.

空消息队列实现包,用于单体应用场景。 此消息队列不执行任何操作:Publish 静默成功,Subscribe 返回空取消订阅。 注意:消息队列在单体模式下不可用。

Index

Constants

This section is empty.

Variables

View Source
var ErrNoopQueue = errors.New("messagequeue: noop mode, message queue not available in monolith")

ErrNoopQueue indicates message queue is not available in monolith mode.

ErrNoopQueue 表示消息队列在单体模式下不可用。

Functions

func NewNoopQueue added in v0.2.0

func NewNoopQueue() *noopQueue

NewNoopQueue creates a fully initialized no-op queue.

NewNoopQueue 创建完成初始化的空消息队列。

Types

type Provider

type Provider struct{}

Provider registers no-op message queue contracts.

Provider 注册空消息队列契约。

func NewProvider

func NewProvider() *Provider

NewProvider creates a new no-op message queue provider instance.

NewProvider 创建新的空消息队列 Provider 实例。

func (*Provider) Boot

Boot is a no-op for this provider.

Boot 此 Provider 无启动逻辑。

func (*Provider) DependsOn

func (p *Provider) DependsOn() []string

DependsOn returns the keys this provider depends on. Noop message queue has no dependencies.

DependsOn 返回该 provider 依赖的 key。 Noop message queue 无依赖。

func (*Provider) IsDefer

func (p *Provider) IsDefer() bool

IsDefer returns true, message queue can be deferred until first use.

IsDefer 返回 true,消息队列可延迟初始化直到首次使用。

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name "messagequeue.noop".

Name 返回 Provider 名称 "messagequeue.noop"。

func (*Provider) Provides

func (p *Provider) Provides() []string

Provides returns the message queue contract keys.

Provides 返回消息队列契约键列表。

func (*Provider) Register

func (p *Provider) Register(c runtimecontract.Container) error

Register binds the no-op message queue components to the container.

Register 将空消息队列组件绑定到容器。

Jump to

Keyboard shortcuts

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