firmata/firmata.js

An async write operation completion problem

Closed this issue · 0 comments

The problem begins here: rwaldron/johnny-five#1306 (important to read through to my findings at the end).

Summary points:

  • serialport writing is non-blocking
  • firmata.js dependent programs may want to do cleanup tasks before exiting.
  • firmata.js needs a simple way to signal that writes are:
    • pending
    • complete
  • incrementing and decrementing a counter is simple way to achieve such signaling.