Skip to content

Feature request: optional callback #196

@skelter

Description

@skelter

It would be useful if the parser and/or Instaparse routines took an optional callback function to allow graceful halting of a parse.

While developing a grammar and parser and even when that parser is in production, I've encountered a situation in which a particular input inspires the parser to run uninterruptibly until exhausting heap. No doubt there are improvements needed in the grammar however debugging and dealing with the run-away parse is problematic and that it is possible causes some angst when we want to parse data in a production server with Instaparse. We've tried wrapping the parser in a future and interrupting it, and this approach is fraught with the usual interrupted thread issues.

It would be useful if the parser and/or Instaparse routines took an optional callback function to allow graceful halting of a parse. This function, if set, could be called periodically during the parse to confirm if parsing should carry on. This would help us improve resilience to the occasional run-away parse process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions