messagerequester

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: Apache-2.0, BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultRetryInterval defines the Default Retry Interval of the message requester.
	DefaultRetryInterval = 10 * time.Second
)

Variables

View Source
var (
	// DefaultRequestWorkerCount defines the Default Request Worker Count of the message requester.
	DefaultRequestWorkerCount = runtime.GOMAXPROCS(0)
)

Functions

This section is empty.

Types

type Events

type Events struct {
	// Fired when a request for a given message should be sent.
	SendRequest *events.Event
}

Events represents events happening on a message requester.

type MessageRequester

type MessageRequester struct {
	Events Events
	// contains filtered or unexported fields
}

MessageRequester takes care of requesting messages.

func New

func New(optionalOptions ...Option) *MessageRequester

New creates a new message requester.

func (*MessageRequester) ScheduleRequest

func (requester *MessageRequester) ScheduleRequest(messageId message.Id)

ScheduleRequest schedules a request for the given message.

func (*MessageRequester) StopRequest

func (requester *MessageRequester) StopRequest(messageId message.Id)

StopRequest stops requests for the given message to further happen.

type Option

type Option func(*Options)

Option is a function which inits an option.

func RetryInterval

func RetryInterval(interval time.Duration) Option

RetryInterval creates an option which sets the retry interval to the given value.

func WorkerCount

func WorkerCount(workerCount int) Option

WorkerCount creates an option which sets the worker count to the given value.

type Options

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

Options holds options for a message requester.

Jump to

Keyboard shortcuts

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