TouchDesigner-asyncio

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.

Usage

Parameters

  • Active - The Event Loop can run asynchronous tasks while 'Active' is enabled
  • Cancel All Tasks - Cancel all tasks you created.

Parameters

Code example

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()

License

MIT