Hacker News new | ask | show | jobs
by bajtos 4447 days ago
That's not entirely true. If "db.insertUser()" is opening a database connection, who is going to close it on error?

The idea behind Zones for Node.js is to auto-attach new resources to the current zone, so that they can be cleaned when the zone exits.

AFAIK there is no solution for that at the moment.

1 comments

I'm thinking whatever db plugin you're using, but also this pseudo code actually has a lot of implicit things going in the background (koa/co, thunks, etc).

It makes for some readable app code though.