mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 09:43:13 +08:00
Created task running system based on event listener which are transparently cast into tasks
This commit is contained in:
@@ -3,6 +3,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace Shlinkio\Shlink\Common;
|
||||
|
||||
use Swoole\Http\Server as HttpServer;
|
||||
|
||||
use const JSON_ERROR_NONE;
|
||||
|
||||
use function getenv;
|
||||
@@ -59,3 +61,8 @@ function json_decode(string $json, int $depth = 512, int $options = 0): array
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
function asyncListener(HttpServer $server, string $regularListenerName): EventDispatcher\AsyncEventListener
|
||||
{
|
||||
return new EventDispatcher\AsyncEventListener($server, $regularListenerName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user