messagebus

package
Version: v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 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