original_string: private function startFlow(Flow $flow, $isSilent = false)
      {
          try {
              $packet = $flow->start();
          } catch (\Exception $e) {
              $this->emitError($e);
  
              return new RejectedPromise($e);
          }
  
          $deferred = new Deferred();
          $internalFlow = new ReactFlow($flow, $deferred, $packet, $isSilent);
  
          if ($packet !== null) {
              if ($this->writtenFlow !== null) {
                  $this->sendingFlows[] = $internalFlow;
              } else {
                  $this->stream->write($packet);
                  $this->writtenFlow = $internalFlow;
                  $this->handleSend();
              }
          } else {
              $this->loop->nextTick(function () use ($internalFlow) {
                  $this->finishFlow($internalFlow);
              });
          }
  
          return $deferred->promise();
      }
code: private function startFlow(Flow $flow, $isSilent = false)
      {
          try {
              $packet = $flow->start();
          } catch (\Exception $e) {
              $this->emitError($e);
  
              return new RejectedPromise($e);
          }
  
          $deferred = new Deferred();
          $internalFlow = new ReactFlow($flow, $deferred, $packet, $isSilent);
  
          if ($packet !== null) {
              if ($this->writtenFlow !== null) {
                  $this->sendingFlows[] = $internalFlow;
              } else {
                  $this->stream->write($packet);
                  $this->writtenFlow = $internalFlow;
                  $this->handleSend();
              }
          } else {
              $this->loop->nextTick(function () use ($internalFlow) {
                  $this->finishFlow($internalFlow);
              });
          }
  
          return $deferred->promise();
      }
code_tokens: private function startFlow ( Flow $ flow , $ isSilent = false ) { try { $ packet = $ flow -> start ( ) ; } catch ( \ Exception $ e ) { $ this -> emitError ( $ e ) ; return new RejectedPromise ( $ e ) ; } $ deferred = new Deferred ( ) ; $ internalFlow = new ReactFlow ( $ flow , $ deferred , $ packet , $ isSilent ) ; if ( $ packet !== null ) { if ( $ this -> writtenFlow !== null ) { $ this -> sendingFlows [ ] = $ internalFlow ; } else { $ this -> stream -> write ( $ packet ) ; $ this -> writtenFlow = $ internalFlow ; $ this -> handleSend ( ) ; } } else { $ this -> loop -> nextTick ( function ( ) use ( $ internalFlow ) { $ this -> finishFlow ( $ internalFlow ) ; } ) ; } return $ deferred -> promise ( ) ; }
docstring: Starts the given flow.
  
  @param Flow $flow
  @param bool $isSilent
  
  @return ExtendedPromiseInterface
docstring_tokens: Starts the given flow .