Service Return

1

I have the following problem, I make an ajax call to my service and it returns me a paged list everything ok .. And I have a button where I download it to excel, only because it is a very heavy table and I can not paginate it in Excel, I just have the time out error in the return of my ajax call.

I've heard of a stop that you make the call and while the service is processed I have another service asking if it's finished and when it finishes it returns to the client but I have no idea of the name of that call or if there is any way better to accomplish this ..

Can anyone help me please?

    
asked by anonymous 16.05.2017 / 16:05

1 answer

0

There are several ways to implement such a mechanism, called an asynchronous process , where processing a heavy task occurs in parallel with the original request. A default flow could be described as follows:

  • The T1 task is requested by the C1 client.
  • The server initializes a thread in background where the task starts executing. It assigns an ID to this process - for example, ID1 .
  • The server returns the process ID to the client, allowing it to continue to be used by the user.
  • From time to time the client asks the server what the execution status of the ID1 task is; the return can be, for example, 'canceled', 'running' or 'terminated'.
  • If completed, the server can return the content generated by processing in background .
16.05.2017 / 16:22