workers

package
v0.15.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Workers

type Workers struct {
	// Main task scheduler instance.
	Scheduler scheduler.Scheduler

	// ClientAPI provides a worker pool that handles both
	// incoming client actions, and our own side-effects.
	ClientAPI runners.WorkerPool

	// Federator provides a worker pool that handles both
	// incoming federated actions, and our own side-effects.
	Federator runners.WorkerPool

	// Enqueue functions for clientAPI / federator worker pools,
	// these are pointers to Processor{}.Enqueue___() msg functions.
	// This prevents dependency cycling as Processor depends on Workers.
	EnqueueClientAPI func(context.Context, ...messages.FromClientAPI)
	EnqueueFediAPI   func(context.Context, ...messages.FromFediAPI)

	// Blocking processing functions for clientAPI / federator.
	// These are pointers to Processor{}.Process___() msg functions.
	// This prevents dependency cycling as Processor depends on Workers.
	//
	// Rather than queueing messages for asynchronous processing, these
	// functions will process immediately and in a blocking manner, and
	// will not use up a worker slot.
	//
	// As such, you should only call them in special cases where something
	// synchronous needs to happen before you can do something else.
	ProcessFromClientAPI func(context.Context, messages.FromClientAPI) error
	ProcessFromFediAPI   func(context.Context, messages.FromFediAPI) error

	// Media manager worker pools.
	Media runners.WorkerPool
	// contains filtered or unexported fields
}

func (*Workers) Start

func (w *Workers) Start()

Start will start all of the contained worker pools (and global scheduler).

func (*Workers) Stop

func (w *Workers) Stop()

Stop will stop all of the contained worker pools (and global scheduler).

Jump to

Keyboard shortcuts

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