faktory

package
v0.0.0-...-5d153c6 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

This is a custom packaging of the Faktory job engine which can be embedded within Sparq in order to provide in-process persistent background jobs.

We do not provide a TCP port for external access. All job creation and processing happens within the Sparq process. The Faktory Web UI is mounted within the Sparq Web UI just as Mastodon provides the Sidekiq Web UI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToFailure

func ToFailure(jid string, err error) *manager.FailPayload

Types

type Manager

type Manager interface {
	sparq.Pusher
	Fetch(ctx context.Context, wid string, queues ...string) (*client.Job, error)

	Fail(ctx context.Context, fail *manager.FailPayload) error
	Acknowledge(ctx context.Context, jid string) (*client.Job, error)
}

type Options

type Options struct {
	StorageDirectory string
	RedisSock        string
}

type Server

type Server struct {
	Options
	StartedAt    time.Time
	RedisStopper func()
	// contains filtered or unexported fields
}

func NewServer

func NewServer(opts Options) (*Server, error)

func (*Server) Close

func (s *Server) Close()

func (*Server) CurrentState

func (s *Server) CurrentState(ctx context.Context) (map[string]interface{}, error)

func (*Server) Manager

func (s *Server) Manager() manager.Manager

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

func (*Server) RuntimeStats

func (s *Server) RuntimeStats() map[string]interface{}

func (*Server) Store

func (s *Server) Store() storage.Store

type Taskable

type Taskable interface {
	Name() string
	Execute(ctx context.Context) error
	Stats(ctx context.Context) map[string]interface{}
}

Jump to

Keyboard shortcuts

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