Skip to main content

kollabor-rpc

kollabor-rpc is the lightweight RPC transport foundation for Kollabor daemon and attach-mode state access.

It provides request/response models, error types, a method-dispatch server, a client, and Unix-socket transport helpers. The current package is intentionally small and stdlib-only.

Current Role

  • Represent RPC requests and responses with stable IDs.
  • Dispatch named methods to async handlers.
  • Provide client helpers for request/response calls.
  • Wrap common RPC errors such as timeout, missing method, and handler failure.
  • Provide Unix socket connection helpers with a larger buffer limit.

Architecture

Module Responsibility
models.py RpcRequest, RpcResponse, request ID helpers
errors.py RPC exception hierarchy
server.py handler registration and dispatch
client.py request client abstraction
transport.py Unix transport helpers and buffer settings

Usage

from kollabor_rpc import RpcServer

server = RpcServer()


async def ping(params):
    return {"ok": True, "echo": params.get("echo")}


server.register("ping", ping)
reply = await server.handle_wire({
    "request_id": "req_1",
    "method": "ping",
    "params": {"echo": "hello"},
})

Known Gaps

  • This package is still a transport foundation; higher-level StateService method contracts live outside the package.
  • Wire-format compatibility should be documented alongside the hub/attach socket protocol.
  • Current tests focus on integration through hub sockets; package-local unit coverage should grow as the API stabilizes.

Roadmap

Phase 1: Contract docs

  • Document the exact frame format used by attach clients and hub sockets.
  • Add examples for both direct dispatch and socket-backed clients.
  • Clarify which errors are transport failures versus handler failures.

Phase 2: StateService integration

  • Keep RPC generic, but document the StateService method namespace that uses it.
  • Add contract tests for high-value state methods.
  • Add compatibility checks for attached streaming and request/reply flows.

Phase 3: Operational hardening

  • Add timeout/cancellation guidance for callers.
  • Improve observability for slow handlers and failed frames.
  • Keep the package stdlib-only unless a transport dependency becomes essential.

Development

Targeted validation examples:

python -m py_compile packages/kollabor-rpc/src/kollabor_rpc/*.py
python -m pytest tests/test_hub_rpc_integration.py -q

Dependencies

None. This package is intentionally stdlib-only.

License

MIT

Download files

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

Source Distribution

kollabor_rpc-0.5.23.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kollabor_rpc-0.5.23-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file kollabor_rpc-0.5.23.tar.gz.

File metadata

  • Download URL: kollabor_rpc-0.5.23.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for kollabor_rpc-0.5.23.tar.gz
Algorithm Hash digest
SHA256 06a10d3e94d751a2732c0bd50b2c6fa63a9ee58bfba1039a80f236737dabdc53
MD5 a009021db903d0bd5c8e2248af06b81e
BLAKE2b-256 2df2307242c6c890353ddbeb0b49664081f106d5bff3bf4c50cd2f23e491288a

See more details on using hashes here.

File details

Details for the file kollabor_rpc-0.5.23-py3-none-any.whl.

File metadata

  • Download URL: kollabor_rpc-0.5.23-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for kollabor_rpc-0.5.23-py3-none-any.whl
Algorithm Hash digest
SHA256 47e5e3a6971a8af5cca80e82b8d54ac00f894e0118748f22d37f72bbf5cb93d5
MD5 79cf5fc3ad9198c94c40e61bee60d247
BLAKE2b-256 e7e5a1604172712f1f867b51edef94a56a78fe16522f5d2168e06f1616eb3a07

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.1

2 files

1.0.0

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.1

2 files

0.6.0

2 files

0.5.24

2 files

This release

0.5.23 This release

2 files

0.5.22

2 files

0.5.20

2 files

0.5.19

2 files

0.5.18

2 files

0.5.16

2 files

0.5.15

2 files

0.5.14

2 files

0.5.13

2 files

0.5.12

2 files

0.5.11

2 files

0.5.8

2 files

0.5.7

2 files

0.5.5

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page