SHOW:
|
|
- or go back to the newest paste.
| 1 | imprort Liba | |
| 2 | ||
| 3 | class Bla: | |
| 4 | - | def foo(): |
| 4 | + | def __init__(self): |
| 5 | self.loop = None | |
| 6 | ||
| 7 | - | async def bar(): |
| 7 | + | def foo(self): |
| 8 | - | # эту надо вызывать |
| 8 | + | |
| 9 | asyncio.gather(self.bar()) | |
| 10 | ||
| 11 | async def bar(self): | |
| 12 | # тут всякая магия творится | |
| 13 | pass | |
| 14 | ||
| 15 | async def main(): | |
| 16 | bla = Bla() | |
| 17 | bla.loop = asyncio.get_running_loop() | |
| 18 | liba = Liba() | |
| 19 | liba.dosomeshit(callback=bla.foo) | |
| 20 | ||
| 21 | ||
| 22 | asyncio.run(main()) |