event

package
v0.0.0-...-826b3e1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AckEvent

func AckEvent(
	event DomainEvent,
) error

func InjectMq

func InjectMq(eventChannel mq.MsgQueue)

func ListenEvent

func ListenEvent(
	event DomainEvent, listenerTag string,
	respEventChan chan DomainEvent,
) error

ListenEvent 监听某项事件

对比PubEvent,为什么多了listenerTag参数呢? 因为发布是发布一种类型的事件,其不需要也不应该知道有哪些地方需要订阅此事件 也就是说对于同一个事件的发布,可能有多个订阅者,所以需要传入订阅者的标识

Types

type ClientRunFunction

type ClientRunFunction struct {
	FunctionRunRecordID string
	ClientName          string
	// contains filtered or unexported fields
}

func (*ClientRunFunction) DeliveryTag

func (event *ClientRunFunction) DeliveryTag() uint64

func (*ClientRunFunction) Identity

func (event *ClientRunFunction) Identity() string

Identity

func (*ClientRunFunction) Marshal

func (event *ClientRunFunction) Marshal() ([]byte, error)

Marshal .

func (*ClientRunFunction) Topic

func (event *ClientRunFunction) Topic() string

func (*ClientRunFunction) Unmarshal

func (event *ClientRunFunction) Unmarshal(data *amqp.Delivery) (err error)

Unmarshal .

type DomainEvent

type DomainEvent interface {
	Topic() string
	Marshal() ([]byte, error)
	Unmarshal(data *amqp.Delivery) (err error)
	Identity() string
	DeliveryTag() uint64
}

Jump to

Keyboard shortcuts

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