IpcCommandExecutor

An executor for 1 specific IpcCommandExecutor.commandTypeId.

Its implementations must be put into the app Koin dependencies graph and bound to IpcCommandExecutor, for example:

    factory {
MyCustomCommand()
} bind IpcCommandExecutor::class

Please note: this class must be thread-safe, because its instances will be touched from unpredictable number of background threads.

Types

Link copied to clipboard
class ExecutionException(val errorCode: String, message: String, cause: Throwable? = null, val extras: Bundle? = Bundle()) : Exception

Properties

Link copied to clipboard
abstract val commandTypeId: String

A unique identifier of this command. Please append an app-specific prefix to each of your commands so that their names would not clash with the built-it UXF commands.

Functions

Link copied to clipboard
abstract suspend fun execute(args: Bundle): Result<Bundle>

Function that must execute a command of the commandTypeId. Should return ExecutionException if the command cannot be executed for some reason.