modify
This commit is contained in:
@@ -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.');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user