# ActionWrapper

interface ActionWrapper (source)

Realizations should wrap the work with some conditions like retries on exceptions, calling timeout, etc.

#### See also

Timeouted
Direct

#### Inheritors

Timeouted
Direct

## Types

Direct
Link copied to clipboard
object Direct : ActionWrapper

It is passthrough variant of ActionWrapper which will just call incoming block with wrapping into runCatchingSafely

Timeouted
Link copied to clipboard
class Timeouted (timeoutMillis: Long ) : ActionWrapper

This type of ActionWrappers will use withTimeout and if original call will not return anything in that timeout just return Result with failure

## Functions

wrap
Link copied to clipboard
abstract suspend fun < T > wrap (block: suspend () -> T ): Result < T >

Should execute block to take the result T, but may return failure in case when something went wrong. This method should never throw any Exception