Comments (9)
Lets say your app is called app.js. Does it work if the following commands are executed?
UV_THREADPOOL_SIZE=10
node app
from bot-io.
Thanks for the reply. No increasing the threadpool had no effect. The only way to get a "repeat" button press to work is to limit the button inputs to 4 so far. Which i need 8 :) Any other thoughts? I can post my code if you like?
from bot-io.
Yes, post a simple example which can be used to reproduce the bug.
from bot-io.
The bug can be reproduced with the following code:
var bot = require('bot-io'),
buttons = [
new bot.Button(bot.pins.p9_23),
new bot.Button(bot.pins.p9_24),
new bot.Button(bot.pins.p8_07),
new bot.Button(bot.pins.p8_08),
new bot.Button(bot.pins.p8_09)
];
buttons.forEach(function (button) {
button.on('pressed', function () {
console.log('pressed: ' + button.name);
});
button.on('released', function () {
console.log('released: ' + button.name);
});
});
For some reason the data
events for files corresponding to the buttons that are needed to detect button press and release are not being fired correctly. The JavaScript code for the data
event handler is here.
What appears to be the same issue was also reported at nodejs/node-v0.x-archive#9132
from bot-io.
It turns out that this is related to the thread pool size. If the app is called app.js executing the following command should work (note that everything is on the same line):
UV_THREADPOOL_SIZE=10 node app
The following should also work:
export UV_THREADPOOL_SIZE=10
node app
from bot-io.
For more information about the thread pool see http://docs.libuv.org/en/latest/threadpool.html
from bot-io.
@fivdi Thanks so much! I just got home and was going to upload some code for you. However looks like your code reproduces this bug just fine. I guess its not a bug but more of a configuration mismatch. I think we should close this and put this info int the docs? Agree?
from bot-io.
Agreed, this should be documented.
from bot-io.
Documentation updated with #4
from bot-io.
Related Issues (2)
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 bot-io.