I'm basically trying to fetch data asynchronously with paging. step 1: fetch some data, step 2: check the result. The result includes information if there's more pages to fetch, so I'd have to optionally repeat step 1 before proceeding to step 3.

Line 55 passes the delay->begin callback to a wait_job method, which passes it to a check_job_state method, which returns a sub that either calls wait_job again (if it's still waiting) or calls the original $delay->begin callback with the error or result.

Documentation of https://metacpan.org/pod/Minion#remove_after says: "jobs that have reached the state finished and have no unresolved dependencies". But jobs that have reached the state finished cannot have unresolved dependencies.