quartiq / minimq

Minimal no_std MQTT v5.0 client implementation
MIT License
146 stars 16 forks source link

Result codes from poll closure are not possible #80

Closed ryan-summers closed 2 years ago

ryan-summers commented 2 years ago

The closure in the poll() function cannot be propagated out of the stack. Sometimes, it's desireable to have a result move from the internal closure to external context to handle control flow.

Difficulties:

Perhaps we could allow an Error to exit the poll() loop early to allow Error codes to propagate outwards, but this wouldn't allow external Ok(result) data to be propagated.