@@ -156,12 +156,12 @@ void WSClientClass::initListeners() {
156
156
157
157
ws->OnBinaryReceived (
158
158
[nowList{&listeners[int (WSClientEvents::onBinaryReceived)]}](WebSocketClient&, vector<uint8_t > data) {
159
- if (!nowList->empty ())
160
- for (auto & listener : *nowList) {
161
- if (!EngineManager::isValid (listener.engine )) return ;
162
- EngineScope enter (listener.engine );
163
- NewTimeout (listener.func .get (), {ByteBuffer::newByteBuffer (data.data (), data.size ())}, 1 );
164
- }
159
+ if (!nowList->empty ())
160
+ for (auto & listener : *nowList) {
161
+ if (!EngineManager::isValid (listener.engine )) return ;
162
+ EngineScope enter (listener.engine );
163
+ NewTimeout (listener.func .get (), {ByteBuffer::newByteBuffer (data.data (), data.size ())}, 1 );
164
+ }
165
165
}
166
166
);
167
167
@@ -482,7 +482,7 @@ void ADD_CALLBACK(
482
482
}
483
483
}
484
484
CATCH_CALLBACK_IN_CORO (" Fail in NetworkAPI callback" )
485
- }).launch (ll::thread::ThreadPoolExecutor::getDefault ());
485
+ }).syncLaunch (ll::thread::ThreadPoolExecutor::getDefault ());
486
486
};
487
487
switch (method) {
488
488
case HttpRequestType::Get:
@@ -627,7 +627,7 @@ Local<Value> HttpServerClass::onPreRouting(const Arguments& args) {
627
627
resp = *respObj->get ();
628
628
}
629
629
CATCH_CALLBACK_IN_CORO (" Fail in onPreRouting" );
630
- }).launch (ll::thread::ThreadPoolExecutor::getDefault ());
630
+ }).syncLaunch (ll::thread::ThreadPoolExecutor::getDefault ());
631
631
632
632
return handled ? Server::HandlerResponse::Handled : Server::HandlerResponse::Unhandled;
633
633
});
@@ -661,7 +661,7 @@ Local<Value> HttpServerClass::onPostRouting(const Arguments& args) {
661
661
resp = *respObj->get ();
662
662
}
663
663
CATCH_CALLBACK_IN_CORO (" Fail in onPostRouting" );
664
- }).launch (ll::thread::ThreadPoolExecutor::getDefault ());
664
+ }).syncLaunch (ll::thread::ThreadPoolExecutor::getDefault ());
665
665
});
666
666
return this ->getScriptObject ();
667
667
}
@@ -692,7 +692,7 @@ Local<Value> HttpServerClass::onError(const Arguments& args) {
692
692
resp = *respObj->get ();
693
693
}
694
694
CATCH_CALLBACK_IN_CORO (" Fail in onError" );
695
- }).launch (ll::thread::ThreadPoolExecutor::getDefault ());
695
+ }).syncLaunch (ll::thread::ThreadPoolExecutor::getDefault ());
696
696
});
697
697
return this ->getScriptObject ();
698
698
}
@@ -731,7 +731,7 @@ Local<Value> HttpServerClass::onException(const Arguments& args) {
731
731
resp = *respObj->get ();
732
732
}
733
733
CATCH_CALLBACK_IN_CORO (" Fail in onException" );
734
- }).launch (ll::thread::ThreadPoolExecutor::getDefault ());
734
+ }).syncLaunch (ll::thread::ThreadPoolExecutor::getDefault ());
735
735
});
736
736
return this ->getScriptObject ();
737
737
}
0 commit comments