haproxy-api 0.2.0

HAProxy 2.x Lua API
docs.rs failed to build haproxy-api-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: haproxy-api-0.9.0

haproxy-api

Latest Version API Documentation

haproxy-api exposes HAProxy 2.x Lua API to use from Rust. In conjunction with mlua it allows to run Rust code in HAProxy as a Task/Converter/Fetcher/Service/etc. You can extend HAProxy on a safe and efficient way beyond Lua restrictions.

Thanks to mlua, asynchronous mode is also supported and every time when requested Future is in Pending state, haproxy-api conviniently executes core.yield() under the hood to return to the HAProxy scheduler.

async-std is a recommended executor that can work without explicitly configured Runtime. Bear in mind that asynchronous mode is not too efficient because there is no way to integrate with HAProxy scheduler (current behaviour is more close to busy polling).

Usage

Please check our examples:

Restrictions

Executing HAProxy functions that require yielding is not supported (eg: core.sleep), and these functionality is not exposed. Although you can run them from Lua or using register_lua_* set of functions.

License

This project is licensed under the MIT license