Comments (3)
To put it briefly, we need of way of keeping track of when a specific write
has completed, and call the callback only then.
from t2-cli.
I considered adding a ready
event or similar so that the stream consumer can know when it is writable but, besides being ugly, we can't modify default stream behaviour because then ssh and usb connections become incompatible.
from t2-cli.
This is my next implementation attempt
Call _write
self.stdin.write(data);
_write adds the buffer to the backPressure object with the callback as key
self.stdin.backPressure.push({buffer: chunk, cb: callback})
_write calls a method to start draining back pressure chunks until there is no more data or credit
while (stdin.credit && stdin.backPressure.length) {
_writeHelper(stdin.backPressure[0]);
}
Once an entire chunk is sent, the callback to that entry is called and removed from the array
if (entry.buffer.length == 0) {
self.stdin.buffer.unshift();
entry.callback && entry.callback();
}
from t2-cli.
Related Issues (20)
- Crash report: It is unclear which device should be operated upon.
- Crash report: It is unclear which device should be operated upon.
- Crash report: Error: Bogus error
- Crash report: Error: Bogus error
- Crash report: TypeError: options.end is not a function
- Crash report: TypeError: Class constructor cannot be invoked without 'new'
- Crash report: TypeError: Class constructor cannot be invoked without 'new'
- Crash report: Error: kill ENOSYS
- Crash report: Error: No device found in bootloader mode
- Crash report: Error: No device found in bootloader mode
- '$t2 update' occurs error ' HOT 1
- Do you have pre-compiled binaries for @serialport/[email protected]
- Pre-compiled module is missing: @serialport/[email protected]. Warning when running 't2 run' on Mac HOT 2
- Crash report: TypeError: process.stdin.setRawMode is not a function
- Node version mismatch for USB drivers. HOT 1
- unable to run tessel 2 HOT 2
- Crash report: Error: self signed certificate in certificate chain
- Debugging the T2 CLI - no connection to device HOT 7
- Must pass -oKexAlgorithms=+diffie-hellman-group1-sha1 flag to ssh to tessel 2
- serialport issue trying to initiate 2 Tessel 2's - Pre-compiled module is missing: Could not locate the bindings file. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from t2-cli.