Exemplo n.º 1
0
 public void Execute()
 {
     foreach (var action in _prerequisites.Concat(_commands))
     {
         action?.Invoke();
     }
 }
Exemplo n.º 2
0
        public void Enqueue(IActorRef receiver, Envelope envelope)
        {
            if (dropper(envelope.Message, high.Concat(low).Select(p => p.Message)))
            {
                return;
            }
            ConcurrentQueue <Envelope> queue = priority_generator(envelope.Message) ? high : low;

            queue.Enqueue(envelope);
        }
Exemplo n.º 3
0
        public void Enqueue(IActorRef receiver, Envelope envelope)
        {
            Interlocked.Increment(ref idle);
            if (envelope.Message is Idle)
            {
                return;
            }
            if (dropper(envelope.Message, high.Concat(low).Select(p => p.Message)))
            {
                return;
            }
            ConcurrentQueue <Envelope> queue = priority_generator(envelope.Message) ? high : low;

            queue.Enqueue(envelope);
        }
        /// <summary>
        /// Stop the BackgroundHttpRequester and return a list of URIs that were not requested.
        /// </summary>
        /// <returns>List of unrequested URIs that should be passed into Start next time.</returns>
        public async Task <List <Uri> > StopAsync()
        {
            if (!IsStarted)
            {
                throw new InvalidOperationException(String.Format("Cannot stop a {0} when already stopped", GetType().Name));
            }

            cancellationTokenSource.Cancel();
            await backgroundSender;

            return(priorRequests
                   .Concat(new[] { currentlySending })
                   .Concat(currentRequests)
                   .Where(r => r != null)
                   .ToList());
        }
Exemplo n.º 5
0
 internal ImmutableArray <string> GetOutputAndErrorLines() => ReturnIfStopped(() => output.Concat(error).ToImmutableArray());