worker

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: Apache-2.0 Imports: 13 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TaskRunner

type TaskRunner struct {
	// contains filtered or unexported fields
}

TaskRunner Runner for the Task Workers. Task Runners implements the polling and execution logic for the workers

func NewTaskRunner

func NewTaskRunner(authenticationSettings *settings.AuthenticationSettings, httpSettings *settings.HttpSettings) *TaskRunner

func NewTaskRunnerWithApiClient

func NewTaskRunnerWithApiClient(
	apiClient *client.APIClient,
) *TaskRunner

func (*TaskRunner) RemoveWorker

func (c *TaskRunner) RemoveWorker(taskType string, threadCount int) error

func (*TaskRunner) StartWorker

func (c *TaskRunner) StartWorker(taskType string, executeFunction model.ExecuteTaskFunction, batchSize int, pollInterval time.Duration) error

StartWorker

  • taskType Task Type to poll and execute the work
  • executeFunction Task execution function
  • batchSize Amount of tasks to be polled. Each polled task will be executed and updated within its own unique goroutine.
  • pollInterval Time to wait for between polls if there are no tasks available. Reduces excessive polling on the server when there is no work

func (*TaskRunner) StartWorkerWithDomain

func (c *TaskRunner) StartWorkerWithDomain(taskType string, executeFunction model.ExecuteTaskFunction, threadCount int, pollInterval time.Duration, domain string) error

StartWorkerWithDomain

  • taskType Task Type to poll and execute the work
  • executeFunction Task execution function
  • batchSize Amount of tasks to be polled. Each polled task will be executed and updated within its own unique goroutine.
  • pollInterval Time to wait for between polls if there are no tasks available. Reduces excessive polling on the server when there is no work
  • domain Task domain. Optional for polling

func (*TaskRunner) WaitWorkers

func (c *TaskRunner) WaitWorkers()

Jump to

Keyboard shortcuts

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