CommandService.pushAsyncContext Method

Register a deferred as the context of the command service, so that sub-sequent queued commands will execute right away without waiting on the deferred provided.
 

Parameters

deferred
 

Remarks

Normally, this commandService will wait for an async command to be completed before allowing the next async command to be executed. But In cases where a master async command will spawn and depend on child async commands, the child async commands need to be executed first. One can use this method to register a command context, so that the child commands will always execute and then the master command will complete safely, and when that is done, the async context is reset. There shouldn't be any other command to be executed that is out of the context of the pushed async context. Command service does not prevent async command that is not the same context of the pushed async context to be executed.