forked from goodboy/tractor
Pop context on `.open_context()` exit
parent
f3432bd8fb
commit
4ea5c9b5db
|
@ -395,12 +395,14 @@ class Portal:
|
|||
__tracebackhide__ = True
|
||||
|
||||
fn_mod_path, fn_name = func_deats(func)
|
||||
|
||||
ctx = await self.actor.start_remote_task(
|
||||
self.channel,
|
||||
fn_mod_path,
|
||||
fn_name,
|
||||
kwargs
|
||||
)
|
||||
|
||||
assert ctx._remote_func_type == 'context'
|
||||
msg = await ctx._recv_chan.receive()
|
||||
|
||||
|
@ -497,6 +499,9 @@ class Portal:
|
|||
f'value from callee `{result}`'
|
||||
)
|
||||
|
||||
# remove the context from runtime tracking
|
||||
self.actor._contexts.pop((self.channel.uid, ctx.cid))
|
||||
|
||||
|
||||
@dataclass
|
||||
class LocalPortal:
|
||||
|
|
Loading…
Reference in New Issue