| @@ 716-731 (lines=16) @@ | ||
| 713 | $deferred = new Promise\Deferred; |
|
| 714 | $internalFlow = new Flow\Envelope($flow, $deferred, $packet, $isSilent); |
|
| 715 | ||
| 716 | if ($packet !== NULL) { |
|
| 717 | if ($this->writtenFlow !== NULL) { |
|
| 718 | $this->sendingFlows[] = $internalFlow; |
|
| 719 | ||
| 720 | } else { |
|
| 721 | $this->stream->write($packet); |
|
| 722 | $this->writtenFlow = $internalFlow; |
|
| 723 | ||
| 724 | $this->handleSend(); |
|
| 725 | } |
|
| 726 | ||
| 727 | } else { |
|
| 728 | $this->loop->nextTick(function () use ($internalFlow) { |
|
| 729 | $this->finishFlow($internalFlow); |
|
| 730 | }); |
|
| 731 | } |
|
| 732 | ||
| 733 | return $deferred->promise(); |
|
| 734 | } |
|
| @@ 755-770 (lines=16) @@ | ||
| 752 | return; |
|
| 753 | } |
|
| 754 | ||
| 755 | if ($response !== NULL) { |
|
| 756 | if ($this->writtenFlow !== NULL) { |
|
| 757 | $this->sendingFlows[] = $flow; |
|
| 758 | ||
| 759 | } else { |
|
| 760 | $this->stream->write($response); |
|
| 761 | $this->writtenFlow = $flow; |
|
| 762 | ||
| 763 | $this->handleSend(); |
|
| 764 | } |
|
| 765 | ||
| 766 | } elseif ($flow->isFinished()) { |
|
| 767 | $this->loop->nextTick(function () use ($flow) { |
|
| 768 | $this->finishFlow($flow); |
|
| 769 | }); |
|
| 770 | } |
|
| 771 | } |
|
| 772 | ||
| 773 | /** |
|