format.coroutine {async}R Documentation

Query / display coroutine properties and state.

Description

The coroutine format method displays its source code, its effective environment, whether it is running or finished, and a label indicating its last known state. The summary method returns the same information in a list.

summary(obj) returns a list with information on a coroutine's state, including:

summary(g)$state for a generator g might be "yielded", "running" (if nextElem is currently being called,) "stopped" (for generators that have stopped with an error,) or "finished" (for generators that have finished normally.)

summary(a)$state of an async might be "pending", "resolved" or "rejected".

summary(s)$state on a stream might be "resolved", "rejected", "running", "woken", "yielding", or "yielded".

Usage

## S3 method for class 'coroutine'
format(x, ...)

## S3 method for class 'coroutine'
summary(object, ...)

## S3 method for class 'generator'
summary(object, ...)

## S3 method for class 'async'
summary(object, ...)

## S3 method for class 'stream'
summary(object, ...)

Arguments

x

A coroutine.

...

Undocumented.

object

a coroutine (async, generator, or stream) object.


[Package async version 0.3.2 Index]