Join GitHub today
Multiple callbacks on one streaming parser? #9
It seems from README / tests / code that currently one
For our current use case, this is perfectly OK, just wanted to confirm, and have this for tracking.
(It may already be possible to abuse
Yes, only one
As you figured it's possible to match multiple items with complex conditions or even with using both
It's also true that a single-parser-multiple-callbacks is in principle doable and could be faster in these cases.
One thing to keep in mind with future and current implementation is that we currently throw away yielded data, otherwise the purpose of streaming would be defeated. Because of this nested results are problematic. I.e. if you yield something that could later be a part of another match it will no longer be available. So in some SAX callbacks we'd need to check whether the partial data could be matched in the future before we remove it. I think this is not an issue for
In any case, it would be a nice improvement. :)