batch

package
v1.8.0-fossa.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CallbackJobPending no status
	CallbackJobPending = ""
	// CallbackJobQueued callback job has been queued
	CallbackJobQueued = "1"
	// CallbackJobSucceeded callback job has succeeded
	CallbackJobSucceeded = "2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchSubsystem

type BatchSubsystem struct {
	Server *server.Server

	Fetcher manager.Fetcher
	Options *Options
	// contains filtered or unexported fields
}

BatchSubsystem enables jobs to be grouped into a batch the implementation follows the spec here: https://github.com/contribsys/faktory/wiki/Ent-Batches Except child batches, which are not implemented

func (*BatchSubsystem) Name

func (b *BatchSubsystem) Name() string

Name - name of the plugin

func (*BatchSubsystem) Reload

func (b *BatchSubsystem) Reload(s *server.Server) error

Reload does not do anything

func (*BatchSubsystem) Start

func (b *BatchSubsystem) Start(s *server.Server) error

Start - configures the batch subsystem

type NewBatchRequest

type NewBatchRequest struct {
	//	ParentBid   string      `json:"parent_bid,omitempty"`
	Description      string      `json:"description,omitempty"`
	Success          *client.Job `json:"success,omitempty"`
	Complete         *client.Job `json:"complete,omitempty"`
	ChildSearchDepth *int        `json:"child_search_depth,omitempty"`
}

NewBatchRequest structure for a new batch request Success and Complete are jobs to be queued once the batch has been committed and all jobs processed

type Options

type Options struct {
	// Enabled - toggle for enabling the plugin
	Enabled bool
	// ChildSearchDepth - the n-th depth/level at which a batch will check if a child batch is done
	ChildSearchDepth int
	// UncommittedTimeout - number of minutes a batch is set to expire before committed
	UncommittedTimeoutMinutes int
	// CommittedTimeout - number of days long a can exist after its been commited
	CommittedTimeoutDays int
}

Jump to

Keyboard shortcuts

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