function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
iqbaliqbal 

Asynchronous method number

Hi,

I have written an aynchronous class which is called by a trigger. Since it is asynchronous, multiple threads of this class can run at the same time. Is it possible to know what is the number of thread currently being run? is there any system variable which gives this information.

 

Please let me know.

 

 

jeffdonthemic2jeffdonthemic2

You can go to the Apex Jobs screen in the Builder and monitor the status of all Apex jobs, and optionally abort jobs that are in progress.

 

Goto: Setup -> Administration Setup -> Monitoring -> Apex Jobs

 

HTH

 

Jeff Douglas

Appirio, Inc.

http://blog.jeffdouglas.com 

sfdcfoxsfdcfox
If I understand the question correctly, there is no built-in programmatic way to determine which "thread" you are running in relative to any other threads. However, you could arbitrarily assign each "thread" a number, passing that in as a parameter to the @future method you're calling, and that would give it an identity it could check against.