IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo struct

CpAsyncGroups

struct CpAsyncGroups

cp.async groups: issues join the open group, commit closes it with cp.async.commit_group, and wait is cp.async.wait_group.

Implemented traits​

AnyType, AtomCompletion, BatchCompletion, Deinitable, Movable

comptime members​

max_pending​

comptime max_pending = Int.MAX

Any number of committed groups can stay outstanding.

Result​

comptime Result = NoneType

Nothing: a cp.async returns no handle.

Methods​

open​

static def open()

Does nothing: a group is always open, and issues join it.

commit​

static def commit()

Closes the open group with cp.async.commit_group.

wait​

static def wait[pending: Int = Int(0)]()

Waits with cp.async.wait_group until at most pending committed groups are outstanding.

Parameters:

  • ​pending (Int): The groups that may stay outstanding.

Was this page helpful?