-
Notifications
You must be signed in to change notification settings - Fork 4
Internals: Flow
Edison Wang edited this page May 19, 2016
·
2 revisions
-
Request sent to EventService, the service will queue it on the requested Executor.
- During this time, request can be cancelled.
-
Executor executes this the Request.
- During this time, request can no longer be cancelled.
This flow is defined per request.
- If there are any dependencies, execute the dependencies in order.
- if any of them emits a fatal failure, call OnCompletion and terminate with null result.
- If there are any requirements, check the requirements with the results from dependencies.
- if any of the requirements are not satisfied, call OnCompletion and terminate with null result.
- Process the current action. (Generates processed result).
- deliver the result.
- if result is a fatal failure, call OnCompletion and terminate with this result.
- If there are any chained requests, execute them in order.
- if any of them emits a fatal failure, call OnCompletion and terminate with processed result.
- Result will be delivered by the requesting process.
This flow is defined per Action type.
- Call process() and return a result.
- If cache is allowed, return the request from cache.
- A Cache hit is defined by the request argument bundle match perfectly.
- preProcess() happens, it should return null on success, if non-null results returned, it will be treated as an error.
- process() happens and the result will be put in cache.
This technically happens "during" execution.
Events (ActionResult) will be delivered to listeners via EventBus.