denosaurs / denosaurs/deno_python
Synchronous Python & async JavaScript?
- Dominant language
- TypeScript
- Stars
- 762
- Forks
- 26
- PR merge metrics
- No merged PRs in 30d
Description
In contrast to most JavaScript code, Python libraries often work synchronously and may even expect one's callback function to resolve synchronously, even if that doesn't make sense in JavaScript environment. One example might be the [`audible`](https://audible.readthedocs.io/en/latest/index.html) Python package that performs all HTTP requests synchronously and expects a [synchronous callback to show an image to the user and get their response](https://audible.readthedocs.io/en/latest/auth/authorization.html#authorization).
I have no experience with Deno's FFI yet, but it seems to me that calling synchronous Python functions asynchronously should be possible, as the Python interpreter runs in a different thread. Similarly, I would expect "converting" asynchronous JS functions to synchronous Python callbacks should be possible, if one blocks the Python interpreter until the JS promise is settled.
Is this something that sounds viable to you? And if so, is this something you'd be interested in adding to this library?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.