Skip to content

v1.0.3

Latest
Compare
Choose a tag to compare
@northpowered northpowered released this 14 Nov 07:33
338f46c

Added add_async_runtime method for appending corutines, wrapped in asyncio.run()

Example:

class TestAsyncRuntime:
    """
        Class must implement `run` method
    """
    async def _test_async_runtime(self):
        while True:
            print(random.random())
            await asyncio.sleep(1)
    def run(self):
        asyncio.run(self._test_async_runtime())

app.add_async_runtime("test_async", runtime=TestAsyncRuntime())