Comments (8)
It would be helpful to see how you're orchestrating these calls (also syntax highlight code with GitHub Flavored Markdown please).
from needle.
Hi. I have updated my original post. On the first POST I get the 1st document and on the second POST the 2nd associated document.
from needle.
Can you post the full stacktrace of your error?
from needle.
Hello. I added the console.trace.
from needle.
Is it possible there's a race condition at work and you're actually running up against the per-host maxSockets limit of 5? Are you handling errors and determining success using populateList
? Also note that your code as it stands could be more succinctly rewritten as:
needle.post(URL, DATA, populateList);
from needle.
Hi. As you said I am determining success using populateList
. As for the maxSockets, I have no idea. Do you know how I can check that on a RedHat server?
For the part about needle.post(URL, DATA, populateList);
, I did it intentionally so I won't pass the response
on the parameter but a different parameter. I changed it as you proposed but unfortunately it does not make any difference.
from needle.
It's not a server property. It's something the Node agent proposes but you can override. See the node docs link above.
Re: referencing functions vs. passing the literal in directly, the idea is that they're exactly identical. Just saves you a little verbosity.
I'd consider the way you're aggregate results to be an anti-pattern. You should be using some sort of async pattern to handle that logic (i.e. the aggregate operation should fail if a single member fails). I like promises. They're a more robust abstraction but also require some effort to properly understand. You can also try async for something simpler.
Try running all 10 operations in sequence so only one socket is open at any given time. Based on the stack trace this almost certainly isn't a needle issue.
from needle.
Unfortunately it will take me some time to rewrite that part so instead I am going to use elasticsearch.js in order to make the calls. Already tried it and it works as expected.
Thank you for the help guys.
from needle.
Related Issues (20)
- Test failures on node v4-v12
- Incorrect parsing of complex JS nested objects in POST request HOT 5
- Mangled file content when multipart-POSTing a file with a "text/*" content type HOT 2
- Very infrequent TypeError: iconv.encodingExists is not a function
- Tunnelling doesn't work in v3.1.0 HOT 12
- Proposal: Supporting User-Defined "Follow If" Conditions
- Piping needle request to Express response won't set the correct headers
- Multiple Files Upload Renames Input Field
- Uncaught asynchronous error
- Remote end closed socket abruptly errors HOT 2
- a ':' in nonce breaks digest authentication HOT 1
- Digest MD5 not working with Geovision IP Camera
- Uncaught ECONNRESET exception
- needle.get cannot guaranty getting the http stream HOT 2
- FEATURE: Retry HOT 1
- follow_set_cookies -> not working!!!
- Bug in 3.3.0: accidental creation of `global.signal`, gets caught in strict UTs
- README recommends mikeal's request HOT 3
- Multipart uploads strips date values in the request body HOT 2
- Doesn't work in Cloudflare Workers 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 needle.