You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At my server, on every connection I need to setup some stuff on database before allowing the client to subscribe to channels and start receiving messages:
aedes.on("client", async (client) => {
console.log("ON CLIENT")
console.log("Delaying test for a delayed database task...")
await new Promise(resolve => setTimeout(resolve, 1000));
console.log("Delayed test end...")
console.log("Returning...")
});
The client (using mosquitto) is receiving CONNACK before aedes.on("client") returns...
As doing so, client thinks its all fine with the server and start subscribing channels and sending messages up - and the server is not ready as it's stuck on connect...
Is it the correct behaviour? If so, how can I signal the client that server is ready for processing his requests?
The text was updated successfully, but these errors were encountered:
@remendes all events listeners doesn't provide any kind of backpressure on the stream, them are simply emitted by the broker and you catch them. Methods that work like you want are preConnect, authorize, authorizeSubscribe, authorizePublish and published
At my server, on every connection I need to setup some stuff on database before allowing the client to subscribe to channels and start receiving messages:
The client (using mosquitto) is receiving CONNACK before aedes.on("client") returns...
As doing so, client thinks its all fine with the server and start subscribing channels and sending messages up - and the server is not ready as it's stuck on connect...
Is it the correct behaviour? If so, how can I signal the client that server is ready for processing his requests?
The text was updated successfully, but these errors were encountered: