logger

package
v0.0.0-...-e120ae1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 9 Imported by: 9

Documentation

Overview

Package logger is a set of implementations to support amboy.Queue backed grip/send.Senders for asynchronous and (generally) non-blocking log message delivery.

You can use amboy.Queue backed senders as an extension of an existing queue or use constructors that use the queue.NewLimitedSizeLocalQueue to deliver messages.

These implementations do not guarantee delivery of log messages to senders in any particular order.

These senders do not provide any batching or group message sending: messages are dispatched to queues immediately upon receipt. The grip/send.NewBufferedSender implementation has these properties.

The multi-sender implementation provided by this method creates a single Job for every message. If you want to have a single Job for every message, use the grip/send.MakeMultiSender in combination with the single sender.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeQueueSender

func MakeQueueSender(ctx context.Context, q amboy.Queue, sender send.Sender) send.Sender

MakeQueueSender wraps the sender with a queue-backed delivery mechanism using the specified queue instance.

These senders do not ensure that logged messages are propagated to the underlying sender implementation in any order, and may result in out-of-order logging.

The close method does not close the underlying sender.

In the event that the sender's Put method returns an error, the message (and its error) will be logged directly (and synchronously)

func NewQueueBackedSender

func NewQueueBackedSender(ctx context.Context, sender send.Sender, workers, capacity int) (send.Sender, error)

NewQueueBackedSender creates a new LimitedSize queue, and creates a sender implementation wrapping this sender. The queue is not shared.

This sender returns an error if there is a problem starting the queue, and cancels the queue upon closing, without waiting for the queue to empty.

func NewSendMessageJob

func NewSendMessageJob(m message.Composer, s send.Sender) amboy.Job

NewSendMessageJob creates an amboy.Job instance that sends the specified message to the specified sender.

This job is not compatible with remote-storage backed queues.

Types

This section is empty.

Jump to

Keyboard shortcuts

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