Metadata-Version: 2.4
Name: funcnodes-worker
Version: 1.6.0
Summary: Worker package for FuncNodes
Project-URL: homepage, https://github.com/Linkdlab/funcnodes_worker
Project-URL: source, https://github.com/Linkdlab/funcnodes_worker
Project-URL: tracker, https://github.com/Linkdlab/funcnodes_worker/issues
Project-URL: download, https://pypi.org/project/funcnodes_worker/#files
Author-email: Julian Kimmig <julian.kimmig@linkdlab.de>
License: AGPL-3.0
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: asynctoolkit>=0.1.1
Requires-Dist: funcnodes-core>=2.2.0
Requires-Dist: packaging>=24.2
Requires-Dist: pip>=25.0.1
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-slugify>=8.0.4
Provides-Extra: all
Requires-Dist: aiohttp; extra == 'all'
Requires-Dist: aiohttp-cors; extra == 'all'
Requires-Dist: requests; extra == 'all'
Requires-Dist: subprocess-monitor>=0.3.0; extra == 'all'
Requires-Dist: venvmngr>=0.1.15; extra == 'all'
Provides-Extra: http
Requires-Dist: aiohttp; extra == 'http'
Requires-Dist: aiohttp-cors; extra == 'http'
Requires-Dist: requests; extra == 'http'
Provides-Extra: subprocess-monitor
Requires-Dist: subprocess-monitor>=0.3.0; extra == 'subprocess-monitor'
Provides-Extra: venv
Requires-Dist: venvmngr>=0.1.15; extra == 'venv'
Description-Content-Type: text/markdown

# FuncNodes Worker

**FuncNodes Worker** (`funcnodes_worker`) is the execution engine for the [FuncNodes](https://github.com/Linkdlab/FuncNodes) ecosystem. It provides the runtime environment where nodes are executed, managed, and controlled.

> [!NOTE]
> For the full application usage, please refer to the main [FuncNodes repository](https://github.com/Linkdlab/FuncNodes).

## Key Features

- **Execution Runtime**: Manages the `NodeSpace` and the main event loop, ensuring efficient asynchronous execution of nodes.
- **Remote Control**:
    - **WebSocket Worker**: Allows remote management and frontend interaction via `aiohttp` WebSockets.
    - **Message Queue Worker**: Supports communication via multiprocessing queues for inter-process coordination.
- **Process Management**: Handles state persistence, heartbeats, and safe shutdown procedures.
- **Extensibility**: Supports "External Workers" to offload tasks to auxiliary processes or environments.

## Installation

```bash
pip install funcnodes-worker
```

## Dependencies

- **funcnodes-core**: The core logic definitions.
- **aiohttp**: For WebSocket communication (optional but recommended).
- **pydantic**: For configuration and data validation.

## Usage

In most cases, `funcnodes-worker` is used internally by the `funcnodes` main package. However, you can instantiate a worker programmatically if needed:

```python
from funcnodes_worker import WSWorker

# Create a worker that listens on a specific host and port
worker = WSWorker(host="localhost", port=9382)

# Start the worker loop (usually handled by an async runner)
# await worker.run()
```

## Documentation

For comprehensive documentation, visit the [FuncNodes Documentation](https://linkdlab.github.io/FuncNodes).
