In case anyone is interested, I was doing some work with this library recently.
I discovered that it has a bug that prevents it from parsing again after you’ve parsed a document. I corrected it in my local copy of the library. I’ll try to clean things up and submit a pull request, when I get a chance.
In my case, I’m using it to parse JSON payloads from an MQTT service, which in turn interfaces with homebridge (Apple HomeKit emulation). I’ll receive new incoming payloads as events occur. In my case, I’m making a control for my garage door, so when I use my phone to open the garage door, homebridge on a Raspberry Pi receives the event, which ties to the MQTT plugin and plops the JSON payload into the appropriate queue. Then my controller sees the message in the subscribed channel, parses it, and triggers the relay. Later, it will happen again when I send the close garage command via my phone.
As is, the parser gets hung up at the end of a document. I’ve fixed it to reset the state so that it’s ready to start parsing again.