This commit is contained in:
as2252258@163.com
2021-02-28 14:28:51 +08:00
parent 8ef1c9eb66
commit a28641ce7e
+10
View File
@@ -48,6 +48,11 @@ class OnTask extends Callback
*/
public function onTask(Server $server, int $task_id, int $from_id, string $data): mixed
{
$app = Snowflake::app()->increment();
Coroutine\defer(function () use ($app) {
$app->decrement();
});
$time = microtime(TRUE);
if (empty($data)) {
return $server->finish('null data');
@@ -73,6 +78,11 @@ class OnTask extends Callback
*/
public function onContinueTask(Server $server, Server\Task $task): mixed
{
$app = Snowflake::app()->increment();
Coroutine\defer(function () use ($app) {
$app->decrement();
});
$time = microtime(TRUE);
if (empty($task->data)) {
return $task->finish('null data');