Registers an arbitrary coroutine function and arguments. Cannot suppress exceptions.
(self, callback, /, *args, **kwds)
| 677 | return exit # Allow use as a decorator |
| 678 | |
| 679 | def push_async_callback(self, callback, /, *args, **kwds): |
| 680 | """Registers an arbitrary coroutine function and arguments. |
| 681 | |
| 682 | Cannot suppress exceptions. |
| 683 | """ |
| 684 | _exit_wrapper = self._create_async_cb_wrapper(callback, *args, **kwds) |
| 685 | |
| 686 | # We changed the signature, so using @wraps is not appropriate, but |
| 687 | # setting __wrapped__ may still help with introspection. |
| 688 | _exit_wrapper.__wrapped__ = callback |
| 689 | self._push_exit_callback(_exit_wrapper, False) |
| 690 | return callback # Allow use as a decorator |
| 691 | |
| 692 | async def aclose(self): |
| 693 | """Immediately unwind the context stack.""" |