1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Understand callbacks and SOAP requests
This guide details some background operations performed by the VOD / AOD service.
How SOAP requests and callbacks work
In the VOD (video on demand) and AOD (audio on demand) service, certain 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, server load, or 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 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 allows to notify the client (for example, your application) once the download is complete. In other words, instead of waiting and 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 timeoutIf this delay is reached before the download is complete, 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 greatly 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 known as a blocking call : your application is frozen until the response arrives. This can be problematic if the response takes time.
Fortunately, it is often possible to configure the SOAP client so that it does not block. This is then called a non-blocking callThis allows you to send multiple requests one after the other without having to wait for a response to each call. It is faster and more efficient, especially when you are processing multiple files in succession.