This commit is contained in:
as2252258@163.com
2021-05-02 00:13:52 +08:00
parent 9cbbfbe86f
commit e0a96b8e5a
+2
View File
@@ -28,6 +28,7 @@ class Channel extends Component
*/ */
public function push(mixed $value, string $name = ''): void public function push(mixed $value, string $name = ''): void
{ {
return;
$channel = $this->channelInit($name); $channel = $this->channelInit($name);
$channel->enqueue($value); $channel->enqueue($value);
} }
@@ -73,6 +74,7 @@ class Channel extends Component
*/ */
public function pop(string $name, Closure $closure, int|float $timeout = null): mixed public function pop(string $name, Closure $closure, int|float $timeout = null): mixed
{ {
return call_user_func($closure);
if (($channel = $this->channelInit($name)) == false) { if (($channel = $this->channelInit($name)) == false) {
return $this->addError('Channel is full.'); return $this->addError('Channel is full.');
} }