O
O
Orange Banana2020-01-10 12:03:39
Python
Orange Banana, 2020-01-10 12:03:39

Is it worth using WebSocket in this implementation?

Good time!
The task was to implement the following functionality: it is necessary that when a user enters a certain page, it is blocked for others. In the current implementation, I use a server raised on AIOHTTP and communicate with the frontend via WebSocket. You also need to check if the user performs any actions, if not for a while, then the page is released for other users. Used pages are stored in the MongoDB database.
The question is, is the chosen architecture the right one? Can it be simplified somehow? Are WebSockets really necessary here?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-01-10
@bacon

In addition to the fact that the client itself transmits information to the server, WebSocket allows the server to interrogate a specific client and inform other clients that the page is blocked / unblocked. Otherwise, all clients themselves must periodically poll the server about the state of the pages, which increases the load and delays in obtaining this information.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question