Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guidance for deploying TypeScript Workers #1857

Open
lorensr opened this issue Dec 29, 2022 · 2 comments
Open

Guidance for deploying TypeScript Workers #1857

lorensr opened this issue Dec 29, 2022 · 2 comments

Comments

@lorensr
Copy link
Contributor

lorensr commented Dec 29, 2022

Brief description

Each SDK should have different guidance on deploying workers. I think it should be part of the dev guide, as it's something all developers will need to do (or at least someone on your team will need to set it up and monitor it, similar to metrics/tracing).

Your recommended content

There are a number of ways to run your Worker code in production and scale it to meet your production load.

What about serverless?
Workers are stateful, long-running processes: they poll for tasks and keep a cache of active Workflow Executions in order to reduce resource consumption and latency. Therefore they cannot be run in AWS Lambdas or other serverless environments. You can, however, call serverless functions from your Activities.

@lorensr
Copy link
Contributor Author

lorensr commented Jan 3, 2023

content on building code:

Pre-build code

In most of our samples:

  • We use ts-node, which compiles TypeScript on the fly.
  • Our Workers bundle Workflow code at runtime.

We can improve our Worker's startup time by building code in advance.

Worker code

The Worker code can be built and run with:

npm run build
node lib/worker.js

Workflow code

See bottom part of this section.

@lorensr
Copy link
Contributor Author

lorensr commented Mar 13, 2023

Can include this env vars file: #1948

@sync-by-unito sync-by-unito bot changed the title [ Documentation request ] Deployment section of dev guide Guidance for deploying TypeScript Workers Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant