broker

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

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

func NewBroker

func NewBroker() *Broker

func (*Broker) Cancel

func (b *Broker) Cancel()

func (*Broker) Close

func (b *Broker) Close() error

Close Block waiting for method Finish to call

func (*Broker) Ctx

func (b *Broker) Ctx() context.Context

func (*Broker) Finish

func (b *Broker) Finish()

func (*Broker) Middleware

func (b *Broker) Middleware(mws ...middleware.Middleware)

func (*Broker) Register

func (b *Broker) Register(name string, handler bee.Handler, opts ...bee.Option)

func (*Broker) Router

func (b *Broker) Router(name string) (handler bee.Handler, ok bool)

func (*Broker) Send

func (b *Broker) Send(ctx context.Context, name string, data interface{}) error

func (*Broker) SendDelay

func (b *Broker) SendDelay(ctx context.Context, name string, body interface{}, delay time.Duration) error

func (*Broker) Worker

func (b *Broker) Worker() error

type IBroker

type IBroker interface {
	// Register Registration handler function
	Register(name string, handler bee.Handler, opts ...bee.Option)
	// Middleware Registers the middleware of the handler function
	Middleware(mws ...middleware.Middleware)
	// Worker Start consumer workers
	Worker() error
	// Close broker
	Close() error

	// Send Produce the message to execute the handler function asynchronously
	Send(ctx context.Context, name string, value interface{}) error
	// SendDelay Produce the delay message to execute the handler function asynchronously
	SendDelay(ctx context.Context, name string, value interface{}, delay time.Duration) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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