0
votes

Does NodeMCU support multiple HTTP callback functions that exist (i.e. are registered) at the same time?

Scenario: two timers, operating independently, invoke two different functions. Each function makes its own HTTP request and registers a callback function.

If the second HTTP request is made before the first HTTP request callback function is invoked (i.e. second HTTP request fired off before server response to first HTTP request is received) then there will be two HTTP callback functions registered at the same time. Is this valid/supported, or do we need to design our applications to ensure that the second HTTP request is not made until the first request is completed?

1

1 Answers

0
votes

Quoting the docs:

Note that it is not possible to execute concurrent HTTP requests using this module. Starting a new request before the previous has completed will result in undefined behavior.

So, the answer to your question is no.