Metadata-Version: 2.4
Name: afterlink
Version: 2.0.1
Summary: AfterLink Protocol SDK - TCP client/server with routing, middleware, and pub/sub
Author-email: Ajay Myth <ajaymyth@github.com>
License-Expression: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: msgpack>=1.0.8
Requires-Dist: pydantic>=2.0
Provides-Extra: uvloop
Requires-Dist: uvloop>=0.17.0; extra == 'uvloop'
Description-Content-Type: text/markdown

# AfterLink Python SDK

Python Client and Server SDK for the binary AfterLink protocol.

## Installation

```bash
pip install afterlink
```

## Usage

### Server

```python
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

```python
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())
```
