task

package
v0.0.0-...-6bb929a Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

TaskProvider

Functions

This section is empty.

Types

type ITask

type ITask interface {
	Subscribe(topic []string, h broker.Handler, queue ...string) error
	Publish(ctx context.Context, topic string, msg *broker.Message) error
}

ITask

type Task

type Task struct {
	Broker *broker.Broker
}

Task

func NewTask

func NewTask(
	bk *broker.Broker,
) (*Task, error)

func (*Task) Publish

func (p *Task) Publish(ctx context.Context, topic string, msg *broker.Message) error

Publish 发送消息

func (*Task) Subscribe

func (p *Task) Subscribe(topic []string, h broker.Handler, queue ...string) error

Subscribe 订阅消息 queue 是订阅的队列。queue相同,则只会接收到一个消息,否则接到多个

Jump to

Keyboard shortcuts

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