Skip to main content

worker

worker

import "github.com/conductor-sdk/conductor-go/sdk/worker"

Index

type TaskRunner

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

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

func NewTaskRunner

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

func NewTaskRunnerWithApiClient

func NewTaskRunnerWithApiClient(apiClient *client.APIClient) *TaskRunner

func (*TaskRunner) DecreaseBatchSize

func (c *TaskRunner) DecreaseBatchSize(taskName string, batchSize int) error

func (*TaskRunner) GetBatchSizeForAll

func (c *TaskRunner) GetBatchSizeForAll() (batchSizeByTaskName map[string]int)

func (*TaskRunner) GetBatchSizeForTask

func (c *TaskRunner) GetBatchSizeForTask(taskName string) (batchSize int)

func (*TaskRunner) GetPollIntervalForTask

func (c *TaskRunner) GetPollIntervalForTask(taskName string) (pollInterval time.Duration, err error)

func (*TaskRunner) IncreaseBatchSize

func (c *TaskRunner) IncreaseBatchSize(taskName string, batchSize int) error

func (*TaskRunner) Pause

func (c *TaskRunner) Pause(taskName string)

Pause a running worker. When paused worker will not poll for new task. Worker must be resumed using Resume

func (*TaskRunner) Resume

func (c *TaskRunner) Resume(taskName string)

Resume a running worker. If the worker is not paused, calling this method has no impact

func (*TaskRunner) SetBatchSize

func (c *TaskRunner) SetBatchSize(taskName string, batchSize int) error

func (*TaskRunner) SetPollIntervalForTask

func (c *TaskRunner) SetPollIntervalForTask(taskName string, pollInterval time.Duration) error

func (*TaskRunner) StartWorker

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

StartWorker - taskName Task name 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(taskName string, executeFunction model.ExecuteTaskFunction, batchSize int, pollInterval time.Duration, domain string) error

StartWorkerWithDomain - taskName Task name 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()

Generated by gomarkdoc