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

Streaming format #5

Open
riking opened this issue Jul 17, 2022 · 1 comment
Open

Streaming format #5

riking opened this issue Jul 17, 2022 · 1 comment

Comments

@riking
Copy link

riking commented Jul 17, 2022

It's trivial to extend this format to support streaming. Here I imagine some specs for it.

Suggested BNF additions:

grammar ::= string-table ';' object-shape-table ';' ows value
streaming-grammar ::= string-table ';' object-shape-table ';' ows (value ';' ows)*

ows ::= *( %x20 / %x0A / %x0D )

Suggested specification phrasing:

The streaming format is recognized by finding a semicolon after the first complete JCOF value. Parsers not instructed to expect an object stream SHOULD recognize this situation and emit an error.

Implementations using the streaming grammar SHOULD emit a newline after the object shape table and after every emitted object (at the "ows" production in the BNF). This enables compatibility with existing line-streaming programming styles.

@mycroes
Copy link

mycroes commented Jul 17, 2022

I was also thinking about streaming, I think a major issue is that the string-table is sent before objects, so you can no longer amend it. I think for streaming it would be nice if there would some way to send intermediate string tables and object formats (the encoder doesn't necessarily know all object shapes upfront).

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

2 participants