Comments (4)
Maybe it has something to do with multiple connections?
Here is a little test script. I want 20 fetchs / sec.
The first second goes pretty ok, but the 2nd and on, only 1 task is reserved, and nothing is deleted.. If i put a console.log within the setInterval, i see it ticking just fine.
const beans = require('fivebeans')
const client = new beans.client();
client.on('connect', () =>
{
client.watch('testTube4', function(err, tubename)
{
setInterval(() =>
{
for(let i = 0; i < 20;i++)
{
client.reserve(function(err, jobid, payload)
{
console.log(reserve: ${jobid}, err:${err}
);
client.destroy(jobid, function(err)
{
console.log(`destroy: ${jobid}, err:${err}`);
});
});
}
}, 1000);
});
}).connect();
from fivebeans.
1st try .. stops at 1 reserve and nothing else comes through.
vagrant@packer-virtualbox-iso-1490879070:~/sync$ node test.js
reserve: 101099, err:null
reserve: 101100, err:null
reserve: 101101, err:null
reserve: 101102, err:null
reserve: 101103, err:null
reserve: 101104, err:null
reserve: 101105, err:null
reserve: 101106, err:null
reserve: 101107, err:null
reserve: 101108, err:null
reserve: 101109, err:null
reserve: 101110, err:null
reserve: 101111, err:null
reserve: 101112, err:null
reserve: 101113, err:null
reserve: 101114, err:null
reserve: 101115, err:null
reserve: 101116, err:null
reserve: 101117, err:null
reserve: 101118, err:null
destroy: 101099, err:null
destroy: 101100, err:null
destroy: 101101, err:null
destroy: 101102, err:null
destroy: 101103, err:null
destroy: 101104, err:null
destroy: 101105, err:null
destroy: 101106, err:null
destroy: 101107, err:null
destroy: 101108, err:null
destroy: 101109, err:null
destroy: 101110, err:null
destroy: 101111, err:null
destroy: 101112, err:null
destroy: 101113, err:null
destroy: 101114, err:null
destroy: 101115, err:null
destroy: 101116, err:null
destroy: 101117, err:null
destroy: 101118, err:null
reserve: 101119, err:null
reserve: 101120, err:null
reserve: 101121, err:null
reserve: 101122, err:null
reserve: 101123, err:null
reserve: 101124, err:null
reserve: 101125, err:null
reserve: 101126, err:null
reserve: 101127, err:null
reserve: 101128, err:null
reserve: 101129, err:null
reserve: 101130, err:null
reserve: 101131, err:null
reserve: 101132, err:null
reserve: 101133, err:null
reserve: 101134, err:null
reserve: 101135, err:null
reserve: 101136, err:null
reserve: 101137, err:null
reserve: 101138, err:null
destroy: 101119, err:null
destroy: 101120, err:null
destroy: 101121, err:null
destroy: 101122, err:null
destroy: 101123, err:null
destroy: 101124, err:null
destroy: 101125, err:null
destroy: 101126, err:null
destroy: 101127, err:null
destroy: 101128, err:null
destroy: 101129, err:null
destroy: 101130, err:null
destroy: 101131, err:null
destroy: 101132, err:null
destroy: 101133, err:null
destroy: 101134, err:null
destroy: 101135, err:null
destroy: 101136, err:null
destroy: 101137, err:null
destroy: 101138, err:null
reserve: 101139, err:null
Still doing 20 at the same time, only 1 in the tube, but destroy doesn't trigger.
vagrant@packer-virtualbox-iso-1490879070:~/sync$ node test.js
reserve: 101139, err:null
Still doing 20 at the same time, only 1 in the tube, but destroy doesn't trigger.
vagrant@packer-virtualbox-iso-1490879070:~/sync$ node test.js
reserve: 101139, err:null
I changed it to do only 1 at a time and now the destroy works?!
vagrant@packer-virtualbox-iso-1490879070:~/sync$ node test.js
reserve: 101139, err:null
destroy: 101139, err:null
from fivebeans.
For now, i think i just had to work around it.. instead of X parallel, i just do 1 at a time with less delays.
from fivebeans.
Closing, clearly this repo is no longer maintained.
from fivebeans.
Related Issues (20)
- bug: if .connect() called more than once, incorrect callbacks are used HOT 1
- Obsolete documentation for yaml configuration HOT 3
- Is there a way to clear / destroy a queue?
- Connections left open
- Limit number of worker nodes.
- Security vulnerability
- Race condition
- Confused: Is Watch not allowed while in Reserve? HOT 1
- Havent check if callback is avilable
- Delayed job executes now
- Possible to support multiple beanstalkd servers? HOT 3
- Reserve doesn't respond after use tube HOT 3
- Multiple worker HOT 3
- Not an issue don't flag it! Missed something in the great doc HOT 2
- Handlers issues HOT 2
- runner, why class?
- is connected method?
- eslint should only be in devDependencies HOT 2
- SyntaxError: Unexpected token HOT 1
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 fivebeans.