Registers a coroutine function with the standard __aexit__ method signature. Can suppress exceptions the same way __aexit__ method can. Also accepts any object with an __aexit__ method (registering a call to the method instead of the object itself).
(self, exit)
| 665 | return result |
| 666 | |
| 667 | def push_async_exit(self, exit): |
| 668 | """Registers a coroutine function with the standard __aexit__ method |
| 669 | signature. |
| 670 | |
| 671 | Can suppress exceptions the same way __aexit__ method can. |
| 672 | Also accepts any object with an __aexit__ method (registering a call |
| 673 | to the method instead of the object itself). |
| 674 | """ |
| 675 | exit_method = _lookup_special(exit, '__aexit__', exit) |
| 676 | self._push_exit_callback(exit_method, False) |
| 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. |