Skip to content

bloqade.task.BatchFuture

← Module overview

classBatchFuturesource

bloqade.task.BatchFuture

Bases: abc.ABC, Generic[RetType]

Protocol for future objects that can be awaited.

class BatchFuture

Attributes

NameTypeDefaultDescription
MISSING_RESULT—Literal[None]

methodresultsource

bloqade.task.BatchFuture.result

def result(timeout: float | None) -> list[RetType]

Returns the result of the future, blocking until it is available or the timeout expires.

Parameters

NameTypeDescription
timeoutfloat | None

Returns

list[RetType]

source

methodpartial_resultsource

bloqade.task.BatchFuture.partial_result

def partial_result() -> list[RetType | MISSING_RESULT]

Return all results that are available so far, or MISSING_RESULT for those that are not yet available.

Returns

list[RetType | MISSING_RESULT]

source

methodfetchsource

bloqade.task.BatchFuture.fetch

def fetch() -> None

Fetches the result of the future that are currently available.

source

methodcancelsource

bloqade.task.BatchFuture.cancel

def cancel()

Attempts to cancel the execution of the future.

source

methodcancelledsource

bloqade.task.BatchFuture.cancelled

def cancelled() -> bool

Returns True if the future was cancelled, False otherwise.

Returns

bool

source

methoddonesource

bloqade.task.BatchFuture.done

def done() -> bool

Returns

bool

source