public static Task <CloudQueueMessage> SendToQueueAsync(IRefs <InvocationMessage> invocationMessageRef,
                                                                AzureApplication azureApplication)
        {
            var byteContent = invocationMessageRef.ids.Select(id => id.ToByteArray()).SelectMany().ToArray();

            return(EastFive.Web.Configuration.Settings.GetString(
                       AppSettings.FunctionProcessorQueueTriggerName,
                       (queueTriggerName) =>
            {
                return azureApplication.SendQueueMessageAsync(queueTriggerName, byteContent);
            },
                       (why) => throw new Exception(why)));
        }
        public static async Task <HttpResponseMessage> RunAsync(
            [UpdateId] IRefs <InvocationMessage> invocationMessageRefs,
            [HeaderLog] EastFive.Analytics.ILogger analyticsLog,
            InvokeApplicationDirect invokeApplication,
            MultipartResponseAsync onRun)
        {
            var messages = await invocationMessageRefs.refs
                           .Select(invocationMessageRef => InvokeAsync(invocationMessageRef, invokeApplication, logging: analyticsLog))
                           .AsyncEnumerable()
                           .ToArrayAsync();

            return(await onRun(messages));
        }
        public static IHttpResponse InvokeAsync(
            [UpdateId] IRefs <InvocationMessage> invocationMessageRefs,
            [HeaderLog] ILogger analyticsLog,
            InvokeApplicationDirect invokeApplication,
            CancellationToken cancellationToken,
            MultipartAsyncResponse <IHttpResponse> onRun)
        {
            var messages = invocationMessageRefs.refs
                           .Select(
                invocationMessageRef => InvokeAsync(invocationMessageRef, invokeApplication,
                                                    logging: new EventLogger(analyticsLog),
                                                    cancellationToken: cancellationToken))
                           .AsyncEnumerable();

            return(onRun(messages));
        }