Metadata-Version: 2.4
Name: pynect-worker
Version: 0.8.9
Summary: Chanx schema export and local IPC adapter for Pynect
Author: Reggie Bowser and NodePyX contributors
License-Expression: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Dist: chanx[fast-channels]>=2.13.0,<3
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/regbo/lfp-common/tree/main/packages/py/pynect-worker#readme
Project-URL: Repository, https://github.com/regbo/lfp-common.git
Project-URL: Issues, https://github.com/regbo/lfp-common/issues
Description-Content-Type: text/markdown

# pynect-worker

`pynect-worker` is Pynect's Python package. It exports Chanx AsyncAPI schemas,
adds iterator-aware server handlers, and runs Python-owned Chanx applications
over Pynect's local IPC transport.

## Install

```sh
uv add pynect-worker
```

Configure the ASGI application in the owning Python project:

```toml
[tool.pynect]
app = "server:app"
```

## Server iterators

Import `ws_handler` from `pynect_worker` and annotate an iterator return type.
Pynect forwards each item and emits Chanx's protocol-level `complete` frame
when the iterator exits normally.

```py
from collections.abc import AsyncIterator
from pynect_worker import ws_handler

@ws_handler
async def watch(self, message: WatchRequest) -> AsyncIterator[WatchResponse]:
    yield WatchResponse(payload=message.payload)
```

MIT licensed.
