R
R
rukid2020-08-25 16:37:54
C++ / C#
rukid, 2020-08-25 16:37:54

How to organize work with web api from queues?

There is a client that requests something from api (http get method). Api, on the other hand, sends a heavy task to the queue, and upon completion of the task, you need to notify the client about the result. How to get delayed response from web api for each client?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Korotenko, 2020-08-25
@firedragon

Let's say you need to encode a file
. The first call to the api is to upload a file and return a job ID. The server starts the task in the background and writes some results, let's say how many frames it rendered and how much time is left and the status of the task.
Your client polls the address every 10 seconds with a request, well, what's there? Gets these 3 metrics.
When the status is ready, it makes a request to the api with the results or to the error controller

R
Roman, 2020-08-25
@yarosroman

SignalR help you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question