Skip to content

Commit

Permalink
Use timeout at bottom of queue
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Dec 29, 2015
1 parent 2fe9b23 commit 752aed5
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Pipe/WritablePipe.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,7 @@ private function send($data, $timeout = 0, $end = false)

yield $delayed;
} catch (Exception $exception) {
if ($this->isOpen()) {
$this->free($exception);
}
$this->free($exception);
throw $exception;
} finally {
if ($end && $this->isOpen()) {
Expand Down Expand Up @@ -219,9 +217,7 @@ public function await($timeout = 0)
try {
yield $delayed;
} catch (Exception $exception) {
if ($this->isOpen()) {
$this->free($exception);
}
$this->free($exception);
throw $exception;
}
}
Expand Down Expand Up @@ -297,7 +293,7 @@ private function createAwait($resource, \SplQueue $writeQueue)
}

if (!$writeQueue->isEmpty()) {
list( , , $timeout) = $writeQueue->top();
list( , , $timeout) = $writeQueue->bottom();
$await->listen($timeout);
}
});
Expand Down

0 comments on commit 752aed5

Please sign in to comment.