reuse asyncio code in the threaded worker