jeudi 18 juin 2015

Is there a pattern for pipelining and canceling actions in single page applicaitons?

The context is MVC5-Javascript-SPA application.

The case is - The user clicks here and there and generates requests. But in the mean time he decides to go to another area of the app and initiates some more clicks with requests, "discarding" the first batch of requests.

The problem is : There are two batches of requests generated by the user for both of the app areas the user visited. The first batch of requests are in vain because even the server brings back the result the front-end no longer cares.

The desired result is an application structure that can pipeline the requests by app area and if the user switches to another area then the app can send 'cancellation token' to the back end so it wastes no more time executing the requests which result will no longer be needed by the user.

Is there a well known pattern for this problem or a Javascript SPA framework built with that feature in mind?

Aucun commentaire:

Enregistrer un commentaire