private static async void BlockUntilJobTerminates(IFrameworkCommandDispatcher commandDispatcher)
 {
     while (!await IsTerminated(commandDispatcher))
     {
         await WaitFor(TimeSpan.FromSeconds(1), async() => !await IsTerminated(commandDispatcher));
     }
 }
 public CustomDispatcher(
     IFrameworkCommandDispatcher underlyingDispatcher,
     ITelemetry telemetry
     )
 {
     _underlyingDispatcher = underlyingDispatcher;
     _telemetry            = telemetry;
 }
 public LoggingCommandDispatcher(IFrameworkCommandDispatcher underlyingDispatcher,
                                 ILogger <LoggingCommandDispatcher> logger,
                                 IMetricCollectorFactory metricCollectorFactory)
 {
     _underlyingDispatcher   = underlyingDispatcher;
     _metricCollectorFactory = metricCollectorFactory;
     _logger = logger;
 }
        public CustomDispatcher(ILogger logger, IFrameworkCommandDispatcher underlyingDispatcher)
        {
            _logger = logger;
            _underlyingDispatcher = underlyingDispatcher;

            _blobContainer = CloudStorageAccount
                             .DevelopmentStorageAccount
                             .CreateCloudBlobClient()
                             .GetContainerReference("commandhistory");
        }
Exemple #5
0
 public CachedCommandDispatcher(ICacheKeyProvider cacheKeyProvider,
                                IFrameworkCommandDispatcher commandDispatcher,
                                ICacheOptionsProvider cacheOptionsProvider,
                                ICacheAdapter cacheAdapter)
 {
     _cacheKeyProvider     = cacheKeyProvider;
     _commandDispatcher    = commandDispatcher;
     _cacheOptionsProvider = cacheOptionsProvider;
     _cacheAdapter         = cacheAdapter;
 }
Exemple #6
0
 public TelemetryDispatcher(IFrameworkCommandDispatcher decoratedDispatcher,
                            ILogger <TelemetryDispatcher> logger)
 {
     _decoratedDispatcher = decoratedDispatcher;
     _logger = logger;
 }
Exemple #7
0
 public ApplicationErrorAwareCommandDispatcher(IFrameworkCommandDispatcher underlyingCommandDispatcher)
 {
     _underlyingCommandDispatcher = underlyingCommandDispatcher;
 }
        private static async Task <bool> IsTerminated(IFrameworkCommandDispatcher commandDispatcher)
        {
            var isTerinatedCommandResult = await commandDispatcher.DispatchAsync(new IsTerminatedCommand());

            return(isTerinatedCommandResult.Result);
        }