Expose parsing event callbacks to Ruby #30

Closed
dgraham opened this Issue Aug 4, 2010 · 1 comment

Comments

Projects
None yet
2 participants

dgraham commented Aug 4, 2010

It would be great if we could register callback blocks on a Yajl::Parser instance that would be called whenever an interesting parse event happens. I think the minimum set of event callbacks would be: start_document, end_document, start_object, end_object, start_array, end_array, key {|k| }, value {|value| }. I think only the key and value callbacks need to receive an argument.

With these callbacks in place, we can parse huge JSON documents incrementally without needing much memory. Huge JSON documents are rare, but some databases, like Apache CouchDB, use JSON to return map/reduce query results, which can potentially be quite large.

Owner

brianmario commented Sep 3, 2010

I'll have to think this over a bit, but it probably won't happen any time soon. The performance implications of doing so would be pretty profound. Closing for now

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment