[nodejs] How to handle errors for a batch fo async calls

2013-02-25 Thread Glenn Block
Hello all Let's assume you have an API that results in a batch of HTTP calls which fire async and which are not sequential. A constraint of the API is that any errors that occur during the calls need to get returned to the user. How have you customarily designed this? One idea was something

Re: [nodejs] How to handle errors for a batch fo async calls

2013-02-25 Thread Pedro Teixeira
Hey Glenn, For something this complex I think an event emitter may be better suited. -- Pedro On Monday, February 25, 2013 at 9:57 AM, Glenn Block wrote: Hello all Let's assume you have an API that results in a batch of HTTP calls which fire async and which are not sequential. A

[nodejs] Re: announcing browserify v2

2013-02-25 Thread Alexey Petrushin
Any plans to support custom require in future? It works in node.js - why make browser version of `requre` different from its original? On Saturday, February 23, 2013 4:43:34 AM UTC+4, substack wrote: browserify v2 was just released! browserify lets you write node-style require() calls for

[nodejs] Re: How to handle errors for a batch fo async calls

2013-02-25 Thread Geerten van Meel
No need for event emitters, you can do this entirely functional. For this sorts of asynchroneous tasks, the async module comes to the rescue. A possible implementation would use the queue function with a high value for the concurrency of task procession. Whenever an error occurs, or you

Re: [nodejs] Re: How to handle errors for a batch fo async calls

2013-02-25 Thread Pedro Teixeira
When I advised using an event emitter, I was referring to the exposed API, which looked like what Glenn was asking about. That operation he mentioned can emit several different events throughout time, and the best fit would be, in my opinion, an event emitter. It's universally known to node

Re: [nodejs] How to handle errors for a batch fo async calls

2013-02-25 Thread Oleg Slobodskoi
I wrote this to handle such stuff: https://github.com/kof/do Possibly I have to add a complete callback for the case one want to when it is finished and than get the array of errors. Normally you don't want go further when error is happened. Am 25.02.2013 um 10:57 schrieb Glenn Block

Re: [nodejs] Re: why fallocate is not exposed?

2013-02-25 Thread Matt
I'd happily take a patch to add something to fs-ext. Especially if it comes with a patch to support gyp :) On Sun, Feb 24, 2013 at 5:47 PM, Ben Noordhuis i...@bnoordhuis.nl wrote: On Sun, Feb 24, 2013 at 11:00 PM, Marcel Laverdet mar...@laverdet.com wrote: others. Really this is something

Re: [nodejs] Re: How to handle errors for a batch fo async calls

2013-02-25 Thread Geerten van Meel
@Pedro: This is the nice thing about JavaScript, you can handle problems in lots of different ways. I'm just pointing out one alternative approach. EventEmitters make a lot more sense when you are trying to make reusable components, given the (very small) overhead they imply. On Monday,

[nodejs] Re: announcing browserify v2

2013-02-25 Thread Bradley Meck
We are doing some dark magic upcoming using https://github.com/bmeck/node-module-system +1 if we can get a standardized require shim. Does not need to be ours. -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You

Re: [nodejs] How to handle errors for a batch fo async calls

2013-02-25 Thread Glenn Block
Thanks Pedro On Mon, Feb 25, 2013 at 2:16 AM, Pedro Teixeira pedro.teixe...@gmail.comwrote: Hey Glenn, For something this complex I think an event emitter may be better suited. -- Pedro On Monday, February 25, 2013 at 9:57 AM, Glenn Block wrote: Hello all Let's assume you have an

Re: [nodejs] How to handle errors for a batch fo async calls

2013-02-25 Thread Glenn Block
Normally you don't want go further when error is happened. In this case it is acceptable to continue processing as long as you capture the received errors. If there were a high amt of failures you might consider cancelling though. On Mon, Feb 25, 2013 at 6:00 AM, Oleg Slobodskoi

Re: [nodejs] How to handle errors for a batch fo async calls

2013-02-25 Thread Glenn Block
Jose, thanks for the clarification. Literally right after sending the mail I was thinking I forgot all about event emitters :-) In terms of error, are you saying that any time you emit an event called Error the runtime exits if there is no listener? On Mon, Feb 25, 2013 at 3:12 AM, José F.

Re: [nodejs] How to handle errors for a batch fo async calls

