TDAsyncIO.tox is a Component for using the asyncio module in TouchDesigner without blocking the TD's main thread by running the event loop only once after every frame.
- Active - The Event Loop can run asynchronous tasks while 'Active' is enabled
- Cancel All Tasks - Cancel all tasks you created.
import asyncio
async def test():
await asyncio.sleep(3)
print('hello world')
# Run coroutine
coroutines = [test()]
op.TDAsyncIO.Run(coroutines)
# Cancel all tasks
op.TDAsyncIO.Cancel()