Skip to content

Commit

Permalink
remove deprecated configuration function
Browse files Browse the repository at this point in the history
  • Loading branch information
richardsheridan committed Oct 20, 2024
1 parent 4fea5fa commit bd1649e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
1 change: 0 additions & 1 deletion trio_parallel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
WorkerType,
current_default_worker_limiter,
configure_default_context,
atexit_shutdown_grace_period,
default_context_statistics,
)
from ._abc import BrokenWorkerError
Expand Down
30 changes: 0 additions & 30 deletions trio_parallel/_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,36 +376,6 @@ async def open_worker_context(
await ctx._aclose() # noqa: ASYNC102


def atexit_shutdown_grace_period(
grace_period=DEFAULT_CONTEXT.grace_period,
): # pragma: no cover, deprecated
"""Set the default worker cache shutdown grace period.
DEPRECATION NOTICE: this function has been superseded by
`configure_default_context` and will be removed in a future version
You might need this if you have a long-running `atexit` function, such as those
installed by ``coverage.py`` or ``viztracer``.
This only affects the `atexit` behavior of the default context corresponding to
:func:`trio_parallel.run_sync`. Existing and future `WorkerContext` instances
are unaffected.
Args:
grace_period (float): The time in seconds to wait for workers to
exit before issuing SIGKILL/TerminateProcess and raising `BrokenWorkerError`.
Pass `math.inf` to wait forever.
"""
import warnings

warnings.warn(
DeprecationWarning(
"Superseded by `configure_default_context` "
"and will be removed in a future version"
)
)
configure_default_context(grace_period=grace_period)


async def run_sync(
sync_fn: Callable[..., T],
*args,
Expand Down

0 comments on commit bd1649e

Please sign in to comment.