Closed twyatt closed 4 years ago
For now, decided to leave the current implementation as-is. The event Flow
does not suspend connection handling so the benefits of restricting this would not be helpful anyways.
It would be too limiting to prevent operations from within the event handling Flow
.
With #72, the
KeepAliveGatt
's internalGatt
property was changed to be configured prior to invoking theonConnectAction
.This resolves potential crashes when attempting to invoke
KeepAliveGatt
I/O methods from within the connection handler functions, but opens up potential bugs.If a library consumer performs some critical I/O from within the
onConnected
connection handler (and needs those actions to be perform before any other I/O) then allowing I/O operations onKeepAliveGatt
during theonConnected
function could cause hard to track down bugs. It would be preferred that the external I/O threwNotReady
(as that is the expected state untilonConnected
handler has completed.tl;dr Consider reverting 024fc38.