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();
    }
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();
    }
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 ( ) ; }
Starts the given flow.

@param Flow $flow
@param bool $isSilent

@return ExtendedPromiseInterface
Starts the given flow .