Cancel/Abort queued up server.get requests in ServicePortal

RikV
Tera Expert

Hi All,

 

Is anyone aware of a way function/api/angular provider which can be used to abort all current serviceportal server.get requests that are queued up in the background waiting to be executed?

 

I have a page with several custom service portal widgets that will respond on actions taken within several other widgets on the same page.  (Like when setting a filter, clicking some option etc). After a action has taken, the widget will then broadcast new parameters for the other widgets to work with. So, new data fetching will start by several different widgets after each action taken on the page, which initiates several server.get() requests across the board. However, when the user is clicking around a bit faster everything becomes very unresponsive, and you notice that the widgets are still busy with older (uncompleted) jobs from earlier actions.

 

Is there any specific functionality i could implement which, for example, cancels all earlier/build up requests before making a new one? Or at least some way to see what jobs are currently waiting in the background?

 

I tried:

- Abortcontroller + signal, even though it says it aborted, the queued request still executes blocking new requests.

- $httpProvider and interceptor, cant get it to work. Cant seem to find a way of getting the queue trough it, let alone cancel a waiting transaction.

- $q.defer, same result as abortcontroller

- I dont see using a query to the syslog_transactions/v_transactions as a viable option as this is another server sided request which will then just be added to the existing queue of server requests and performed after the already queued actions, and needs another server request to actually cancel/remove them.

 

So far i only see the option of keeping a client sided-queue myself which evaluates requests and clears out old ones before sending them. But i would be surprised if there is no ootb functionality present to do something similar. 

0 REPLIES 0