Skip to content

Pass more info on job to callback fn #52

@Gautham

Description

@Gautham

Problem Statement

Currently, the callback fn is only passed the name of the executable/fn in the job. If I'm dealing with multiple jobs using the same executable that differ only in args, then the callback fn can't help me disambiguate which job ran.

Sample Usecase:
async_job my_env_worker "startEnv EnvA";
async_job my_env_worker "startEnv EnvB";

I'd like to have my callbackFn to provide some info on the env (envA vs envB) as well. However, $1 in callbackFn is just startEnv today. Is this possible today?

Alternatives

  • ⚠️ I could have a separate worker per job args which is probably not how the library was meant to be used.
  • 🚫 Processing individual jobs or attaching callbacks per request can result in race-conditions etc.

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