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

Don't process incoming message asynchronously #11

Open
henvic opened this issue Sep 10, 2018 · 2 comments
Open

Don't process incoming message asynchronously #11

henvic opened this issue Sep 10, 2018 · 2 comments

Comments

@henvic
Copy link

henvic commented Sep 10, 2018

Just a heads-up with an issue that happened with me.

golang-socketio/channel.go

Lines 156 to 158 in 90487b6

default:
go e.processIncoming(c, decodedMessage)
}

isn't correct because sometimes you want to have a guarantee on the order of incoming messages.

Instead, you want to guarantee the order like so:

https://github.com/wedeploy/gosocketio/blob/ef257277a67693f4f0830594e3829e3e02c4d402/client.go#L257-L259

and let the consumer decides if he swaps a new goroutine for handling the message or handles it on the same one.

If you go to https://asciinema.org/a/192043 (between 1:57 and 2:15) and you see the execution of some shell commands you get why this is fundamental (every key you hit on the keyboard is an event).

@mtfelian
Copy link
Owner

Thanks for the issue, I will take a closer look on it later. It's not obvious that if we simply remove go there it will work nominal with both transports. Had there been tests it were helped a lot in resolving such issues.

@varun1729
Copy link

@mtfelian What is the update on this?

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