ybogdanov / node-sync

Write simple and readable synchronous code in nodejs using fibers
MIT License
492 stars 70 forks source link

Hangs on block #46

Open shadowcodex opened 9 years ago

shadowcodex commented 9 years ago

So I created a function, and I call it with sync. However the program completely blocks and won't move past that call. The call finishes and it just sits.

Once I remove sync then it moves forward.

I am trying to call this function which in turn calls 20 or so https requests, and database connections. When they all finish I want to close the database connection (it is persistent until closed (elastic search)). However it never reaches the client.close() and thus the process never ends.

Ideas?

ybogdanov commented 9 years ago

Can you provide code examples of calling this function with/without sync?