Starts pending streams, returns true if at least one pending stream is started.
973714
@GuardedBy("lock")
  private boolean startPendingStreams() {
    boolean hasStreamStarted = false;
    while (!pendingStreams.isEmpty() && streams.size() < maxConcurrentStreams) {
      OkHttpClientStream stream = pendingStreams.poll();
      startStream(stream);
      hasStreamStarted = true;
    }
    return hasStreamStarted;
  }
289563
def finish(self, data=''):
        '''
        
        '''
        self.pending += data
        self.streaming = False
        for i in self:
            yield i
765532
boolean shouldDrainBuffers(boolean delayable) {
        if (executor.isShutdown()) {
            DrainStatus status = drainStatus.get();
            return (status != PROCESSING) && (!delayable || (status == REQUIRED));
        }
        return false;
    }
24025
@SafeVarargs
    public static <U> SimpleReactStream<U> firstOf(final SimpleReactStream<U>... futureStreams) {
        final List<Tuple2<SimpleReactStream<U>, QueueReader>> racers = Stream.of(futureStreams)
                                                                             .map(s -> Tuple.tuple(s, new Queue.QueueReader(
                                                                                                                            s.toQueue(), null)))
                                                                             .collect(Collectors.toList());
        while (true) {
            for (final Tuple2<SimpleReactStream<U>, Queue.QueueReader> q : racers) {
                if (q._2().notEmpty()) {
                    EagerFutureStreamFunctions.closeOthers(q._2().getQueue(), racers.stream()
                                                                                  .map(t -> t._2().getQueue())
                                                                                  .collect(Collectors.toList()));
                    closeOthers(q._1(), racers.stream()
                                                                       .map(t -> t._1())
                                                                       .collect(Collectors.toList()));
                    return q._1().fromStream(q._2().getQueue()
                                               .stream(q._1().getSubscription()));
                }

            }
            LockSupport.parkNanos(1l);
        }

    }
347853
@Override
  @SuppressWarnings("unchecked")
  public void start() {
    if (isStopped()) return;
    
    logger().log("Inbound stream listening: for '" + reader.name() + "'");
    
    try {
      reader.openFor(this);
    } catch (Exception e) {
      reader.close();
      e.printStackTrace();
      throw new IllegalStateException(e.getMessage(), e);
    }
    cancellable = this.stage().scheduler().schedule(selfAs(Scheduled.class), null, 1000, probeInterval);
  }
261241
@GuardedBy("lock")
  private PendingStream createPendingStream(PickSubchannelArgs args) {
    PendingStream pendingStream = new PendingStream(args);
    pendingStreams.add(pendingStream);
    if (getPendingStreamsCount() == 1) {
      syncContext.executeLater(reportTransportInUse);
    }
    return pendingStream;
  }
678778
public void start() {
		if (tryToStart()) {
			throw new IllegalStateException("The StreamServer is already started");
		}
		logger.debug("StreamServer starting {}:{}", serverSocket.getInetAddress(), serverSocket.getLocalPort());
		keepRunning.set(true);
		executor.submit(new Server());
	}
537548
@Override public void start(Set<File> files, Consumer<Set<File>> callback) {
        if (isStarted()) {
            throw new IllegalStateException("start() should not be called more than once");
        }
        Set<File> filesCopy = ImmutableSet.copyOf(files);
        Preconditions.checkArgument(filesCopy.size() > 0, "must specify at least 1 file to watch for changes");
        this.callback = requireNonNull(callback);
        watchedFiles = filesCopy;
        executorService = MoreExecutors.listeningDecorator(Executors.newScheduledThreadPool(1));
        future = executorService.scheduleAtFixedRate(
            this::scanFilesForChanges,
            initialDelay,
            interval,
            timeUnit);
    }
924083
public final static <T> boolean startsWith(final Stream<T> stream, final Iterator<T> iterator) {
        final Iterator<T> it = stream.iterator();
        while (iterator.hasNext()) {
            if (!it.hasNext())
                return false;
            if (!Objects.equals(it.next(), iterator.next()))
                return false;
        }
        return true;

    }
1128464
public static boolean flush(final OutputStream[] streams) {
      boolean success = true;

      for (OutputStream stream : streams) {
         boolean rv = flush(stream);
         if (!rv) success = false;
      }

      return success;
   }
760385
public void start() {
        if (this.started) {
            throw new IllegalStateException("Cannot start the EventStream because it isn't stopped.");
        }

        final long initialPosition;

        if (this.startingPosition == STREAM_POSITION_NOW) {
            BoxAPIRequest request = new BoxAPIRequest(this.api, EVENT_URL.build(this.api.getBaseURL(), "now"), "GET");
            BoxJSONResponse response = (BoxJSONResponse) request.send();
            JsonObject jsonObject = JsonObject.readFrom(response.getJSON());
            initialPosition = jsonObject.get("next_stream_position").asLong();
        } else {
            assert this.startingPosition >= 0 : "Starting position must be non-negative";
            initialPosition = this.startingPosition;
        }

        this.poller = new Poller(initialPosition);

        this.pollerThread = new Thread(this.poller);
        this.pollerThread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
            public void uncaughtException(Thread t, Throwable e) {
                EventStream.this.notifyException(e);
            }
        });
        this.pollerThread.start();

        this.started = true;
    }
866402
private void initStream() {
    firestoreExecutor.schedule(
        new Runnable() {
          @Override
          public void run() {
            if (!isActive.get()) {
              return;
            }

            synchronized (Watch.this) {
              if (!isActive.get()) {
                return;
              }

              Preconditions.checkState(stream == null);

              current = false;
              nextAttempt = backoff.createNextAttempt(nextAttempt);

              stream = firestore.streamRequest(Watch.this, firestore.getClient().listenCallable());

              ListenRequest.Builder request = ListenRequest.newBuilder();
              request.setDatabase(firestore.getDatabaseName());
              request.setAddTarget(target);
              if (resumeToken != null) {
                request.getAddTargetBuilder().setResumeToken(resumeToken);
              }

              stream.onNext(request.build());
            }
          }
        },
        nextAttempt.getRandomizedRetryDelay().toMillis(),
        TimeUnit.MILLISECONDS);
  }
807197
def _EnsureRequesterStarted(self):
    """"""
    if not self._analyzer_started:
      self._analyzer.start()
      self._analyzer_started = True
809575
function () {
        var pending = this._pending,
            done = this._done,
            a,
            b;
        while (0 !== pending.length) {
            b = pending.pop();
            a = pending.pop();
            done.push(a, b);
            if (this._areDifferent(a, b)) {
                return false;
            }
        }
        return true;
    }
1266298
def is_output(self, stream):
        

        for streamer in self.streamers:
            if streamer.selector.matches(stream):
                return True

        return False
790493
public static boolean isFinished(final ExecutableFlow flow) {
    switch (flow.getStatus()) {
      case SUCCEEDED:
      case FAILED:
      case KILLED:
        return true;
      default:
        return false;
    }
  }
661191
def _check_for_pending(self, *args, **kwargs):
        
        if self._notification_pending and not self._processing:
            self._processing = True
            args, kwargs = self._data
            self._notify(*args, **kwargs)
            self._notification_pending = False
            self._processing = False