eventbus

package
v0.0.0-...-63ace11 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitEventBus

func InitEventBus()

Types

type EventBus

type EventBus interface {
	Init()

	// async send msg
	Publish([]byte)

	PublishEvent(*proto.PaasEvent)

	// blocking receive msg when received
	Receive() (interface{}, error)

	Close()
}
var (
	EVENTBUS EventBus = nil
)

func NewPulsarBusImpl

func NewPulsarBusImpl() EventBus

type EventBusConsumer

type EventBusConsumer interface {
	// poll one msg from local cache queue or from broker
	Receive() (interface{}, error)

	// close consumer
	Close()
}

func CreatePulsarConsumer

func CreatePulsarConsumer() EventBusConsumer

type EventBusProducer

type EventBusProducer interface {
	// sync send msg
	Send([]byte) error

	// async send msg
	SendAsync([]byte)

	// close producer
	Close()
}

func CreatePulsarProducer

func CreatePulsarProducer() EventBusProducer

type PulsarBusImpl

type PulsarBusImpl struct {
	// contains filtered or unexported fields
}

func (*PulsarBusImpl) Close

func (p *PulsarBusImpl) Close()

func (*PulsarBusImpl) Init

func (p *PulsarBusImpl) Init()

func (*PulsarBusImpl) Publish

func (p *PulsarBusImpl) Publish(data []byte)

func (*PulsarBusImpl) PublishEvent

func (p *PulsarBusImpl) PublishEvent(event *proto.PaasEvent)

func (*PulsarBusImpl) Receive

func (p *PulsarBusImpl) Receive() (interface{}, error)

type PulsarConsumer

type PulsarConsumer struct {
	// contains filtered or unexported fields
}

func (PulsarConsumer) Close

func (m PulsarConsumer) Close()

func (PulsarConsumer) Receive

func (m PulsarConsumer) Receive() (interface{}, error)

type PulsarProducer

type PulsarProducer struct {
	// contains filtered or unexported fields
}

func (PulsarProducer) Close

func (m PulsarProducer) Close()

func (PulsarProducer) Send

func (m PulsarProducer) Send(data []byte) error

func (PulsarProducer) SendAsync

func (m PulsarProducer) SendAsync(data []byte)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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