amboy: Index | Files

package logger

import ""

Package logqueue 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 Queue backed senders as an extension of an existing queue or use constructors that use the LimitedSizeLocalQueue do 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 property.

The multi-sender implementation provded 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.


Package Files

docs.go job_multi.go job_single.go sender_multi.go sender_single.go

func MakeQueueMultiSender Uses

func MakeQueueMultiSender(q amboy.Queue, senders ...send.Sender) send.Sender

MakeQueueMultiSender returns a amboy.Queue-backed sender that distributes messages to multiple backing Sender implementations.

In most respects this Sender is like any other; however, messages may be delivered out of order, and it pushes level-based filtering down to constituent senders. Additionally, the close method does not close the constituent senders.

Internally each message maps to a single job which calls send on each constituent sender independently. This means that if a single sender is blocking, then that sender may prevent other senders from receiving the message.

func MakeQueueSender Uses

func MakeQueueSender(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 NewMultiSendMessageJob Uses

func NewMultiSendMessageJob(m message.Composer, s []send.Sender) amboy.Job

NewMultiSendMessageJob buils and amboy.Job instance that sends a single message to a group of Sender implementations. The job sends the message to each Sender serially.

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

func NewQueueBackedSender Uses

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 NewQueueMultiSender Uses

func NewQueueMultiSender(ctx context.Context, workers, capacity int, senders ...send.Sender) (send.Sender, error)

NewQueueMultiSender returns a queue-backed wrapper of a group of senders, but constructs the queue independently. When the Close method on this sender, the queue is canceled, which may leave some pending messages unsent.

func NewSendMessageJob Uses

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.

Package logger imports 8 packages (graph) and is imported by 7 packages. Updated 2018-04-25. Refresh now. Tools for package owners.