Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Queue instruction – run an activity asynchronously

Updated on August 16, 2022

The Queue instruction uses a Java thread from a limited thread pool. If using the queue instruction, set the agent/threadpoolsize value in the prconfig.xml file or dynamic system settings appropriately based on concurrency needs.

Use the Queue instruction:

  • To start asynchronous execution of a second activity. The Queue instruction provides an alternative to the Call instruction, in situations where there is no need to wait for completion of the second activity, or where processing in parallel is feasible and beneficial.
  • Only when appropriate, where the queued activity can operate in a "fire-and-forget" style.

Do not use the Queue instruction:

  • If you have disabled batch requestor processing by setting the agent/threadpoolsize value to 0 in the prconfig.xml file or dynamic system settings.

  • If parallel execution of the activity may introduce locking issues, deadlocks, race conditions or other concurrency risks into your application. Use the Call instruction instead.
  • To allow a background agent, operating as a separate process, to execute an activity asynchronously from the foreground processing, especially when locking is involved. Use the Queue-for-Agent instruction instead.

Refer to Parameters for the Queue instruction for information about the activity parameters you can set for the Queue instruction.

Results

At runtime, the system uses rule resolution to locate and start the activity.

The activity does not receive a step page or a primary page.

Execution of the queued activity occurs asynchronously, in a batch requestor. The execution progress of the two activities is not predictable and may vary from execution to execution.

Checking the method status

This method updates the pxMethodStatus property only if it fails. See How to test method results using a transition.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us