Fetcher
Manager
Deprecated
This class will be moved in the equinox-core module in the next version
The FetcherManager class is useful to manage the requests to the backend executing these requests with a CoroutineScope so to execute in background and not working in the main UI thread
Author
N7ghtm4r3 - Tecknobit
Parameters
: the coroutine used to execute the refresh routines
Types
The FetcherManagerWrapper interface is useful for wrapping and facilitating operation with the FetcherManager, so the inheriting classes will invoke just the wrapper methods for a clean readability of the code, for example:
The GenericFetcher interface is useful to manage the requests to refresh a list of items and a single item
The ItemFetcher interface is useful to manage the requests to refresh a single item
The ListFetcher interface is useful to manage the requests to refresh a list of items
Properties
isRefreshing -> whether the refreshRoutine is already refreshing
Functions
Method to get whether the refreshRoutine can start, so if there aren't other jobs that routine is already executing
Method to check if the refreshRoutine can continue to refresh or need to be stopped, this for example when the UI displayed changes and the requests to refresh the UI data also changes
Method to restart the current refreshRoutine after other requests has been executed, the isRefreshing instance will be set as true to deny the restart of the routine after executing the other requests
Method to suspend the current refreshRoutine to execute other requests to the backend, the isRefreshing instance will be set as false to allow the restart of the routine after executing the other requests