RobotPajamas / SwiftyTeeth

A simple, lightweight library intended to take away some of the cruft and tediousness of using CoreBluetooth
Apache License 2.0
23 stars 8 forks source link

Replace OperationQueue with Custom Dispatcher #27

Open sureshjoshi opened 6 years ago

sureshjoshi commented 6 years ago

The Operation Queue is neat, but a giant pain in the ass to extend - with all of its quirks.

Blueteeth has a super simple Dispatcher at around 40 lines of code, and it'll work just as well as SwiftyTeeth needs for a SerialDispatcher

sureshjoshi commented 4 years ago

Just discovered some more race conditions using a piece of hardware that disconnects immediately after receiving a TX message - basically, the existing message in the queue doesn't finish up, so just loiters and blocks the queue (even after cancellation).

Definitely need a better queue system.