Separated async from sync in bare minimum real time database example code to avoid confusion#276
Separated async from sync in bare minimum real time database example code to avoid confusion#276mWaleedh wants to merge 3 commits intomobizt:mainfrom
Conversation
The existing BareMinimum example can be confusing for developers using an RTOS, as it mixes both synchronous (blocking) and asynchronous (non-blocking) function calls. For a multi-tasking environment, relying on purely asynchronous patterns is a critical best practice to prevent tasks from blocking the scheduler. This commit introduces a new `RealTimeDatabase_Async.ino` example to serve as a clean, unambiguous starting point for this common use case.
separated sync from async also added comments for possible compilation errors on modern esp32 cores related to setConnectionTimeout and setHandShakeTimeout (deprecated in newer version of WifiClientSecure)
|
Thanks for the PR but I don't want to categorize the example like ever been before. In v1.x, and earlier, the examples are categorized by the service and usage modes like this The bare minimum is not designed for covering all use cases but to demonstrate the minimum requirements and operating concepts plus some simple Firebase functions. For elaborate usage, other examples are provided the application details. It differs than the conventional Arduino library API like starting with |
It's not true, the |
|
I cannot accept the example changes unless the typo in document. |
|
The Those methods are used for timeout customization otherwise the default timeout will be used. Your device will get stuck there for 10 seconds for server connection failure. The timeout was set for waiting time reduction when server is unreachable or not responding. It does not mean anything for usage modes (async and await) as |
|
Thank you for your time man. |
The existing BareMinimum example can be confusing for developers using an RTOS, as it mixes both synchronous (blocking) and asynchronous (non-blocking) function calls. For a multi-tasking environment, relying on purely asynchronous patterns is a critical best practice to prevent tasks from blocking the scheduler.
This commit introduces a new
RealTimeDatabase_Async.inoexample to serve as a clean, unambiguous starting point for this common use case.I have not changed the code I just separated the async from sync so that it is more clearer for beginners.
Also the setConnectionTimeout function has been deprecated from the WifiClientSecure library which causes compilation errors on newer ESP32 cores. That is why I added comments for someone facing this issue.