Skip to main content

AfterLink Protocol SDK - TCP client/server with routing, middleware, and pub/sub

Project description

AfterLink Python SDK

Python Client and Server SDK for the binary AfterLink protocol.

Installation

pip install afterlink

Usage

Server

import asyncio
from afterlink import Server

server = Server(port=4000)

@server.on("users/get")
async def get_user(req):
    return {"id": 1, "username": "ajay"}

asyncio.run(server.listen())

Client

import asyncio
from afterlink import Client

async def main():
    client = Client("tcp://localhost:4000")
    await client.connect()
    res = await client.request("users/get")
    print(res)
    await client.disconnect()

asyncio.run(main())

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

afterlink-2.0.1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

afterlink-2.0.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

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