Closed egorovpavel closed 1 year ago
True! That would be really nice indeed Did initial test real fast. Need to return from two places
Also need to update TS typings and would be cool to have some unified return across drivers for job creation I wonder, if just job ID would be enuf to return or should return more info? 🤔 Like
const job = await MyJob.dispatch({ foo: 'bar' })
console.log(job)
// 10
// vs
console.log(job)
{
id: 10,
class_path: '/foo/bar/MyJob.ts',
payload: { foo: 'bar' }
}
For just tracking, ID itself would be enuf, but would there be cases for other info to be returned? 🤔
Just realized, can start with returning:
{
id: 10
}
And then can add extra return data when needed in future without breaking changes
I'll try to get it out within a week. Or also accepting PRs for it :)
Released as version 3.0.0. Breaking change for people who wrote custom drivers. They'll need to return job ID too now
It would be nice to get a some kind of reference to a job after it was dispatched, so we can track its status.
so instead of "fire and forget"
we could do something with the job
Thanks for the proper "redisless" queue!