Coroutine Scope Owner
This interface gives your class ability to execute UseCase and FlowUseCase Coroutine use cases. You may find handy to implement this interface in custom Presenters, ViewHolders etc. It is your responsibility to cancel coroutineScope when when all running tasks should be stopped.
Types
Holds references to lambdas and some basic configuration used to process results of Flow use case. Use FlowUseCaseConfig.Builder to construct this object.
Holds references to lambdas and some basic configuration used to process results of Coroutine use case. Use UseCaseConfig.Builder to construct this object.
Functions
This method is called when coroutine launched with launchWithHandler throws an exception and this exception isn't CancellationException. By default, it rethrows this exception.
Synchronously executes use case and saves it's Deferred. By default all previous pending executions are canceled, this can be changed by the cancelPrevious. This version is used for use cases without initial arguments.
Asynchronously executes use case and saves it's Deferred. By default all previous pending executions are canceled, this can be changed by the config. This version is used for use cases without initial arguments.
Asynchronously executes use case and consumes data from flow on UI thread. By default all previous pending executions are canceled, this can be changed by config. When suspend function in use case finishes, onComplete is called on UI thread. This version is gets initial arguments by args.
Synchronously executes use case and saves it's Deferred. By default all previous pending executions are canceled, this can be changed by the cancelPrevious. This version gets initial arguments by args.
Provides Dispatcher for background tasks. This may be overridden for testing purposes
Launch suspend block in coroutineScope. Encapsulates this call with try catch block and when an exception is thrown then it is logged in UseCaseErrorHandler.globalOnErrorLogger and handled by defaultErrorHandler.