Files
Kill_LIFE/kill_life/worker.py
T
L'électron rare bd88bbc96a feat: Kill_LIFE service skeleton — FastAPI + Docker + mascarade bridge
- kill_life/ Python package (FastAPI v0.1.0)
- server.py: 6 endpoints (health, agents, specs, agent/run, mcp/servers, bridge)
- worker.py: background task worker stub
- Dockerfile: python:3.12-slim + uv
- docker-compose.yml: kill-life-api (port 8200) + kill-life-worker
- mcp.json: added mascarade-bridge + kill-life-api server entries
- 6 BMAD agents exposed, ~25 specs discoverable, MCP bridge to mascarade-core

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 07:39:23 +01:00

47 lines
1.1 KiB
Python

"""Kill_LIFE background worker — processes agent execution tasks.
Stub implementation. In production, this would:
- Poll a task queue (Redis/mascarade P2P)
- Execute BMAD agent pipelines
- Report results back to the API
"""
from __future__ import annotations
import asyncio
import logging
import signal
import sys
logging.basicConfig(level=logging.INFO, format="%(asctime)s [kill-life-worker] %(message)s")
log = logging.getLogger(__name__)
_running = True
def _shutdown(signum, frame):
global _running
log.info("Received signal %s, shutting down...", signum)
_running = False
async def main():
signal.signal(signal.SIGTERM, _shutdown)
signal.signal(signal.SIGINT, _shutdown)
log.info("Kill_LIFE worker started. Waiting for tasks...")
log.info(" MASCARADE_CORE_URL: %s", __import__("os").environ.get("MASCARADE_CORE_URL", "(not set)"))
while _running:
# Stub: sleep and wait. Real implementation would poll task queue.
await asyncio.sleep(5)
log.info("Worker stopped.")
if __name__ == "__main__":
try:
asyncio.run(main())
except KeyboardInterrupt:
sys.exit(0)