A reply with the services its schemas need and its RPC.
Attributes#
| Attribute | Type | Description |
|---|---|---|
reply | Reply[A_co, E_co] | |
context | Context[Any] = field(default_factory=(Context.empty)) | |
rpc | AnyRpc = _never_rpc |
Functions#
__init__#
__init__(reply, context=Context.empty(), rpc=_never_rpc) -> None| Parameter | Type | Description |
|---|---|---|
reply | Reply[A_co, E_co] | |
context | Context[Any] = Context.empty() | |
rpc | AnyRpc = _never_rpc |
from_defect#
from_defect(*, id, request_id, defect) -> ReplyWithContextA reply ending request_id with defect, kept as what a
defect schema reads back, so it always encodes. A str is stored
as a JSON string, as Effect stores a string defect.
| Parameter | Type | Description |
|---|---|---|
id | Snowflake | |
request_id | Snowflake | |
defect | BaseException | str |
Returns ReplyWithContext
@staticmethod
def from_defect(
*, id: Snowflake, request_id: Snowflake, defect: BaseException | str
) -> ReplyWithContext:
"""A reply ending ``request_id`` with ``defect``, kept as what a
defect schema reads back, so it always encodes. A ``str`` is stored
as a JSON string, as Effect stores a string defect."""
return ReplyWithContext(
WithExit(request_id=request_id, id=id, exit=exit_.die(_portable_defect(defect))),
)interrupt#
interrupt(*, id, request_id) -> ReplyWithContext| Parameter | Type | Description |
|---|---|---|
id | Snowflake | |
request_id | Snowflake |
Returns ReplyWithContext
@staticmethod
def interrupt(*, id: Snowflake, request_id: Snowflake) -> ReplyWithContext:
return ReplyWithContext(
WithExit(request_id=request_id, id=id, exit=exit_.interrupt(None)),
)