Skip to content

Commit

Permalink
Tweak doc string
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Apr 14, 2023
1 parent c7b56ae commit ae1fa4c
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions tractor/_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,25 @@
@dataclass
class Context:
'''
An inter-actor, ``trio`` task communication context.
An inter-actor, ``trio``-task communication context.
NB: This class should never be instatiated directly, it is delivered
by either,
- runtime machinery to a remotely started task or,
- by entering ``Portal.open_context()``.
and is always constructed using ``mkt_context()``.
Allows maintaining task or protocol specific state between
2 communicating actor tasks. A unique context is created on the
callee side/end for every request to a remote actor from a portal.
2 communicating, parallel executing actor tasks. A unique context is
allocated on each side of any task RPC-linked msg dialog, for
every request to a remote actor from a portal. On the "callee"
side a context is always allocated inside ``._runtime._invoke()``.
A context can be cancelled and (possibly eventually restarted) from
either side of the underlying IPC channel, open task oriented
message streams and acts as an IPC aware inter-actor-task cancel
scope.
either side of the underlying IPC channel, it can also open task
oriented message streams, and acts more or less as an IPC aware
inter-actor-task ``trio.CancelScope``.
'''
chan: Channel
Expand Down Expand Up @@ -744,7 +748,7 @@ def mk_context(
_recv_chan=recv_chan,
**kwargs,
)
ctx._result = id(ctx)
ctx._result: int | Any = id(ctx)
return ctx


Expand Down

0 comments on commit ae1fa4c

Please sign in to comment.