Exemple #1
0
        public async ValueTask ExecuteAsync(IConsole console)
        {
            var channels = ChannelIds?.UnJoin('|').ToArray();

            // make a new app context with a custom region defined
            var appCtx = new PipeAppCtx(AppCtx)
            {
                CustomRegion = () => Rand.Choice(Regions)
            };

            // run the work using the pipe entry point, forced to be local
            PipeAppCfg.Location = PipeRunLocation.Local;
            var pipeCtx = new PipeCtx(PipeAppCfg, appCtx, PipeCtx.Store, PipeCtx.Log);
            await pipeCtx.Run((YtCollector d) => d.Collect(PipeArg.Inject <ILogger>(), ForceUpdate, false, channels, PipeArg.Inject <CancellationToken>()));
        }