I'm needing launch different specs depending on the data received and don't know how to do this correctly.
I'm trying to declare multiple "finished states" in my spec but it is not working. Is there another way to declare multiple "finished states" for a spec?
Can someone give me a hand? Thanks!
checkRelationship.getRequestedsFriendships(data.sender, data.receiver).then(() => {
data._state='friends_bilateral_commit_start';
console.log('STARTS BILATERAL COMMIT');
return resolve(data);
}).catch((err) => {
data._state='friends_commit_start';
console.log('STARTS COMMIT');
return resolve(data);
});
Solution I suggest is to stop current task and push a new task to queue.
I would like to know if you found any implementation for that fork on your tasking work.
I see 'resolve(data)' something like: put a piece of job on queue; by resolving is just a field change, state goes to end value; like reject, maybe it is a bit easy to stop current task and start a new one by pushing a node job to matching queue.
Cheers, and hope you are doing well with current works!