forked from goodboy/tractor
Facepalm, don't pass in unecessary cancel scope
parent
65c5d7da4e
commit
f23b5b89dd
|
@ -136,7 +136,7 @@ class ScopePerTaskNursery(Struct):
|
||||||
else:
|
else:
|
||||||
# NOTE: what do we enforce as a signature for the
|
# NOTE: what do we enforce as a signature for the
|
||||||
# `@task_scope_manager` here?
|
# `@task_scope_manager` here?
|
||||||
mngr = sm(nursery=n, scope=cs)
|
mngr = sm(nursery=n)
|
||||||
|
|
||||||
async def _start_wrapped_in_scope(
|
async def _start_wrapped_in_scope(
|
||||||
task_status: TaskStatus[
|
task_status: TaskStatus[
|
||||||
|
@ -213,11 +213,9 @@ class ScopePerTaskNursery(Struct):
|
||||||
# @trio.task_scope_manager
|
# @trio.task_scope_manager
|
||||||
def add_task_handle_and_crash_handling(
|
def add_task_handle_and_crash_handling(
|
||||||
nursery: Nursery,
|
nursery: Nursery,
|
||||||
scope: CancelScope,
|
|
||||||
|
|
||||||
) -> Generator[None, list[Any]]:
|
) -> Generator[None, list[Any]]:
|
||||||
|
|
||||||
cs: CancelScope = CancelScope()
|
|
||||||
task_outcome = TaskOutcome()
|
task_outcome = TaskOutcome()
|
||||||
|
|
||||||
# if you need it you can ask trio for the task obj
|
# if you need it you can ask trio for the task obj
|
||||||
|
@ -226,7 +224,7 @@ def add_task_handle_and_crash_handling(
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# yields back when task is terminated, cancelled, returns?
|
# yields back when task is terminated, cancelled, returns?
|
||||||
with cs:
|
with CancelScope() as cs:
|
||||||
|
|
||||||
# the yielded value(s) here are what are returned to the
|
# the yielded value(s) here are what are returned to the
|
||||||
# nursery's `.start_soon()` caller B)
|
# nursery's `.start_soon()` caller B)
|
||||||
|
|
Loading…
Reference in New Issue