Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to do stream parsing? #95

Open
steinybot opened this issue Aug 24, 2017 · 3 comments
Open

How to do stream parsing? #95

steinybot opened this issue Aug 24, 2017 · 3 comments

Comments

@steinybot
Copy link

I have tried to use the AsyncParser but I couldn't figure out how to get anything out other than a single jsobject as defined by my AST (in this case Play JSON).

Assume I have something like:

{
  "name": "thing"
  "elements": [{
    "key": "a",
    "value": "alice"
  },{
    "key": "b",
    "value": "bob"
  },
  ...
  ]
}

How can I get it so that each call to absorb will return zero or more elements?

@gchauvet
Copy link

gchauvet commented Dec 4, 2017

Hi,

I'm facing to the same usecase... I will glad to know how you resolved it :)
Regards

@steinybot
Copy link
Author

@gchauvet I didn't resolve it. To be fair I didn't spend much time looking into it but this was the only thing I wanted so gave up pretty quick.

@GreyPlane
Copy link

I found jawn-fs2, this module provide jawn async parser binding to fs2 stream, which provide a functional abstraction over streaming, also I quickly inspect its code, seems it doesn't require too much work to bind, so I assume it should be relatively easy to bind to other streaming library if you have a prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants