FuncNodes Worker (funcnodes_worker) is the execution engine for the 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.
- Execution Runtime: Manages the
NodeSpaceand the main event loop, ensuring efficient asynchronous execution of nodes. - Remote Control:
- WebSocket Worker: Allows remote management and frontend interaction via
aiohttpWebSockets. - Message Queue Worker: Supports communication via multiprocessing queues for inter-process coordination.
- WebSocket Worker: Allows remote management and frontend interaction via
- Process Management: Handles state persistence, heartbeats, and safe shutdown procedures.
- Extensibility: Supports "External Workers" to offload tasks to auxiliary processes or environments.
pip install funcnodes-worker- funcnodes-core: The core logic definitions.
- aiohttp: For WebSocket communication (optional but recommended).
- pydantic: For configuration and data validation.
In most cases, funcnodes-worker is used internally by the funcnodes main package. However, you can instantiate a worker programmatically if needed:
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()For comprehensive documentation, visit the FuncNodes Documentation.