Exemplo n.º 1
0
        /// <inheritdoc/>
        async Task IScript.ExecuteAsync()
        {
            var taskList = new List <Task>();

            foreach (var scriptName in EntityIds)
            {
                var task = Daemon.CallService("script", scriptName);
                taskList.Add(task);
            }

            // Wait for all tasks to complete or max 5 seconds
            if (taskList.Count > 0)
            {
                await Task.WhenAny(Task.WhenAll(taskList.ToArray()), Task.Delay(5000)).ConfigureAwait(false);
            }
        }