Opens the stream in a background thread.
435799
public void start() {
    nsLock.writeLock().lock();
    try {
      if (runnerThread != null) {
        return;
      }
      runnerThread =
          new Thread(new NamespaceChangeStreamRunner(
              new WeakReference<>(this), networkMonitor, logger));
      runnerThread.start();
    } finally {
      nsLock.writeLock().unlock();
    }
  }
697840
def _open_data_stream(self):
        '''
        '''
        @asyncio.coroutine
        def connection_factory(address: Tuple[int, int]):
            self._data_connection = yield from self._acquire_connection(address[0], address[1])
            return self._data_connection

        self._data_stream = yield from self._commander.setup_data_stream(
            connection_factory
        )

        self._response.data_address = self._data_connection.address

        read_callback = functools.partial(self.event_dispatcher.notify, self.Event.transfer_receive_data)
        self._data_stream.data_event_dispatcher.add_read_listener(read_callback)

        write_callback = functools.partial(self.event_dispatcher.notify, self.Event.transfer_send_data)
        self._data_stream.data_event_dispatcher.add_write_listener(write_callback)
967725
public StreamImpl openReadWriteImpl() throws IOException
  {
    HttpStreamWrapper stream = HttpStream.openReadWrite(this);

    stream.setSSL(true);
    
    return stream;
  }
1310396
def start(self):
        """"""

        def cb():
            time_ = time.time()
            log.debug('Step {}'.format(time_))

            # run a step on all streams
            for d in self._dstreams:
                d._step(time_)

        self._pcb = PeriodicCallback(cb, self.batch_duration * 1000.0)
        self._pcb.start()
        self._on_stop_cb.append(self._pcb.stop)
        StreamingContext._activeContext = self
936419
def open(self, options=None, mimetype='application/octet-stream'):
        
        return self.connection.open(self, options, mimetype)
302433
def start(self):
        """"""
        assert self._thread is None, 'thread already started'

        # configure thread
        self._thread = Thread(target=self._start_io_loop)
        self._thread.daemon = True

        # begin thread and block until ready
        self._thread.start()
        self._ready.wait()
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);
  }
902428
def open(self, callback, instance=None, processor=None):
        
        assert not self._closed

        ws_url = self._client.ws_root
        if instance:
            ws_url += '/' + instance
            if processor:
                ws_url += '/' + processor

        self._callback = callback
        self._websocket = websocket.WebSocketApp(
            ws_url,
            on_open=self._on_websocket_open,
            on_message=self._on_websocket_message,
            on_error=self._on_websocket_error,
            subprotocols=['protobuf'],
            header=[
                '{}: {}'.format(k, self._client.session.headers[k])
                for k in self._client.session.headers
            ],
        )
        self._consumer = threading.Thread(target=self._websocket.run_forever)

        # Running this as a daemon thread improves possibilities
        # for consumers of our API to control shutdown.
        # (example: can just use time.sleep on the main thread instead of blocking on the future)
        self._consumer.daemon = True

        self._consumer.start()
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;
  }
717527
def open(self):
        
        LOGGER.info('Connecting to %s', self._url)
        asyncio.ensure_future(self._do_start())
960234
public void open() throws ModbusException {

        // Start the listener if it isn' already running

        if (!isRunning) {
            try {
                listenerThread = new Thread(listener);
                listenerThread.start();
                isRunning = true;
            }
            catch (Exception x) {
                closeListener();
                throw new ModbusException(x.getMessage());
            }
        }
    }
765370
public InputStream openStream() {
        try {
            URLConnection urlConnection = logStreamURL.openConnection();
            if (urlConnection instanceof HttpsURLConnection) {
                HttpsURLConnection https = (HttpsURLConnection) urlConnection;
                https.setSSLSocketFactory(Heroku.sslContext(false).getSocketFactory());
                https.setHostnameVerifier(Heroku.hostnameVerifier(false));
            }
            urlConnection.connect();
            return urlConnection.getInputStream();

        } catch (IOException e) {
            throw new HerokuAPIException("IOException while opening log stream", e);
        }
    }
173753
def start_receive(self, stream):
        
        _vv and IOLOG.debug('%r.start_receive(%r)', self, stream)
        side = stream.receive_side
        assert side and side.fd is not None
        self.defer(self.poller.start_receive,
                   side.fd, (side, stream.on_receive))
59899
def _begin_stream(self, command: Command):
        ''''''
        begin_reply = yield from self._commander.begin_stream(command)

        self._response.reply = begin_reply

        self.event_dispatcher.notify(self.Event.begin_transfer, self._response)
639588
def open(self):
        
        if self._f is not None:
            return self._f
        try:
            rv, self.should_close = open_stream(self.name, self.mode,
                                                self.encoding,
                                                self.errors,
                                                atomic=self.atomic)
        except (IOError, OSError) as e:
            from .exceptions import FileError
            raise FileError(self.name, hint=get_streerror(e))
        self._f = rv
        return rv
1066838
public InputStream openInputStream() throws FetchException {
        try {
            return getInternalBlobForFetch().getBinaryStream();
        } catch (SQLException e) {
            throw mRepo.toFetchException(e);
        }
    }
1213393
def start_event_stream(self):
        
        if not self._stream:
            self._stream = GerritStream(self, ssh_client=self._ssh_client)
            self._stream.start()