This commit is contained in:
2020-11-27 14:57:58 +08:00
parent cf8866d1ce
commit b7b0274a6e
3 changed files with 46 additions and 17 deletions
+15 -3
View File
@@ -76,11 +76,23 @@ class OnHandshake extends Callback
* @throws Exception
*/
public function onHandler(SRequest $request, SResponse $response)
{
Coroutine::defer(function () {
fire(Event::EVENT_AFTER_REQUEST);
});
$this->execute($request, $response);
}
/**
* @param SRequest $request
* @param SResponse $response
* @return mixed|bool|null
* @throws ComponentException
*/
private function execute(SRequest $request, SResponse $response)
{
try {
Coroutine::defer(function () {
fire(Event::EVENT_AFTER_REQUEST);
});
$this->resolveParse($request, $response);
$manager = Snowflake::app()->annotation->websocket;