AsyncLupa integrates with the well known Lupa library, providing an asynchronous wrapper allowing async function / method calls right from Lua.
Installation
pip install AsyncLupa
If you want the latest version that has not yet been released
pip install git+https://github.com/SoulSen/AsyncLupa
Calling Async functions in Lua
AsyncLupa support all Lupa’s methods that execute Lua code in any way. It includes AsyncLupa.execute, AsyncLupa.eval, and AsyncLupa.compile, it also supports all the other methods also.
An example is shown below
from asynclupa import AsyncLuaRuntime
import asyncio
async def hello():
return 1
async def main():
async_lua = AsyncLuaRuntime()
async_lua.globals()['hello'] = hello
ret = await async_lua.eval('return python.coroutine(hello())')
print(ret) # Outputs 1
asyncio.run(eval_lua(lua_code))
Metadata
Release files for AsyncLupa 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| AsyncLupa-1.0b.tar.gz | 2.6 kB | Details |
Release files / AsyncLupa-1.0b.tar.gz
| Download URL | AsyncLupa-1.0b.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee6af0ecdcb13254a47e29cb83b1708de759cb8d6fe425164fcd0fb9836a2244
|
|
BLAKE2b-256 checksum How to use checksums |
009ec4266dd88cb4221dce9a1358948ecfb20e0375b772191c1c135d160e96c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.1
|