#QueueableInterface allows Chaining Jobs.
For re-sending the failed records during a web service callout from SFDC to SAP, today I was just wondering if Self-Chaining is possible.
I wrote the below piece of code:
System.enqueueJob(new SameClassImplementingQueueable(listObject)) ;
And it compiled successfully. (Y)
So I believe the compiler allows us to perform self-chaining as well. Now I need to check what happens at the runtime.
The only restriction I see for implementing Queueable Interface is this: "The maximum number of jobs in the chain (maximum stack depth) is two, which means you can add only one job from an executing job".
I believe I am within the Salesforce limits. :P ;)
P.S: If it happens, I need to see how it behaves in its Test Class. :D
#MySfdcTweets #SalesforceDotCom #SFDC
For re-sending the failed records during a web service callout from SFDC to SAP, today I was just wondering if Self-Chaining is possible.
I wrote the below piece of code:
System.enqueueJob(new SameClassImplementingQueueable(listObject)) ;
And it compiled successfully. (Y)
So I believe the compiler allows us to perform self-chaining as well. Now I need to check what happens at the runtime.
The only restriction I see for implementing Queueable Interface is this: "The maximum number of jobs in the chain (maximum stack depth) is two, which means you can add only one job from an executing job".
I believe I am within the Salesforce limits. :P ;)
P.S: If it happens, I need to see how it behaves in its Test Class. :D
#MySfdcTweets #SalesforceDotCom #SFDC
No comments:
Post a Comment
Thank you for visiting. Your comments are highly appreciated.