改名
This commit is contained in:
+5
-3
@@ -76,14 +76,16 @@ class Channel extends Component
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function pop(int|float $timeout, string $name, Closure $closure, int $length = 100): mixed
|
||||
public function pop(string $name, Closure $closure, int|float $timeout = null, int $length = 999): mixed
|
||||
{
|
||||
if (($channel = $this->channelInit($length, $name)) == false) {
|
||||
return $this->addError('Channel is full.');
|
||||
}
|
||||
|
||||
$data = null;
|
||||
if (!$channel->isEmpty()) {
|
||||
return $channel->pop();
|
||||
}
|
||||
$data = null;
|
||||
if ($timeout !== null) {
|
||||
$data = $channel->pop($timeout);
|
||||
}
|
||||
if (empty($data)) {
|
||||
|
||||
Reference in New Issue
Block a user