5.0.3: ArcanaDevelopment.adTempus.ApplicationIntegration.UserScriptBase.RunAsync

Jim G. (20 posts)
May 2, 2025 09:53 AM
Accepted Answer
  • The ArcanaDevelopment.adTempus.ApplicationIntegration.UserScriptBase.Run method is exceptionally useful.
  • However, modern .NET code uses the async-await convention heavily.
  • Wish List Item: I would like a new ArcanaDevelopment.adTempus.ApplicationIntegration.UserScriptBase.RunAsync method that I can override.
1
Bill Staff (618 posts)
June 20, 2025 02:14 PM
Accepted Answer

Sorry for the delay on this. Haven't dug into the details of this yet but you should be able to do something like this to create your own RunAsync method and go from there:

using System;
using System.Threading.Tasks;
using ArcanaDevelopment.adTempus.ApplicationIntegration;
using ArcanaDevelopment.adTempus.Shared;


namespace UserScript
{
    public class UserScript : ArcanaDevelopment.adTempus.ApplicationIntegration.UserScriptBase
    {
        public override Object Run()
        {
            var task=Task.Run(RunAsync);
            task.Wait();
            return task.Result;
        }
        
        private async Task<bool> RunAsync()
        {
            //do stuff
            return true;
        }
    }
}