Skip to main content

Unix domain socket unicast transport for Swarmauri.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_transport_uds_unicast Discord

Swarmauri UDS Unicast Transport

Transport Icon Lifecycle License

The Swarmauri UDS Unicast Transport offers reliable, ordered, local-only communication over Unix domain sockets. It embraces the unified transport lifecycle so the server and client contexts are created directly from the transport instance (.server(...) / .client(...)).

Installation

Using uv

uv add --directory pkgs/standards/swarmauri_transport_uds_unicast swarmauri_transport_uds_unicast

Using pip

pip install swarmauri_transport_uds_unicast

Usage

The example below demonstrates setting up a server and client that echo messages over a Unix domain socket path.

import asyncio
from swarmauri_transport_uds_unicast import UdsUnicastTransport

SOCKET_PATH = "/tmp/swm-uds.sock"

async def main() -> None:
    server = UdsUnicastTransport(SOCKET_PATH)

    async def run_server():
        async with server.server():
            data = await server.recv()
            await server.send("peer", b"echo:" + data)

    async def run_client():
        client = UdsUnicastTransport(SOCKET_PATH)
        async with client.client():
            await client.send("server", b"ping")
            response = await client.recv()
            print(response.decode())

    await asyncio.gather(run_server(), run_client())

asyncio.run(main())

This transport is ideal for same-host communication where low latency and security isolation are required.

Project details


Download files

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

Source Distribution

Built Distribution

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

File details

Details for the file swarmauri_transport_uds_unicast-0.11.0.dev1.tar.gz.

File metadata

  • Download URL: swarmauri_transport_uds_unicast-0.11.0.dev1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_transport_uds_unicast-0.11.0.dev1.tar.gz
Algorithm Hash digest
SHA256 71c8e57c7f57b6ca35c8e83de72faff1ebe0f9dcdbd77bcf3392b6a6e09ee082
MD5 8993bf500d03c7cb9f3ba7febe9402f3
BLAKE2b-256 2ce65fc683414027c6999d730f57c383c41201de794eace343f1abba9d8f82cc

See more details on using hashes here.

File details

Details for the file swarmauri_transport_uds_unicast-0.11.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_transport_uds_unicast-0.11.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_transport_uds_unicast-0.11.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 8d2adf81525022b86207f987bb095dcaabc6ea8d514cae84f59e5cacc585b86b
MD5 36764fd77e66a7b129eefb8a2e7e2680
BLAKE2b-256 c85959afcb5a385beb7f2b638d971fa034fc14c4a227ea7e1821233c93f04ca4

See more details on using hashes here.

Supported by

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