Skip to main content

worker

StdoutLogger

from dara.core.internal.pool.worker import StdoutLogger

class StdoutLogger()

A mock stdout which instead puts logs into channel messages

execute_function

def execute_function(func: Callable, args: tuple, kwargs: dict)

Execute a function, handling sync/async and exceptions cleanly

Arguments:

  • func: function to execute
  • args: arguments to the function
  • kwargs: keyword arguments to the function

worker_loop

def worker_loop(worker_params: WorkerParameters, channel: Channel)

Main worker loop

Arguments:

  • worker_params: worker parameters
  • channel: communication channel

WorkerProcess

from dara.core.internal.pool.worker import WorkerProcess

class WorkerProcess()

Attributes

  • process: SpawnProcess
  • status: WorkerStatus
  • task_uid: Optional[str]
  • channel: Channel
  • updated_at: datetime

task_uid

Current task UID being processed by the worker

updated_at

When the worker status has last been updated