@@ 721-736 (lines=16) @@ | ||
718 | $deferred = new Promise\Deferred; |
|
719 | $internalFlow = new Flow\Envelope($flow, $deferred, $packet, $isSilent); |
|
720 | ||
721 | if ($packet !== NULL) { |
|
722 | if ($this->writtenFlow !== NULL) { |
|
723 | $this->sendingFlows[] = $internalFlow; |
|
724 | ||
725 | } else { |
|
726 | $this->stream->write($packet); |
|
727 | $this->writtenFlow = $internalFlow; |
|
728 | ||
729 | $this->handleSend(); |
|
730 | } |
|
731 | ||
732 | } else { |
|
733 | $this->loop->futureTick(function () use ($internalFlow) { |
|
734 | $this->finishFlow($internalFlow); |
|
735 | }); |
|
736 | } |
|
737 | ||
738 | return $deferred->promise(); |
|
739 | } |
|
@@ 760-775 (lines=16) @@ | ||
757 | return; |
|
758 | } |
|
759 | ||
760 | if ($response !== NULL) { |
|
761 | if ($this->writtenFlow !== NULL) { |
|
762 | $this->sendingFlows[] = $flow; |
|
763 | ||
764 | } else { |
|
765 | $this->stream->write($response); |
|
766 | $this->writtenFlow = $flow; |
|
767 | ||
768 | $this->handleSend(); |
|
769 | } |
|
770 | ||
771 | } elseif ($flow->isFinished()) { |
|
772 | $this->loop->futureTick(function () use ($flow) { |
|
773 | $this->finishFlow($flow); |
|
774 | }); |
|
775 | } |
|
776 | } |
|
777 | ||
778 | /** |