[go: up one dir, main page]

Skip to content

textual.await_complete

This module contains the AwaitComplete class. An AwaitComplete object is returned by methods that do work in the background. You can await this object if you need to know when that work has completed. Or you can ignore it, and Textual will automatically await the work before handling the next message.

Note

You are unlikely to need to explicitly create these objects yourself.

AwaitComplete

AwaitComplete(*awaitables, pre_await=None)

An 'optionally-awaitable' object which runs one or more coroutines (or other awaitables) concurrently.

Parameters:

Name Type Description Default

awaitables

Awaitable

One or more awaitables to run concurrently.

()

exception property

exception

An exception if the awaitables failed.

is_done property

is_done

True if the task has completed.

call_next

call_next(node)

Await after the next message.

Parameters:

Name Type Description Default

node

MessagePump

The node which created the object.

required

nothing classmethod

nothing()

Returns an already completed instance of AwaitComplete.

set_pre_await_callback

set_pre_await_callback(pre_await)

Set a callback to run prior to awaiting.

This is used by Textual, mainly to check for possible deadlocks. You are unlikely to need to call this method in an app.

Parameters:

Name Type Description Default

pre_await

CallbackType | None

A callback.

required