natsmsgqueue

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MSGQueue

type MSGQueue struct {
	Host string
	// contains filtered or unexported fields
}

MSGQueue defines a messaging queue handled by the NATS server.

func New

func New(ctx context.Context, uri, subject string) (*MSGQueue, error)

New creates and opens a NATS messaging queue connection.

func (*MSGQueue) Publish

func (mq *MSGQueue) Publish(data []byte) error

Publish publishes a message to the specified subject.

func (*MSGQueue) Subscribe

func (mq *MSGQueue) Subscribe(h handler.MSGHandlerFunc) error

Subscribe opens a subscriber to the specified subject. Incoming messages will be forwarded to the handler. This will block until NATS's context ends.

Jump to

Keyboard shortcuts

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