1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Understanding callbacks and SOAP requests
This guide details some background operations performed by the VOD / AOD service from Infomaniak.
Operation of SOAP requests and callbacks
In the VOD (video on demand) and AOD (audio on demand) service, some operations such as file downloads go through SOAP requests, a protocol that allows two systems to communicate with each other, often used to exchange data between servers.
When a file is requested via SOAP, there may be a delay before the server responds. This delay depends on several factors, such as the file size, the server load, or the connection quality. The download starts as soon as possible, but it is important to know that there is a queue: if several users make requests at the same time, each one is processed in order, and each user has a limit on simultaneous downloads.
Callback: a notification at the end of the download
A callback is a system that notifies the client (for example, your application) once the download is complete. In other words, instead of waiting while monitoring the download, the system "calls" you or sends a response when everything is ready. This is useful to avoid blocking your application while the file is downloading.
However, there is also a maximum wait time, called a timeout. If this time is reached before the end of the download, a response is still sent. This does not mean that the download has failed, but that the response was given before it was completed. In this case, the processing continues in the background.
Large files take more time
When the requested file is large (for example, several hundred megabytes or even several gigabytes), the download can take several minutes. This time depends a lot on the remote server: some are very fast, others less so. The system tries to manage this as best as possible, but it is important to keep in mind that the response time will not always be immediate.
Blocking and non-blocking calls
By default, some SOAP clients wait for the server to finish responding before continuing. This is called a blocking call : your application is frozen until the response arrives. This can be a problem if the response takes time.
Fortunately, it is often possible to configure the SOAP client so that it does not block. This is called a non-blocking call. This allows sending multiple requests one after the other without having to wait for the response of each call. It is faster and more efficient, especially when processing multiple files in succession.