Registers an arbitrary coroutine function and arguments. Cannot suppress exceptions.
(self, callback, /, *args, **kwds)
| 688 | return exit # Allow use as a decorator |
| 689 | |
| 690 | def push_async_callback(self, callback, /, *args, **kwds): |
| 691 | """Registers an arbitrary coroutine function and arguments. |
| 692 | |
| 693 | Cannot suppress exceptions. |
| 694 | """ |
| 695 | _exit_wrapper = self._create_async_cb_wrapper(callback, *args, **kwds) |
| 696 | |
| 697 | # We changed the signature, so using @wraps is not appropriate, but |
| 698 | # setting __wrapped__ may still help with introspection. |
| 699 | _exit_wrapper.__wrapped__ = callback |
| 700 | self._push_exit_callback(_exit_wrapper, False) |
| 701 | return callback # Allow use as a decorator |
| 702 | |
| 703 | async def aclose(self): |
| 704 | """Immediately unwind the context stack.""" |