Closed kelunik closed 5 years ago
Looks like this came up in the past for reading, as we already have this defer when reading. For writing we can skip attempting the write and always enable the write watcher, which will push queued writes to the next tick.
Edit: On second thought, that would add a lot of latency to writing… either it's fine as-is with the read defer or we need some other trigger to delay writing for a tick.
I think it's fine for now then.
A tight loop of reading and writing with data always being available and always writable, might result in a blocking loop. We should discuss measures to mitigate that, e.g. scheduling immediate write with a
Loop::defer()
in case many of them happen in a tight loop.