Skip to content

Commit 21f1022

Browse files
committed
Remove WrapAsync code
1 parent fdc685c commit 21f1022

File tree

2 files changed

+0
-57
lines changed

2 files changed

+0
-57
lines changed

shiny/_utils.py

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -279,60 +279,6 @@ async def fn_async(*args: P.args, **kwargs: P.kwargs) -> R:
279279
return fn_async
280280

281281

282-
# # TODO-barret-future; Q: Keep code?
283-
# class WrapAsync(Generic[P, R]):
284-
# """
285-
# Make a function asynchronous.
286-
287-
# Parameters
288-
# ----------
289-
# fn
290-
# Function to make asynchronous.
291-
292-
# Returns
293-
# -------
294-
# :
295-
# Asynchronous function (within the `WrapAsync` instance)
296-
# """
297-
298-
# def __init__(self, fn: Callable[P, R] | Callable[P, Awaitable[R]]):
299-
# if isinstance(fn, WrapAsync):
300-
# fn = cast(WrapAsync[P, R], fn)
301-
# return fn
302-
# self._is_async = is_async_callable(fn)
303-
# self._fn = wrap_async(fn)
304-
305-
# async def __call__(self, *args: P.args, **kwargs: P.kwargs) -> R:
306-
# """
307-
# Call the asynchronous function.
308-
# """
309-
# return await self._fn(*args, **kwargs)
310-
311-
# @property
312-
# def is_async(self) -> bool:
313-
# """
314-
# Was the original function asynchronous?
315-
316-
# Returns
317-
# -------
318-
# :
319-
# Whether the original function is asynchronous.
320-
# """
321-
# return self._is_async
322-
323-
# @property
324-
# def fn(self) -> Callable[P, R] | Callable[P, Awaitable[R]]:
325-
# """
326-
# Retrieve the original function
327-
328-
# Returns
329-
# -------
330-
# :
331-
# Original function supplied to the `WrapAsync` constructor.
332-
# """
333-
# return self._fn
334-
335-
336282
# This function should generally be used in this code base instead of
337283
# `iscoroutinefunction()`.
338284
def is_async_callable(

shiny/render/renderer/_renderer.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,6 @@ def _auto_register(self) -> None:
336336
self._auto_registered = True
337337

338338

339-
# Not inheriting from `WrapAsync[[], IT]` as python 3.8 needs typing extensions that
340-
# doesn't support `[]` for a ParamSpec definition. :-( Would be minimal/clean if we
341-
# could do `class AsyncValueFn(WrapAsync[[], IT]):`
342339
class AsyncValueFn(Generic[IT]):
343340
"""
344341
App-supplied output value function which returns type `IT`.

0 commit comments

Comments
 (0)