Skip to content

Commit

Permalink
setPrefetch允许链式调用
Browse files Browse the repository at this point in the history
  • Loading branch information
hsldymq committed Apr 15, 2019
1 parent 8a54107 commit e2caa9b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,16 @@ public function resume(): PromiseInterface
* 一般来说不需要设置prefetch数量,prefetch不是瓶颈,worker的处理能力才是.
*
* @param int $num
*
* @return self
*/
public function setPrefetch(int $num)
public function setPrefetch(int $num): self
{
if ($num > 0) {
$this->numPrefetch = $num;
}

return $this;
}

/**
Expand Down

0 comments on commit e2caa9b

Please sign in to comment.