signaling

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptySignalName 表示信号名为空。
	ErrEmptySignalName = errors.New("signal name is empty")
	// ErrNilHandler 表示监听处理函数为空。
	ErrNilHandler = errors.New("signal handler is nil")
)

Functions

This section is empty.

Types

type Handler

type Handler[T Signal] func(ctx context.Context, signal T)

Handler 定义信号处理函数。

type Notifier

type Notifier[T Signal] interface {
	Notify(ctx context.Context, signal T) error
}

Notifier 提供信号发送能力。

type Signal

type Signal interface {
	SignalName() string
	SignalKey() string
}

Signal 描述一个临时通知信号。 SignalName 用于路由到 Redis channel; SignalKey 用于业务侧按键分发(例如 assessment_id)。

type Watcher

type Watcher[T Signal] interface {
	Watch(ctx context.Context, handler Handler[T]) error
}

Watcher 提供信号监听能力。

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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