-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Streams rewrite #906
Streams rewrite #906
Conversation
abfd3ca
to
a02b2b0
Compare
* [`.write(data, [callback])`](#module_serialport--SerialPort+write) | ||
* [`.pause()`](#module_serialport--SerialPort+pause) | ||
* [`.resume()`](#module_serialport--SerialPort+resume) | ||
* [`._write(data, [callback])`](#module_serialport--SerialPort+_write) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this is now a stream, _write
should probably not be documented.
72f6d57
to
f272fd0
Compare
4690c57
to
6bbf611
Compare
c663090
to
df01e89
Compare
195c919
to
280cfe6
Compare
We've now got unix read polling. I've only tested osx but linux should work as well. We should in theory have similar performance to the 4x releases with a little more read and write buffering. This should also solve the memory leak from #923 as we have a rewritten poller but that also needs verification. |
8325e0a
to
bbd7186
Compare
Current coverage is 85.36% (diff: 81.62%)@@ master #906 diff @@
==========================================
Files 7 13 +6
Lines 394 656 +262
Methods 58 111 +53
Messages 0 0
Branches 88 156 +68
==========================================
+ Hits 192 560 +368
+ Misses 202 96 -106
Partials 0 0
|
5930179
to
9cbd630
Compare
We don't have windows support yet, nor do we have the poller memory leak solved but I think I want to merge to master so we can work on these issues independently. |
fd445d3
to
1c1387f
Compare
This is a major change. To reading, the poller and the bindings layer, there isn’t a great way to do this piecemeal. The goal here is to make bindings a plugin layer, our c++ bindings isolated and tested, and make Serialport a streams object. - Move all bindings into platform specific modules DarwinBinding LinuxBinding, and WindowsBinding - Separate out the bindings from the SerialPort class so it can be required by itself. - Provide mock bindings as a tested first class bindings layer - Mixin stream methods with `pushBindingWrap`, inspired from fs.readStream - All integration tests now require an Arduino - Ditch sandboxed modules as we don't need to be that heavy handed to test anymore TODO - windows binding - performance test - memory leak test - 🎉
This is a major change. To reading, the poller and the bindings layer, there isn’t a great way to do this piecemeal. The goal here is to make bindings a plugin layer, our c++ bindings isolated and tested, and make Serialport a streams object.
pushBindingWrap
, inspired from fs.readStreamTODO