+ Start a Discussion
TehNrdTehNrd 

Asynchronous Apex, what is your time between submission and completion

For those who use asynchronous apex what is your average time between when the job is submitted and it completes. The documentation says that these jobs will execute when system resources are available but from what I can tell they execute almost instantly after submission. I'm sure this is not a safe assumption, especially with batch processing coming, as this could definitely cause an increase in queue times.

So has anyone noticed a significant delay between aschrounous submission time and completion time?

Thanks,
Jason

Message Edited by TehNrd on 02-28-2009 04:58 PM
Scott.MScott.M

It seems to be almost instant for me as well and I wouldn't depend on it either :) . I think if you hit your limit of asyncronous calls for the day it'll wait till the next day. I believe the limit is 200 per user per day. 

 

jgrenfelljgrenfell
I've had a couple times where I had to refresh a page to see the results of ansynchronous code, but usually it seems as if it's instantaneous.
Anand@SAASAnand@SAAS
It might be anywhere between instantaneous to more than an hour depending on other orgs that share the same instance as you. If there are other orgs that also submit async requests, it gets queued and might be a while before it completes. If you are planning to use async, make sure that these expectations are set with your users before implementing the same. 
Scott.MScott.M

Does anyone know if the order in which asyncronous calls are made is respected. I relize that they get batched but do they get executed in a first in first out order?

 

Another question along those lines is: Is possible to check the queue for pending processes? For example could you check for a pending job and cancel it before launching a new one? I know it can be done from the Apex Jobs view in Administration and setup but can it be done from code as well? 

Message Edited by Scott.M on 03-02-2009 08:06 AM
TehNrdTehNrd

Scott.M wrote:

Does anyone know if the order in which asyncronous calls are made is respected. I relize that they get batched but do they get executed in a first in first out order?

 



From the docs:

Remember that any method using the future annotation requires special consideration, because the method does not
necessarily execute in the same order it is called.

 

It looks like you can query an object called AsynchApexJob but it doesn't looked like the Status field is writable. I haven't tried though.

cheenathcheenath

Right, requests can be executed out of order and in parallel.

 

You can query AsynchApexJob to find out the status, but can not update it.