Skip to content
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

Merged
merged 1 commit into from
Nov 5, 2016
Merged

Streams rewrite #906

merged 1 commit into from
Nov 5, 2016

Conversation

reconbot
Copy link
Member

@reconbot reconbot commented Aug 14, 2016

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
  • 🎉

@reconbot reconbot force-pushed the streams branch 5 times, most recently from abfd3ca to a02b2b0 Compare August 17, 2016 02:09
* [`.write(data, [callback])`](#module_serialport--SerialPort+write)
* [`.pause()`](#module_serialport--SerialPort+pause)
* [`.resume()`](#module_serialport--SerialPort+resume)
* [`._write(data, [callback])`](#module_serialport--SerialPort+_write)

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.

@reconbot reconbot force-pushed the streams branch 4 times, most recently from 72f6d57 to f272fd0 Compare August 21, 2016 17:37
@reconbot reconbot force-pushed the streams branch 8 times, most recently from 4690c57 to 6bbf611 Compare August 22, 2016 03:56
@reconbot reconbot force-pushed the streams branch 2 times, most recently from c663090 to df01e89 Compare August 22, 2016 20:57
@reconbot reconbot force-pushed the streams branch 8 times, most recently from 195c919 to 280cfe6 Compare September 6, 2016 22:42
@reconbot
Copy link
Member Author

reconbot commented Nov 1, 2016

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.

@reconbot reconbot force-pushed the streams branch 6 times, most recently from 8325e0a to bbd7186 Compare November 2, 2016 04:50
@codecov-io
Copy link

codecov-io commented Nov 2, 2016

Current coverage is 85.36% (diff: 81.62%)

Merging #906 into master will increase coverage by 36.63%

@@             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          

Powered by Codecov. Last update 9f8a359...85a7748

@reconbot reconbot force-pushed the streams branch 2 times, most recently from 5930179 to 9cbd630 Compare November 2, 2016 20:40
@reconbot
Copy link
Member Author

reconbot commented Nov 2, 2016

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.

@reconbot reconbot force-pushed the streams branch 9 times, most recently from fd445d3 to 1c1387f Compare November 4, 2016 21:29
@reconbot reconbot changed the title [WIP] Streams rewrite Streams rewrite Nov 4, 2016
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
- 🎉
@reconbot reconbot merged commit 39d0103 into master Nov 5, 2016
@reconbot reconbot deleted the streams branch November 5, 2016 01:03
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants