Are websockets the right technology to use to update progress bars for the client and how do I implement it?

Scenario

I am developing a kind of cloud storage web service.

One of the features is that the user can initiate transcoding of video files (so that they can be transferred across devices).

It takes a while and I want to display a progress bar to the user.

My plan is to submit the job using ajax where it is written to the database. The Ajax call will return the job ID in the database and this ID will be used as a channel for notifications.

So when the job is submitted, the client subscribes to the "job-databaseID" channel on some native websocket server.

The Transcoding staff then periodically fetch pending jobs from the database table and process them. During processing, they push their progress to the websocket server on the same channel where the client is listening.

The external application must be a website with javascript and jquery. The back must be programmed in PHP and MySQL and apache or nginx webserver.

Question

Is this the correct way to use web maps? I usually see websites being used in a notification script in many ways . Here it is a one-to-one notification script . Are there alternatives in the world for one-way information flow?

Also, I often see that pipes for Websocket scripts are more or less durable . Here it is very short-lived . Would it make more sense for maby to make one feed for each user?

What would be a good web server for this kind of use? Ideally, the channels will be automatically deleted as soon as the client is not connected to it anymore and are automatically created in the same way, so I don't need to do this.

+3


source to share


1 answer


You have looked at Server Sent Events as you initiate your request via ajax so that you are not doing bi-directional communication; you only want the server to push you updates when it has



+7


source







All Articles