cherami

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inbound

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

Inbound receives Oneway YARPC requests over Cherami.

func (*Inbound) IsRunning

func (i *Inbound) IsRunning() bool

IsRunning returns whether the inbound is still processing requests.

func (*Inbound) SetRouter

func (i *Inbound) SetRouter(router transport.Router)

SetRouter configures a router to handle incoming requests. This satisfies the transport.Inbound interface, and would be called by a dispatcher when it starts.

func (*Inbound) Start

func (i *Inbound) Start() error

Start starts the inbound, reads and handle messages from Cherami.

func (*Inbound) Stop

func (i *Inbound) Stop() error

Stop ends the connection to Cherami.

func (*Inbound) Transports

func (i *Inbound) Transports() []transport.Transport

Transports returns the transport that the inbound uses.

type InboundConfig

type InboundConfig struct {
	Destination   string
	ConsumerGroup string
	PrefetchCount int
}

InboundConfig defines the config in order to create a Inbound.

PrefetchCount controls the number of messages to buffer locally. Inbounds which process messages very fast may want to specify larger value for PrefetchCount for faster throughput. On the flip side larger values for PrefetchCount will result in more messages being buffered locally causing high memory footprint.

type Outbound

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

Outbound is a outbound that uses Cherami as the transport.

func (*Outbound) CallOneway

func (o *Outbound) CallOneway(ctx context.Context, req *transport.Request) (transport.Ack, error)

CallOneway makes a oneway request using Cherami.

func (*Outbound) IsRunning

func (o *Outbound) IsRunning() bool

IsRunning returns whether the outbound is still running.

func (*Outbound) Start

func (o *Outbound) Start() error

Start starts the outbound.

func (*Outbound) Stop

func (o *Outbound) Stop() error

Stop ends the connection to Cherami.

func (*Outbound) Transports

func (o *Outbound) Transports() []transport.Transport

Transports returns the transport that the outbound uses.

type OutboundConfig

type OutboundConfig struct {
	Destination string
}

OutboundConfig defines the config in order to create a Outbound.

type Transport

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

Transport keeps shared objects between inbound and outbound.

func NewTransport

func NewTransport(client cherami.Client) *Transport

NewTransport creates a new cherami transport for shared objects between inbound and outbound.

func (*Transport) IsRunning

func (t *Transport) IsRunning() bool

IsRunning returns whether the cherami transport is running.

func (*Transport) NewInbound

func (t *Transport) NewInbound(config InboundConfig) *Inbound

NewInbound builds a new Cherami inbound.

func (*Transport) NewOutbound

func (t *Transport) NewOutbound(config OutboundConfig) *Outbound

NewOutbound builds a new cherami outbound.

func (*Transport) Start

func (t *Transport) Start() error

Start starts the cherami transport.

func (*Transport) Stop

func (t *Transport) Stop() error

Stop stops the cherami transport.

Jump to

Keyboard shortcuts

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