Skip to main content

A async wrapper for Lupa

Project description

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

Project details


Release history Release notifications

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for AsyncLupa, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size AsyncLupa-1.0b.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page