Skip to content

Commit

Permalink
optimze: 优化goApp的协程单例处理
Browse files Browse the repository at this point in the history
  • Loading branch information
bingcool committed Apr 16, 2023
1 parent 44991ad commit ee39e8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Core/Func/function.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function getOneFreePort(array $excludePorts = []): int
* @throws \Swoolefy\Exception\SystemException
*/
function goApp(\Closure $callback) {
go(function () use($callback) {
\Swoole\Coroutine::create(function () use($callback) {
(new \Swoolefy\Core\EventApp)->registerApp(function($event) use($callback) {
try {
$callback($event);
Expand Down

0 comments on commit ee39e8a

Please sign in to comment.