Skip to content

Commit

Permalink
fix: RippleCoroutine.php
Browse files Browse the repository at this point in the history
  • Loading branch information
chaz6chez committed Oct 8, 2024
1 parent fa8630e commit 1e05629
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Utils/Coroutine/Handlers/RippleCoroutine.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ class RippleCoroutine implements CoroutineInterface
public function __construct(\Closure $func)
{
$this->_promise = $this->_async(function () use (&$promise, $func) {
call_user_func($func);
// 移除协程id及promise
$this->_promise = null;
try {
call_user_func($func);
} finally {
// 移除协程id及promise
$this->_promise = null;
}
});
$this->_id = spl_object_hash($this->_promise);
}
Expand Down

0 comments on commit 1e05629

Please sign in to comment.