liblockdc is a C89/C90 client library for lockd, providing persistent state,
ordered collections, leases, queues, attachments, queries, and built-in implicit
XA transactions with coordinated commit, rollback, and recovery. It also
includes Pouch, an embedded storage engine that makes these capabilities
available directly inside your application without a separate lockd server.
It ships static and shared libraries, C++98-compatible public headers, and a Lua facade.
- Built-in implicit XA for state and attachment changes, including recovery.
- Ordered collections with immutable JSON entries, retention, LQL filtering, incremental appends, collection leases, and atomic edits.
- Leased state, queue delivery, attachments, and bounded byte streaming.
- Mapped JSON through lonejson, streamed queries, and managed consumers.
- Durable command receipts, inbox/outbox processing, retries, and dead letters.
- Remote HTTP/1.1, HTTP/2, mTLS, and Unix domain socket transports.
- Optional PostgreSQL participation in the existing XA coordinator.
- C and Lua APIs with integrated libpslog diagnostics.
Collections and transactional messaging currently require Pouch. The managed XA coordinator uses a local Pouch journal; remote lockd participation in that coordinator is unsupported. See the feature guides below for backend limits.
Use a target SDK archive, or build from source:
make build
make testThese commands prepare the native sanitizer build and run its debug tests. Make
provisions the pinned compiler and dependency SDKs. See
development and verification for prerequisites, clangd
setup, optional PostgreSQL builds, and the test layers. make help lists the
available commands.
For local storage, select an absolute endpoint such as
pouch:///var/lib/my-service/lockd-root. Configure it through
lc_pouch_settings or Lua's pouch table.
For Lua installation and usage, see the Lua SDK guide.
| Platform | Architectures | Libraries |
|---|---|---|
| Linux, GNU or musl | x86_64, aarch64, armhf |
Static .a and shared .so |
| macOS, built with osxcross | arm64 |
Static .a and shared .dylib |
Shared GNU SDKs require glibc 2.43 or newer. Core shared-library ABI is 9; the optional PostgreSQL provider ABI is 0. See ABI and storage compatibility and the release notes before upgrading.
| Topic | Guide |
|---|---|
| C handles, ownership, streaming, JSON, allocation tracking | C API and public header |
| Lua API, installation, and embedding | Lua SDK |
| Pouch endpoints, defaults, and configuration | Opening Pouch |
| Persistence, recovery, and compression changes | Pouch storage, compression |
| Ordered journals, selection, and retention | Collections |
| Incremental writes, ownership, and atomic edits | Append writers, leases, edits |
| Per-object expiry | State retention |
| Transactional messaging and dispatch | Inbox/outbox, dispatcher |
| XA coordination and PostgreSQL participation | XA contract, PostgreSQL driver |
| Builds, dependencies, tests, and local services | Development |
| Release preparation and SDK archives | Releases |
| Performance workloads and comparisons | Benchmark guide |
- Client and lease methods
- Callback-style state updates
- Collection journal
- Outbox producer and Lua dispatcher
- Lua examples and setup
The examples are complete programs. The development guide explains how to run the local service environment they use.
See LICENSE.