| @@ 730-745 (lines=16) @@ | ||
| 727 | $deferred = new Promise\Deferred; |
|
| 728 | $internalFlow = new Flow\Envelope($flow, $deferred, $packet, $isSilent); |
|
| 729 | ||
| 730 | if ($packet !== NULL) { |
|
| 731 | if ($this->writtenFlow !== NULL) { |
|
| 732 | $this->sendingFlows[] = $internalFlow; |
|
| 733 | ||
| 734 | } else { |
|
| 735 | $this->stream->write($packet); |
|
| 736 | $this->writtenFlow = $internalFlow; |
|
| 737 | ||
| 738 | $this->handleSend(); |
|
| 739 | } |
|
| 740 | ||
| 741 | } else { |
|
| 742 | $this->loop->futureTick(function () use ($internalFlow) { |
|
| 743 | $this->finishFlow($internalFlow); |
|
| 744 | }); |
|
| 745 | } |
|
| 746 | ||
| 747 | return $deferred->promise(); |
|
| 748 | } |
|
| @@ 769-784 (lines=16) @@ | ||
| 766 | return; |
|
| 767 | } |
|
| 768 | ||
| 769 | if ($response !== NULL) { |
|
| 770 | if ($this->writtenFlow !== NULL) { |
|
| 771 | $this->sendingFlows[] = $flow; |
|
| 772 | ||
| 773 | } else { |
|
| 774 | $this->stream->write($response); |
|
| 775 | $this->writtenFlow = $flow; |
|
| 776 | ||
| 777 | $this->handleSend(); |
|
| 778 | } |
|
| 779 | ||
| 780 | } elseif ($flow->isFinished()) { |
|
| 781 | $this->loop->futureTick(function () use ($flow) { |
|
| 782 | $this->finishFlow($flow); |
|
| 783 | }); |
|
| 784 | } |
|
| 785 | } |
|
| 786 | ||
| 787 | /** |
|