Skip to content

Persistent context #47

@darky

Description

@darky

Need ability to pass some context firstly and then, it will be always available in workers pool.
For example, CPU-intensive geo task - check point in polygons.
Polygons so weight and every time serialize - deserialize it so expensive.
Would be better to pass it firstly

await job(() => {
}, {persistentCtx: {polygons: [/* many-many polygons */]}});

And then on every job execute it always accessible:

await job(() => {
  polygons // it accessible here yet.
  
}, {data: {point: [12.3434, 56.3434]}});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions