Temporalex.Worker (Temporalex v0.5.4)

Copy Markdown View Source

Supervisor for one Temporalex worker instance.

A worker is a poller + executor bound to one task queue — the deployment topology written down: this node serves these workflows. The minimal spec is just that statement:

{Temporalex.Worker, workflows: [Booking, Waitlist], activities: [Bookings.Activities]}

Everything else is derived:

  • the task queue has exactly one source: derived from the workflow modules' use ..., queue: declarations (boot error if they disagree). Passing task_queue: alongside declaring modules is a boot error — redundant or contradictory, either way the modules own it. Only a worker whose modules declare nothing (activity-only workers, or workflow modules without queue:) takes — and then requires — an explicit task_queue:.
  • client: — defaults to the app's default client.
  • name: — derived from the queue, overridable.

Summary

Functions

activity_supervisor_name(worker_name)

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

executor_supervisor_name(worker_name)

server_name(worker_name)

server_pid(worker_name)

start_link(opts)