spec

package
v0.0.0-...-4d0668e Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IMessage

type IMessage[T common.Type] interface {
	Publisher[T]
	Subscriber[T]
	SubscriberSync[T]
	common.Error
}

Messager is an interfer that implements two other interfaces which are Publisher and Subscriber

type Publisher

type Publisher[T common.Type] interface {
	Publish(ctx context.Context, message *common.Message[T]) IMessage[T]
}

Publisher is to publish a message on a topic/subject

type Subscriber

type Subscriber[T common.Type] interface {
	Subscribe(ctx context.Context, message *common.Message[T], f func(data T)) IMessage[T]
}

Subscriber is used to subscribe a message on a subject/topic

type SubscriberSync

type SubscriberSync[T common.Type] interface {
	SubscribeSync(ctx context.Context, message *common.Message[T], f func(data T)) IMessage[T]
}

Subscriber is used to subscribe a message on a subject/topic

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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