nats

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package nats provides a NATS adapter for Kiara.

Index

Constants

This section is empty.

Variables

View Source
var (
	// This error is reported via Adapter.Errors() when the adapter can't deliver
	// succeeding messages arrived from NATS because Adapter.Delivered() is already full.
	ErrSlowConsumer = errors.New("slow consumer")

	// This error is returned by Adapter.Subscribe() when the topic is already subscribed.
	ErrAlreadySubscribed = errors.New("already subscribed")
)

Functions

This section is empty.

Types

type Adapter

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

Adapter is an adapter that sends messages through NATS.

func NewAdapter

func NewAdapter(conn *nats.Conn, options ...Option) *Adapter

NewAdapter creates a new Adapter.

func (*Adapter) Start added in v0.2.0

func (a *Adapter) Start(pipe *types.Pipe)

func (*Adapter) Stop added in v0.2.0

func (a *Adapter) Stop()

func (*Adapter) Subscribe

func (a *Adapter) Subscribe(topic string) error

func (*Adapter) Unsubscribe

func (a *Adapter) Unsubscribe(topic string) error

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option configures the Adapter.

func FlushInterval

func FlushInterval(interval time.Duration) Option

FlushInterval sets the interval for flushing.

Jump to

Keyboard shortcuts

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