merge queues and actors apps into new workers app

This commit is contained in:
Nick Sweeting 2024-11-18 18:52:48 -08:00
parent e50f8cb3b6
commit e469c5a344
No known key found for this signature in database
37 changed files with 89 additions and 304 deletions

View file

@ -41,7 +41,7 @@ def register_urls(api: NinjaAPI) -> NinjaAPI:
api.add_router('/core/', 'api.v1_core.router')
api.add_router('/crawls/', 'api.v1_crawls.router')
api.add_router('/cli/', 'api.v1_cli.router')
api.add_router('/jobs/', 'api.v1_actors.router')
api.add_router('/workers/', 'api.v1_workers.router')
return api

View file

@ -31,7 +31,7 @@ class TaskSchema(Schema):
class ActorSchema(Schema):
# TYPE: str = 'actors.actor.ActorType'
# TYPE: str = 'workers.actor.ActorType'
# name: str
#pid: int | None
@ -97,7 +97,7 @@ class ActorSchema(Schema):
class OrchestratorSchema(Schema):
# TYPE: str = 'actors.orchestrator.Orchestrator'
# TYPE: str = 'workers.orchestrator.Orchestrator'
#pid: int | None
exit_on_idle: bool
@ -114,7 +114,7 @@ class OrchestratorSchema(Schema):
def get_orchestrators(request):
"""List all the task orchestrators (aka Orchestrators) that are currently running"""
from actors.orchestrator import Orchestrator
from workers.orchestrator import Orchestrator
orchestrator = Orchestrator()
return [orchestrator]
@ -124,6 +124,6 @@ def get_orchestrators(request):
def get_actors(request):
"""List all the task consumer workers (aka Actors) that are currently running"""
from actors.orchestrator import Orchestrator
from workers.orchestrator import Orchestrator
orchestrator = Orchestrator()
return orchestrator.actor_types.values()