withCancel


Description:

public static Result<Context,Error> withCancel (Context parent)

Creates child context that can be cancelled explicitly.

Parameters:

parent

parent context.

Returns:

Result.ok(cancellable child context), or Result.error(ContextError.INVALID_ARGUMENT) when parent is null.