Skip to content

RequestLike

Base classes

Name Children Inherits
Protocol
typing
Base class for protocol classes.

⋔ Inheritance diagram

graph TD
  887473007["protocols.RequestLike"]
  1073422405["typing.Protocol"]
  3481597255["typing.Generic"]
  2751680898["builtins.object"]
  1073422405 --> 887473007
  3481597255 --> 1073422405
  2751680898 --> 3481597255

🛈 DocStrings

Bases: Protocol

A cancellable asynchronous computation (datacook.engine.Request).

Source code in src/datacook/app/protocols.py
class RequestLike(Protocol):
    """A cancellable asynchronous computation (`datacook.engine.Request`)."""

    @property
    def node_id(self) -> str | None: ...

    @property
    def generation(self) -> int | None: ...

    @property
    def cancelled(self) -> bool: ...

    def cancel(self) -> None: ...

    def done(self) -> bool: ...

    def result(self, timeout: float | None = None) -> Frame: ...

    def is_stale(self) -> bool: ...

    def add_done_callback(self, fn: Callable[[Any], Any]) -> None: ...

:fa-brands-github: Show source on GitHub