Skip to content

Provide startup/teardown hooks #539

@ejizba

Description

@ejizba

Related to #522, which is focused on invocation hooks (needed for distributed tracing), there is benefit to startup & teardown hooks as well

A few differences between putting code at the top level of the startup file vs. a startup hook:

  1. Startup hooks can use await (commonjs files don't support top level await, although es6 does)
  2. Startup hooks can be passed a context object with extra information about the worker

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions