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

Websockets #1278

Closed
Slashek opened this issue Oct 28, 2020 · 6 comments
Closed

Websockets #1278

Slashek opened this issue Oct 28, 2020 · 6 comments

Comments

@Slashek
Copy link
Contributor

Slashek commented Oct 28, 2020

Currently, the only way to handle asynchronous tasks is to constantly poll the server. We would like to be able to use WebSockets to enhance the user experience.

@mattwalter91
Copy link

mattwalter91 commented Oct 28, 2020

I think that in a lot of cases webhooks would work. That's what you use for instance_create, and it would works for processes like imports. We just need to know when the process is complete, and there's no real back and forth between us.

Not sure if that's easier since you have it in other places. There might be cases for websockets that I'm not thinking of too.

@richxrich
Copy link

Websockets are good for persistent connections where things need to be real time, mobile apps, etc... also can be used for real time video and audio if you want to explore array buffers :)

@mattwalter91
Copy link

I read "constantly poll the server" and thought of where we do that, which is checking site copy status and import status. In that situation a webhook returning the single result would be the better option I think.

I understand what you mean though. Is this task is for custom use, like receiving updates on model data?

@onecreative
Copy link
Contributor

@mattwalter91 I think webhooks should be a separate request. Both features are needed.

@richxrich
Copy link

@mattwalter91 Push notifications are essentially socket connections, they are an always connected state to Apple or Google who then push something to the phone when needed. I used to work in finance and all our IoT devices or hardware terminals were connected via sockets in order to have faster processing, real time feedback, and the fact the end device could be behind unknown levels of networking. Basically if you got a connection there was nothing else to worry about.

Clickup and Google sheets etc all use websockets for the speed and realtime interaction with multi users....

@Slashek
Copy link
Contributor Author

Slashek commented Nov 6, 2020

The new version of the https://getmarketplace.co/ (code available here https://github.com/mdyd-dev/product-marketplace-template) will include chat built using WebSockets - coming next week! Behind the scenes, we will continue working on backend stuff. This is still highly experimental, however should give you a taste of what to expect. For now, backend logic can be handled by partials with the channels/ prefix (for example https://github.com/mdyd-dev/product-marketplace-template/blob/master/modules/chat/public/views/partials/channels/conversate.html.liquid ), but it might be a good idea to extract it to a separate folder, like app/channels/ instead of relying on the convention. Looking for your feedback!

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

5 participants