MCPcopy Index your code
hub / github.com/MagicStack/asyncpg / from_callable

Method from_callable

asyncpg/connection.py:2627–2638  ·  view source on GitHub ↗
(cls, cb: typing.Callable[..., None])

Source from the content-addressed store, hash-verified

2625
2626 @classmethod
2627 def from_callable(cls, cb: typing.Callable[..., None]) -> '_Callback':
2628 if inspect.iscoroutinefunction(cb):
2629 is_async = True
2630 elif callable(cb):
2631 is_async = False
2632 else:
2633 raise exceptions.InterfaceError(
2634 'expected a callable or an `async def` function,'
2635 'got {!r}'.format(cb)
2636 )
2637
2638 return cls(cb, is_async)
2639
2640
2641class _Atomic:

Callers 8

add_listenerMethod · 0.80
remove_listenerMethod · 0.80
add_log_listenerMethod · 0.80
remove_log_listenerMethod · 0.80
add_query_loggerMethod · 0.80
remove_query_loggerMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected