my8bird/node-leveldb — pull request #33 by ulikoehler (2012-07-07 19:42:51+00:00)
Title: Added finished callback to iterator.forRange()

This pull request adds an additional, optional argument to iterator.forRange() which is a callback without argument.

This callback is called when the iterator has reached limitKey.

In any case, the finished callback is not called if any error occurs and the "normal" callback is guaranteed not to be called after the finished callback.

As the finished callback is optional, any call to forRange() not using the finished callback works exactly as before.

Currently there are no unit tests for this, but I tested the new feature in an expressjs app.

I think this feature is extremely important to node-leveldb - in my use case it is absolutely essential.

Also see Issue #28 for another request for this feature which should be fixed after merging this pull request.