nats

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const BufferSize = 64

BufferSize holds channel buffer size for subscription (some messages are lost if chan unbufferred)

Variables

This section is empty.

Functions

func New

func New(epa types.EndPointAttr, dsn string) (types.EndPoint, error)

New creates endpoint

func NewConnected

func NewConnected(epa types.EndPointAttr, nc Server) (types.EndPoint, error)

NewConnected creates endpoint for connected service

Types

type EndPoint

type EndPoint struct {
	types.EndPointAttr
	// contains filtered or unexported fields
}

EndPoint holds nats linked endpoint

func (EndPoint) Listen

func (ep EndPoint) Listen(id int, channel string, pipe chan string) error

Listen starts all listening goroutines

func (EndPoint) Notify

func (ep EndPoint) Notify(id int, channel string, pipe chan string) error

Notify starts all notify goroutines

type Server

type Server interface {
	ChanSubscribe(subj string, ch chan *engine.Msg) (*engine.Subscription, error)
	Publish(subj string, data []byte) error
	Close()
}

Server holds used nats signatures, see nats_test.go

Jump to

Keyboard shortcuts

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