mbox

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalMailbox

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

LocalMailbox implements the underline logic necessary for providing a buffered mailbox for message delivery to specific handlers.

func NewLocalMailbox

func NewLocalMailbox(
	ctx context.Context,
	mailer *LocalMailer,
	topic string,
	logger sabuhp.Logger,
	bufferSize int,
) *LocalMailbox

func (*LocalMailbox) Add

func (ps *LocalMailbox) Add(callback sabuhp.TransportResponse) *localMailboxChannel

func (*LocalMailbox) Deliver

func (ps *LocalMailbox) Deliver(message *sabuhp.Message) error

func (*LocalMailbox) DeliverTimeout

func (ps *LocalMailbox) DeliverTimeout(message *sabuhp.Message, timeout time.Duration) error

func (*LocalMailbox) Disconnect

func (ps *LocalMailbox) Disconnect(channel *localMailboxChannel)

func (*LocalMailbox) MessageChannel

func (ps *LocalMailbox) MessageChannel() chan *sabuhp.Message

func (*LocalMailbox) Start

func (ps *LocalMailbox) Start()

func (*LocalMailbox) Stop

func (ps *LocalMailbox) Stop()

func (*LocalMailbox) Wait

func (ps *LocalMailbox) Wait()

type LocalMailer

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

func NewLocalMailer

func NewLocalMailer(
	ctx context.Context,
	mailboxBuffer int,
	logger sabuhp.Logger,
) *LocalMailer

func (*LocalMailer) Conn

func (p *LocalMailer) Conn() sabuhp.Conn

func (*LocalMailer) Listen

func (p *LocalMailer) Listen(topic string, callback sabuhp.TransportResponse) sabuhp.Channel

Channel creates necessary subscription to target topic on provided transport. It also creates an internal mailbox for the delivery of those commands.

func (*LocalMailer) SendToAll

func (p *LocalMailer) SendToAll(message *sabuhp.Message, timeout time.Duration) error

func (*LocalMailer) SendToOne

func (p *LocalMailer) SendToOne(message *sabuhp.Message, timeout time.Duration) error

func (*LocalMailer) Stop

func (p *LocalMailer) Stop()

func (*LocalMailer) Wait

func (p *LocalMailer) Wait()

type Mailbox

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

Mailbox implements the underline logic necessary for providing a buffered mailbox for message delivery to specific handlers.

func NewMailbox

func NewMailbox(
	ctx context.Context,
	topic string,
	logger sabuhp.Logger,
	bufferSize int,
	transport sabuhp.Transport,
) *Mailbox

func (*Mailbox) Add

func (ps *Mailbox) Add(callback sabuhp.TransportResponse) *mailboxChannel

func (*Mailbox) Deliver

func (ps *Mailbox) Deliver(message *sabuhp.Message) error

func (*Mailbox) DeliverTimeout

func (ps *Mailbox) DeliverTimeout(message *sabuhp.Message, timeout time.Duration) error

func (*Mailbox) Disconnect

func (ps *Mailbox) Disconnect(channel *mailboxChannel)

func (*Mailbox) MessageChannel

func (ps *Mailbox) MessageChannel() chan *sabuhp.Message

func (*Mailbox) Start

func (ps *Mailbox) Start()

func (*Mailbox) Stop

func (ps *Mailbox) Stop()

func (*Mailbox) Wait

func (ps *Mailbox) Wait()

type Mailer

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

func NewMailer

func NewMailer(
	ctx context.Context,
	mailboxBuffer int,
	logger sabuhp.Logger,
	transport sabuhp.Transport,
) *Mailer

func (*Mailer) Conn

func (p *Mailer) Conn() sabuhp.Conn

func (*Mailer) Listen

func (p *Mailer) Listen(topic string, callback sabuhp.TransportResponse) sabuhp.Channel

Channel creates necessary subscription to target topic on provided transport. It also creates an internal mailbox for the delivery of those commands.

func (*Mailer) SendToAll

func (p *Mailer) SendToAll(message *sabuhp.Message, timeout time.Duration) error

func (*Mailer) SendToOne

func (p *Mailer) SendToOne(message *sabuhp.Message, timeout time.Duration) error

func (*Mailer) Stop

func (p *Mailer) Stop()

func (*Mailer) Wait

func (p *Mailer) Wait()

Jump to

Keyboard shortcuts

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