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

Introduce a listener for JSON events #832

Open
sbordet opened this issue Feb 20, 2019 · 1 comment
Open

Introduce a listener for JSON events #832

sbordet opened this issue Feb 20, 2019 · 1 comment

Comments

@sbordet
Copy link
Member

sbordet commented Feb 20, 2019

The first use case is when a client sends a message and may want to limit the size of the message being sent.
This listener would need to be called after all transformations that extensions may do to the message.
Furthermore, the JSON generation must be done once, so that applications can interact with the JSON without the need to generate the JSON a second time which would waste resources.

@sbordet
Copy link
Member Author

sbordet commented Feb 20, 2019

It may be interesting to emit an event for the incoming JSON (on both client and server) before it is converted to a message object.
However, this would require to accumulate the JSON into a String, while currently we can parse the JSON using a Reader with much less impact on memory.

On server side another event may be emitted when the message is frozen, so that applications will be able to e.g. log the message length in bytes.

@sbordet sbordet changed the title Introduce a listener to handle JSON generation Introduce a listener for JSON events Feb 20, 2019
@sbordet sbordet added this to the 4.0.4 milestone Feb 20, 2019
@sbordet sbordet removed this from the 4.0.4 milestone May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant