Implemented periodic called loop method in webapi
This commit is contained in:
parent
75bae16f92
commit
cae47a142a
@ -6,6 +6,7 @@ class WebApiClass {
|
||||
public:
|
||||
WebApiClass();
|
||||
void init();
|
||||
void loop();
|
||||
|
||||
private:
|
||||
AsyncWebServer _server;
|
||||
|
||||
@ -97,6 +97,12 @@ void WebApiClass::init()
|
||||
_server.begin();
|
||||
}
|
||||
|
||||
void WebApiClass::loop()
|
||||
{
|
||||
// see: https://github.com/me-no-dev/ESPAsyncWebServer#limiting-the-number-of-web-socket-clients
|
||||
_ws.cleanupClients();
|
||||
}
|
||||
|
||||
void WebApiClass::onNotFound(AsyncWebServerRequest* request)
|
||||
{
|
||||
// Handle Unknown Request
|
||||
|
||||
@ -96,4 +96,6 @@ void loop()
|
||||
yield();
|
||||
MqttPublishing.loop();
|
||||
yield();
|
||||
WebApi.loop();
|
||||
yield();
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user