Class: Rubino::API::Operations::Tasks::IndexOperation
- Inherits:
-
Object
- Object
- Rubino::API::Operations::Tasks::IndexOperation
- Defined in:
- lib/rubino/api/operations/tasks/index_operation.rb
Overview
GET /v1/tasks Lists background subagents started by the ‘task` tool, newest first. Each row is the summary shape (no full result body — see the show endpoint for that). The registry is process-local and not persisted, so this reflects only the current server process’s children.
Instance Method Summary collapse
- #call(_request) ⇒ Object
-
#initialize(registry: nil) ⇒ IndexOperation
constructor
Accepts an alternate registry for tests.
Constructor Details
#initialize(registry: nil) ⇒ IndexOperation
Accepts an alternate registry for tests.
14 15 16 |
# File 'lib/rubino/api/operations/tasks/index_operation.rb', line 14 def initialize(registry: nil) @registry = registry || ::Rubino::Tools::BackgroundTasks.instance end |
Instance Method Details
#call(_request) ⇒ Object
18 19 20 21 |
# File 'lib/rubino/api/operations/tasks/index_operation.rb', line 18 def call(_request) tasks = @registry.list.map { |entry| Serializer.summary(entry) } [200, { tasks: tasks }] end |