onConnect-Callback
See original GitHub issueHey guys,
is it possible to wrap the activate()
function in a Promise on your side?
Otherwise I guess this client is not that useful … I am trying to use/execute it in a lambda function …
My workaround atm is:
async connect(): Promise<void> { // Todo!
this.client.activate();
while (!this.client.connected) {
await new Promise(resolve => setTimeout(resolve, 50));
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
mqttclient.onconnect(callback) - Dev Center - Electric Imp
This method allows you to register a function that will be called whenever an attempt to connect to an MQTT broker (see mqttclient.connect())...
Read more >Filebeat -> elastic: onConnect callback failed: error loading ...
I have followed the instructions here: Grant privileges and roles needed for publishing | Filebeat Reference [7.17] | Elastic I have ...
Read more >`onConnect` callback support · Discussion #407 - GitHub
It would be really nice to have support for an onConnect callback which gets fired after the user connects their wallet. wagmi already...
Read more >Issue with onConnect callback function - Question - Mbed
Issue with onConnect callback function. This is how I am setting the onConnection call back in my code. ble.gap().onConnection(aConnectionCallback);.
Read more >OnConnect() Callback is not getting called using mosquitto C
mosquitto_connect() function is executing successfully but onConnect() function is not getting called for some unknown reason. onDisconnect() ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So, this is my current solution:
Maybe this is helpful for others facing this issue.
I think that should work.
Based on your requirements, you may be able to write similar code, though a different structure, without the RxJS wrapper.