package com.gladed.late

import com.gladed.util.Runner

/** Begin background work on the specified [Runner] */
fun <Result> work(runner: Runner, block: () -> Result) = Late(runner, block)

/** Begin background work on [Late.defaultRunner] */
fun <Result> work(block: () -> Result) = Late(block)

/** Return a [Late] containing a successful result value */
fun <Result> pass(value: Result) = Late.pass(value)

/** Return a [Late] containing an error */
fun <Result> fail(error: Exception) = Late.fail<Result>(error)
