Skip to content
Snippets Groups Projects
Commit 0fa9e298 authored by jkerdreu's avatar jkerdreu
Browse files

Initial release..



git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@2586 b32b6428-25c9-4566-ad07-03861ab6144f
parent fca2ed88
No related branches found
No related tags found
No related merge requests found
from .core import Engine as CoreEngine
import functools
import asyncio
"""
The current xAAL Lib doesn't support asyncio. A full rewrite of Engine and NetworkConnector is needed.
The module provide an temporary hack to warps the Engine mainloop (run() function) in an asyncio loop.
Use this module as temporary fix only.
"""
def spawn(func):
@functools.wraps(func)
def spawn_future(*args,**kwargs):
print(f"Calling {func.__name__}")
asyncio.ensure_future(func(*args,**kwargs))
return spawn_future
class Engine(CoreEngine):
async def run(self):
self.start()
self.running = True
while self.running:
self.loop()
await asyncio.sleep(0)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment