Help us shape the future of Go! Take the 2026 Go Developer Survey

queues

package module
v0.0.0-...-3f52206 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: MIT Imports: 2 Imported by: 0

README

queues

Documentation

Overview

Package queues presents interface (and its implementation sets) of a queues.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(msg Message) error

Handler predetermines the type of the basic function of the message handler.

type Message

type Message interface {
	Body() []byte
	Timestamp() int64
	AttemptsCount() uint16
	QueueAddr() string
	HasResponded() bool
	DisableAutoResponse()
	Touch()
	RequeueWithoutBackoff(delay time.Duration)
	Finish()
	Context() context.Context
	Subject() string
}

Message predetermines the message type for handler.

type Pinger

type Pinger interface {
	Ping(ctx context.Context) error
}

Pinger predetermines the type of the basic function of the ping action.

type Publisher

type Publisher interface {
	Publish(ctx context.Context, subj string, body []byte) error
}

Publisher predetermines the type of the basic function of the publish action.

type QueueManager

type QueueManager interface {
	Publisher
	Pinger
	Subscribe(ctx context.Context, subj string, handler Handler) (Subscriber, error)
	Unsubscribe(ctx context.Context)
	Stop(ctx context.Context)
}

QueueManager provides an interface for managing queue.

type Subscriber

type Subscriber interface {
	Unsubscribe(ctx context.Context) error
	Stop(ctx context.Context)
}

Subscriber predetermines the type of the basic function of the subscriber queue.

Directories

Path Synopsis
Package nsq represents the interface queues implementation.
Package nsq represents the interface queues implementation.

Jump to

Keyboard shortcuts

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