webman
webman copied to clipboard
How to alternative sleep function in API webman
I create API applications for alarm notification Who to add sleep() function without sleep the webman process ?
composer require workerman/webman-framework ^1.5.0 && composer require workerman/workerman 5.0.0-beta.1 && composer require revolt/event-loop
Usage
<?php
namespace app\controller;
use support\Request;
use Workerman\Timer;
class IndexController
{
public function index(Request $request)
{
Timer::sleep(1); // <=== Here is nonblocking sleep
return response('hello webman');
}
}