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

Stream encoding with gojay seems to be a problem. #169

Open
shawlleyw opened this issue Jul 8, 2022 · 1 comment
Open

Stream encoding with gojay seems to be a problem. #169

shawlleyw opened this issue Jul 8, 2022 · 1 comment

Comments

@shawlleyw
Copy link

I was just running the stream encoding example given in README and got into trouble.

  1. Stream encoding API supports enc.Done() to synchronize consumers and help them exit after all jobs are done. However it does not support any ways to notify consumers that no more jobs would be delivered in future. Unfortunately this would trap all consumers into endless wait, or deadlock.

fatal error: all goroutines are asleep - deadlock!

  1. The order of output stream is not consistent with input stream while mulitiple consumers are working together.

By the way, the example given in README has a trivial bug, enc.Object(o) should not be called there, it should be enc.AddObject(o) instead.

@shawlleyw
Copy link
Author

Considering this repo might be orphaned and would be maintained no more, I would like to link another high performance json tool with streaming API here. Hope it would help someone.

https://github.com/bytedance/sonic

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

1 participant