public static async Task RefreshStatus(this IJobHost jobs, string instanceId)
 {
     await jobs.CallAsync(nameof(GetStatusFunction), new Dictionary <string, object>
     {
         ["instanceId"] = instanceId
     });
 }
        public static async Task <IJobHost> Start(this IJobHost jobs, OrchestrationStarterInfo starterInfo)
        {
            await jobs.CallAsync(starterInfo.StarterName, starterInfo.StarterArgs);

            await jobs.WaitFor(starterInfo.OrchestrationName, starterInfo.Timeout, starterInfo.ExpectedCustomStatus).ThrowIfFailed();

            return(jobs);
        }
        public static async Task <IJobHost> Ready(this IJobHost jobs, TimeSpan?timeout = null)
        {
            await jobs.CallAsync(nameof(ReadyFunction), new Dictionary <string, object> {
                ["timeout"] = timeout
            });

            return(jobs);
        }
Exemple #4
0
        /// <summary>
        /// REMARK: This method does NOT throw when orchestrations have failed.
        /// Please, chain the <see cref="ThrowIfFailed" /> and <see cref="Purge"/> to this method for that behavior.
        /// </summary>
        public static async Task <IJobHost> WaitFor(this IJobHost jobs, string orchestration, TimeSpan?timeout = null)
        {
            await jobs.CallAsync(nameof(WaitForFunction), new Dictionary <string, object>
            {
                ["timeout"] = timeout,
                ["name"]    = orchestration
            });

            return(jobs);
        }
        internal Task CallFunctionAsync(string name, IDictionary <string, object?>?args = null)
        {
            IJobHost jobHost = this.functionsHost.Services.GetService <IJobHost>();

            return(jobHost.CallAsync(name, args));
        }
        public static async Task <IJobHost> Terminate(this IJobHost jobs)
        {
            await jobs.CallAsync(nameof(TerminateFunction));

            return(jobs);
        }
        public static async Task <IJobHost> Purge(this IJobHost jobs)
        {
            await jobs.CallAsync(nameof(PurgeFunction));

            return(jobs);
        }
        public static async Task <IJobHost> Start(this IJobHost jobs, EndpointInfo endpointInfo)
        {
            await jobs.CallAsync(endpointInfo.StarterName, endpointInfo.StarterArgs);

            return(jobs);
        }