2013-02-25 Thread José F . Romaniello
yes http://nodejs.org/api/events.html#events_class_events_eventemitter 2013/2/25 Glenn Block glenn.bl...@gmail.com Jose, thanks for the clarification. Literally right after sending the mail I was thinking I forgot all about event emitters :-) In terms of error, are you saying that any

Re: [nodejs] How to handle errors for a batch fo async calls

2013-02-25 Thread Mikeal Rogers
Agreed, sometimes a yes or no question is answered by an error or success in a callback in node. You don't see this in blocking systems as much because try/catch is cumbersome but it's fairly common in node. On Feb 25, 2013, at February 25, 201311:51 AM, Glenn Block glenn.bl...@gmail.com

Re: [nodejs] How to handle errors for a batch fo async calls

2013-02-25 Thread José F . Romaniello
quoting docs: When an EventEmitter instance experiences an error, the typical action is to emit an 'error' event. Error events are treated as a special case in node. If there is no listener for it, then the default action is to print a stack trace and exit the program. 2013/2/25 Glenn Block

Re: [nodejs] How to handle errors for a batch fo async calls

2013-02-25 Thread Adam Crabtree
Short answer, most control-flow libraries support grouping and some form of error coalescing. Also, you can use stepdown for this. Stepdown supports error coalescing, and domains for async catching. It also functions by default as an EE as well: var $$ = require('stepdown') function

Re: [nodejs] How to handle errors for a batch fo async calls

2013-02-25 Thread Glenn Block
Thanks. I hate to admit I've created emitters before and didn't realize this. On Mon, Feb 25, 2013 at 12:00 PM, José F. Romaniello jfromanie...@gmail.com wrote: quoting docs: When an EventEmitter instance experiences an error, the typical action is to emit an 'error' event. Error

Re: [nodejs] MongoDB / Mongoose - prevent field update

2013-02-25 Thread smak
Dan, Thanks for the information... I will knock around and see what I can do with that approach. Thanks, smak On Friday, February 22, 2013 10:01:45 AM UTC-5, Dan Milon wrote: It's up to you to filter and validate the input. (ok, mongoose has some basic validation but that won't help you

[nodejs] Re: announcing browserify v2

2013-02-25 Thread TJ Koury
Question to all concerned who are creating these tools that bundle: How do you handle dependencies in purely client-side code? I built a little library that uses transitive reduction along with a manifest file that lists all known dependencies for each of the browser-side scripts, so for

Re: [nodejs] Upnp + NodeJS (Question)

2013-02-25 Thread Fedor Indutny
You can try taking this module as a base, and extending it with other functions: https://github.com/indutny/node-nat-upnp Cheers, Fedor. On Tue, Feb 26, 2013 at 12:52 AM, Tim Montague tfmonta...@gmail.com wrote: *Can I use NodeJS to detect a upnp device, and send it a SOAP message?*

[nodejs] Re: announcing browserify v2

2013-02-25 Thread Bradley Meck
Generally I abstract out my implementations and my interfaces. This means a more verbose code base, but allows me to have the renderer inserted via dependency injection. It is independent of bundling tech and I have used it with browserify as well as with AMD to great success. Decoupling those

[nodejs] [ANN] reStore, a personal remoteStorage server

2013-02-25 Thread James Coglan
I've just made the first public release of reStore, a Node.js server that implements the remoteStorage protocol. This lets web applications delegate their storage needs to a server chosen by the user, and is part of the Unhosted project.

Re: [nodejs] node.js database driver for SAP HANA in-memory database

2013-02-25 Thread am_p1
I'm using node odbc a LOT with db2... it's c++, non blocking and therefore very fast... google odbc sap hana... On Friday, February 22, 2013 4:43:34 PM UTC-5, TJ wrote: On 22/02/13 20:49, Zhibin wrote: Hi, Is anyone interested to build a node.js database driver for SAP HANA

Re: [nodejs] Secure distribution of NodeJS applications

2013-02-25 Thread Roger WANG
Jeremy Rudd jrudd.develo...@gmail.com writes: *What:* Can NodeJS apps be distributed as binary? ie. you compile the .js app via V8 into its native binary, and distribute the binary to our clients? ... or is minifying the code all you can do? *Why:* We build serverside applications in