strongloop / strong-oracle

Deprecated: Node.js Driver for Oracle databases (Use https://github.com/oracle/node-oracledb instead)
Other
45 stars 18 forks source link

fix #40 return the callback #41

Closed soyuka closed 9 years ago

soyuka commented 9 years ago

Nice catch @kathan!

soyuka commented 9 years ago

Take #42 instead.

@raymondfeng it doesn't shock me, I know that return is always faster. Thought, I doubt it could solve a memory issue.

soyuka commented 9 years ago

@raymondfeng I don't understand the need of process.nextTick in the reader.

May you take a look at this implementation of the reader: https://github.com/soyuka/strong-oracle/commit/5164a399e1b82135c39af5044cc8b53f4aed8fb7 ?

kathan commented 9 years ago

The way I understand it is, if you don't return when the closure is complete, the GC won't release the memory allocated to the closure.

raymondfeng commented 9 years ago

process.nextTick() is to ensure the async expectation of a method call so that the caller is guaranteed that callback will happen after the method call returns.

soyuka commented 9 years ago

It's not needed here.