Advertisement
Guest User

Untitled

a guest
Jul 25th, 2020
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. imprort Liba
  2.  
  3. class Bla:
  4.     def __init__(self):
  5.         self.loop = None
  6.  
  7.     def foo(self):
  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())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement