Lightning Component Action Service uses a "boxcar" pattern to bundle server-side action requests into a single call, executes them all on the server, provides a bundled response and then the framework deconstructs the response on the client. Awesome! This reduces the number of requests and is ideal in most cases.
Occasionally, there are use cases where a small request and a large request are both enqueued and bundled together and the small request has to "wait" for the large request to finish. Or a bunch of larger actions might want to be "lazy loaded" in a feed (images or document bodies or something). I'd like to see file1
load, then file2
load, then file3
come in in succession. Instead, I see (long wait 10s), then file1
2
and 3
all come in at once.
As a developer, I need to be able to control this behavior and separate the server actions to provide a responsive user experience.
Peter Chittum discusses "Exclusive Actions" here http://pchittum.com/2015/04/28/Lightning-Component-Exclusive-Actions/
But the setExclusive
method seems to now be deprecated
https://github.com/forcedotcom/aura/blob/65ebdaca6501972ea621f193d1284ec14b848e03/aura-impl/src/main/resources/aura/controller/Action.js#L1078
Additionally, setting setBackground
to true when enqueueing the action doesn't seem to help either (specifically in the lazy load use case). It still holds to the wait-10-seconds, then all 3 files are displayed pattern.
I am not able to find any write-ups or documentation on the deprecation or alternatives for Exclusive Actions. Are there alternatives to Exclusive actions and/or a method for a developer to explicitly separate server-side actions?
Thanks.