Closed desertkun closed 6 years ago
So async/await can be handled by python and used in asynchronous frameworks.
async
await
async function test() { await sleep(..) return 5; }
When async function is called, Javascript returns Promise. This commit adds a way to detect one reliably:
Promise
from v8py import JSPromise result = context.glob.test() if isinstance(result, JSPromise): pass # this function is async, handle it async-way
async is the FUTURE!
(maybe)
So
async
/await
can be handled by python and used in asynchronous frameworks.When
async
function is called, Javascript returnsPromise
. This commit adds a way to detect one reliably: