async

package
v0.0.0-...-3b26d93 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncRequestResponseService

type AsyncRequestResponseService interface {
	ClosableMessagingService

	Request(ctx context.Context, topic string, data []byte, timeout time.Duration) ([]byte, error)
}

Async request response service interface

func NewNatsRequestResponseService

func NewNatsRequestResponseService(config NatsMessagingConfig) (AsyncRequestResponseService, error)

type ClosableMessagingService

type ClosableMessagingService interface {
	Close() error
}

type MessageHandler

type MessageHandler func(context.Context, []byte) error

Application defined handler function for incoming messages

type MessagingQueueSubscription

type MessagingQueueSubscription interface {
	Unsubscribe() error
}

Interface for a subscribed queue

type MessagingService

type MessagingService interface {
	ClosableMessagingService

	Publish(ctx context.Context, topic string, data []byte) error
	QueueSubscribe(topic string, queue string, callback MessageHandler) (MessagingQueueSubscription, error)
}

Low level messaging service interface

func NewNatsMessagingService

func NewNatsMessagingService(config NatsMessagingConfig) (MessagingService, error)

type NatsMessagingConfig

type NatsMessagingConfig struct {
	NatsURL string
}

Jump to

Keyboard shortcuts

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