queue

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2019 License: AGPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventEnqueuer

func EventEnqueuer(ctx context.Context, q queue.Queue) lookout.EventHandler

EventEnqueuer returns an event handler that pushes events to the queue.

func RunEventDequeuer

func RunEventDequeuer(
	ctx context.Context,
	q queue.Queue,
	eventHandler lookout.EventHandler,
	concurrent int,
) error

RunEventDequeuer starts an infinite loop that takes jobs from the queue as they become available. Concurrent determines the maximum number of goroutines used to call the given event handler.

Types

type QueueJob

type QueueJob struct {
	EventType lookout.EventType
	// Exported so go-queue marshals it, but should be accessed through Event()
	ReviewEvent *lookout.ReviewEvent
	// Exported so go-queue marshals it, but should be accessed through Event()
	PushEvent *lookout.PushEvent
	// LogFields contains ctxlog logger fields to keep log continuity
	LogFields log.Fields
}

QueueJob is the data sent to the queue

func NewQueueJob

func NewQueueJob(ctx context.Context, e lookout.Event) (*QueueJob, error)

NewQueueJob creates a new QueueJob from the given Event

func (QueueJob) Event

func (j QueueJob) Event() (lookout.Event, error)

Event returns the lookout Event stored in this queue job

Jump to

Keyboard shortcuts

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