Scenario

Choose the right worker type

Decide between a listener worker and a proactive worker for the logic you are wrapping.

Situation

You have existing logic to wrap and must pick the worker type in defineServixService.

Decision

Does the work react to external events, or does it run on a clock?

Paths

  1. Something calls you

    When: The work reacts to incoming events — webhooks, queue messages, callbacks.

    Listener workers are fully implemented in v0.1 and get the managed HTTP context, health, and supervised restarts.

    Guides: wrap-a-listener

  2. You run on a clock

    When: The work runs on an interval, cron, or polls an API on a schedule.

    Proactive workers declare the schedule next to the execute body, so the package owns "when to run" as well as "what to do".

    Guides: wrap-a-function, wrap-a-cli-command

Download Markdown