示例#1
0
 public CollectCmd(AppCfg cfg, PipeAppCtx appCtx, PipeAppCfg pipeAppCfg, IPipeCtx pipeCtx)
 {
     Cfg        = cfg;
     AppCtx     = appCtx;
     PipeAppCfg = pipeAppCfg;
     PipeCtx    = pipeCtx;
 }
示例#2
0
 public PipeAppCtx(PipeAppCtx appCtx)
 {
     Scope                = appCtx.Scope;
     Assemblies           = appCtx.Assemblies;
     EnvironmentVariables = appCtx.EnvironmentVariables;
     CustomRegion         = appCtx.CustomRegion;
 }
示例#3
0
 public FuncCtx(ILogger log, PipeAppCtx pipeCtx, RootCfg root, AppCfg cfg, ILifetimeScope scope)
 {
     Log     = log;
     PipeCtx = pipeCtx;
     Root    = root;
     Cfg     = cfg;
     Scope   = scope;
 }
示例#4
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>()));
        }