Skip to content

Allow to chain Queueable Jobs without the first one. #28

@Mateusz7410

Description

@Mateusz7410

Currently, there is no option to instantiate the chain without any QueueableJob, what mean we need to first add the first one, and later use the chain() method.

In some use-cases, where we are not sure if we will spawn 0/1/2/... jobs, we need workarounds to check it. But it should allow us to do something like:

QueuableBuilder builder = Async.queueable();
if ( __something__ ) {
    builder.chain(new Job1());
} 
if ( __something__ ) {
    builder.chain(new Job2());
}
if ( __something__ ) {
    builder.chain(new Job3());
}
builder.enqueue(); // should either enqueue the chain or do nothing if none added.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions