messagebus

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MsgBuilders = make(map[int]MessageSenderBuilder)

Functions

func AddMsgBuilder

func AddMsgBuilder(builderType int, builder MessageSenderBuilder)

func ClearInit

func ClearInit()

this func is just for testing. Don't use it in other place.

Types

type MessageSender

type MessageSender interface {
	// send the message async
	AsyncSend(msg *types.Message) error
	// flush all the messages, timeout is in ms.
	Flush(timeout int) error
	// free this instance.
	Close()
}
var MsgSender MessageSender

func GetMessageSender

func GetMessageSender() (MessageSender, error)

create the singleton MessageSender

type MessageSenderBuilder

type MessageSenderBuilder interface {
	Create(config helper.MsgBusConfig) (MessageSender, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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