I have this agent that is being triggerd by a webuser. Because the agent can take a while to complete, I don’t want the webuser to wait for the result. Therefor instead I start a small calling agent that runs the other agent with RunOnServer. But it all runs in the same thread so the user still has to wait until the first agent gets back control and finishes.Is there a way to achieve what I want? Running the second agent in the background immediatly, and giving the user control again just after starting the second agent. Looks similar to multi-threading.
You’re correct in saying that if you perform a runOnServer or similar function the agent runs in the same thread as the caller.
However, there’s nothing to stop you setting your agent to run on a scheduled basis and run against documents in a view. Your first agent creates (or modifies) a document to cause it to appear in the processing list for agent 2. Every x minutes agent 2 runs and parses all documents in the view, deleting the document when complete, or removing the item that causes it to be in the view in the first place.