You need to sign in to do that
Don't have an account?
EdCode
Queueable vs future (Trailhead)
Hi,
I am trying, without success, to understand the second paragraph below (written in Trailhead):
My interpretation of this second paragraph is that, if you have class where one of its methods contains a if-condition statement where, under certain condition the code is executed synchonously and under other condition a code is executed asynchronously, then (according to this 2ond paragraph) you would be better off leveraging a future method? (instead of a Queueable apex?)
The question is WHY?
Could you possibly clarify/elaborate so as to fully understand the above paragraph #2?
Thank you.
I am trying, without success, to understand the second paragraph below (written in Trailhead):
My interpretation of this second paragraph is that, if you have class where one of its methods contains a if-condition statement where, under certain condition the code is executed synchonously and under other condition a code is executed asynchronously, then (according to this 2ond paragraph) you would be better off leveraging a future method? (instead of a Queueable apex?)
The question is WHY?
Could you possibly clarify/elaborate so as to fully understand the above paragraph #2?
Thank you.
If you want to make this async, it's as simple as wrapping it in a future method
but try to convert the createAccount method to queueable...you need to create a whole new class for that
What's easier: Creating a whole new class (and the required code coverage) or simply creating a method to wrap another method?
The functionality is the same, they both run async, but a future method is simpler in this particular scenario.