lex-tasker 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +16 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +36 -22
- data/CHANGELOG.md +43 -0
- data/CLAUDE.md +83 -0
- data/Dockerfile +1 -1
- data/Gemfile +9 -1
- data/README.md +34 -2
- data/Rakefile +2 -0
- data/docker_deploy.rb +1 -0
- data/lex-tasker.gemspec +9 -13
- data/lib/legion/extensions/tasker/actors/check_subtask.rb +20 -14
- data/lib/legion/extensions/tasker/actors/fetch_delayed.rb +23 -17
- data/lib/legion/extensions/tasker/actors/fetch_delayed_push.rb +26 -20
- data/lib/legion/extensions/tasker/actors/log.rb +14 -8
- data/lib/legion/extensions/tasker/actors/task_manager.rb +20 -14
- data/lib/legion/extensions/tasker/actors/updater.rb +20 -14
- data/lib/legion/extensions/tasker/client.rb +29 -0
- data/lib/legion/extensions/tasker/helpers/task_finder.rb +98 -0
- data/lib/legion/extensions/tasker/runners/check_subtask.rb +92 -80
- data/lib/legion/extensions/tasker/runners/fetch_delayed.rb +76 -60
- data/lib/legion/extensions/tasker/runners/log.rb +47 -41
- data/lib/legion/extensions/tasker/runners/task_manager.rb +12 -5
- data/lib/legion/extensions/tasker/runners/updater.rb +25 -22
- data/lib/legion/extensions/tasker/transport/exchanges/task.rb +10 -4
- data/lib/legion/extensions/tasker/transport/messages/fetch_delayed.rb +17 -7
- data/lib/legion/extensions/tasker/transport/queues/check_subtask.rb +18 -12
- data/lib/legion/extensions/tasker/transport/queues/fetch_delayed.rb +20 -15
- data/lib/legion/extensions/tasker/transport/queues/lex_register.rb +15 -9
- data/lib/legion/extensions/tasker/transport/queues/subtask.rb +12 -6
- data/lib/legion/extensions/tasker/transport/queues/task_log.rb +12 -6
- data/lib/legion/extensions/tasker/transport/queues/task_mananger.rb +15 -9
- data/lib/legion/extensions/tasker/transport/queues/updater.rb +12 -6
- data/lib/legion/extensions/tasker/transport.rb +31 -24
- data/lib/legion/extensions/tasker/version.rb +3 -1
- data/lib/legion/extensions/tasker.rb +2 -4
- metadata +17 -104
- data/.circleci/config.yml +0 -39
- data/Gemfile.lock +0 -69
- data/bitbucket-pipelines.yml +0 -19
- data/lib/legion/extensions/tasker/helpers/base.rb +0 -11
- data/lib/legion/extensions/tasker/helpers/fetch_delayed.rb +0 -66
- data/lib/legion/extensions/tasker/helpers/find_subtask.rb +0 -49
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0ddb16f43ef1fb3c1ac2861f9c76e02d2b45cede2dbe9eb39029916a5ee70fb7
|
|
4
|
+
data.tar.gz: ca05b76ba9b441705bb70c182adcc442c36dea6aea02e5d477db0d872afb282d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8f66556dfc6fdf24c90c688641a477d40b0d31ceb702903e7946bb6d5e0d5ecc8c6a49f3570f600a491b95c32552b75c919f88047d9462327b8ffa4f12bcbbd0
|
|
7
|
+
data.tar.gz: 34f3bc487e7ecb93f54f86139d055249560d0abd0563646a2656f73ac84026754a3f79afb3ab562778cecd72ffb02c7397338a079dfc5870e5486b2022c42989
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
pull_request:
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
ci:
|
|
9
|
+
uses: LegionIO/.github/.github/workflows/ci.yml@main
|
|
10
|
+
|
|
11
|
+
release:
|
|
12
|
+
needs: ci
|
|
13
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
14
|
+
uses: LegionIO/.github/.github/workflows/release.yml@main
|
|
15
|
+
secrets:
|
|
16
|
+
rubygems-api-key: ${{ secrets.RUBYGEMS_API_KEY }}
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -1,34 +1,48 @@
|
|
|
1
|
+
AllCops:
|
|
2
|
+
TargetRubyVersion: 3.4
|
|
3
|
+
NewCops: enable
|
|
4
|
+
SuggestExtensions: false
|
|
5
|
+
|
|
1
6
|
Layout/LineLength:
|
|
2
|
-
Max:
|
|
7
|
+
Max: 160
|
|
8
|
+
|
|
9
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
|
10
|
+
EnforcedStyle: space
|
|
11
|
+
|
|
12
|
+
Layout/HashAlignment:
|
|
13
|
+
EnforcedHashRocketStyle: table
|
|
14
|
+
EnforcedColonStyle: table
|
|
15
|
+
|
|
3
16
|
Metrics/MethodLength:
|
|
4
|
-
Max:
|
|
17
|
+
Max: 50
|
|
18
|
+
|
|
5
19
|
Metrics/ClassLength:
|
|
6
20
|
Max: 1500
|
|
21
|
+
|
|
22
|
+
Metrics/ModuleLength:
|
|
23
|
+
Max: 1500
|
|
24
|
+
|
|
7
25
|
Metrics/BlockLength:
|
|
8
|
-
Max:
|
|
9
|
-
|
|
10
|
-
Max: 20
|
|
26
|
+
Max: 40
|
|
27
|
+
|
|
11
28
|
Metrics/AbcSize:
|
|
12
|
-
Max:
|
|
29
|
+
Max: 60
|
|
30
|
+
|
|
31
|
+
Metrics/CyclomaticComplexity:
|
|
32
|
+
Max: 15
|
|
33
|
+
|
|
13
34
|
Metrics/PerceivedComplexity:
|
|
14
|
-
Max:
|
|
15
|
-
|
|
16
|
-
Max: 20
|
|
17
|
-
Layout/SpaceAroundEqualsInParameterDefault:
|
|
18
|
-
EnforcedStyle: space
|
|
19
|
-
Style/SymbolArray:
|
|
20
|
-
Enabled: true
|
|
21
|
-
Layout/HashAlignment:
|
|
22
|
-
EnforcedHashRocketStyle: table
|
|
23
|
-
EnforcedColonStyle: table
|
|
35
|
+
Max: 17
|
|
36
|
+
|
|
24
37
|
Style/Documentation:
|
|
25
38
|
Enabled: false
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
39
|
+
|
|
40
|
+
Style/SymbolArray:
|
|
41
|
+
Enabled: true
|
|
42
|
+
|
|
29
43
|
Style/FrozenStringLiteralComment:
|
|
30
|
-
Enabled:
|
|
44
|
+
Enabled: true
|
|
45
|
+
EnforcedStyle: always
|
|
46
|
+
|
|
31
47
|
Naming/FileName:
|
|
32
48
|
Enabled: false
|
|
33
|
-
Style/ClassAndModuleChildren:
|
|
34
|
-
Enabled: false
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.3.0] - 2026-03-18
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Standalone `Tasker::Client` for programmatic subtask dispatch
|
|
7
|
+
- `expire_queued` implementation (was no-op stub)
|
|
8
|
+
- Shared `Helpers::TaskFinder` module (deduplicated from find_subtask + fetch_delayed)
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- `extend` -> `include` for helper modules (instance methods were unreachable via AMQP dispatch)
|
|
12
|
+
- SQL injection risk: raw string interpolation replaced with Sequel DSL parameterized queries
|
|
13
|
+
- Cross-DB: backtick quoting, `legion.` prefix, `CONCAT()` replaced with Sequel joins
|
|
14
|
+
- `runners/log.rb`: `payload[:node_id]` -> `opts[:node_id]` (NameError fix)
|
|
15
|
+
- `runners/log.rb`: `Node.where(opts[:name])` -> `Node.where(name: opts[:name])`
|
|
16
|
+
- `runners/log.rb`: `runner.values.nil?` -> `runner.nil?` (NoMethodError fix)
|
|
17
|
+
- `runners/log.rb`: `TaskLog.all.delete` -> `TaskLog.dataset.delete` (was no-op)
|
|
18
|
+
- `runners/updater.rb`: added missing `return` on early exit
|
|
19
|
+
- `runners/task_manager.rb`: Sequel chain reassignment for status filter
|
|
20
|
+
- `runners/task_manager.rb`: MySQL `DATE_SUB` -> `Sequel.lit` with Ruby Time
|
|
21
|
+
- `runners/check_subtask.rb`: nil delay guard (`.to_i.zero?`)
|
|
22
|
+
- `runners/check_subtask.rb`: cache mutation via `relationship.dup`
|
|
23
|
+
- `runners/check_subtask.rb`: nil guard after `find_trigger`
|
|
24
|
+
- `runners/check_subtask.rb`: result/results fan-out handles both keys
|
|
25
|
+
- `fetch_delayed` queue TTL from 1ms to 1000ms
|
|
26
|
+
- Entry point `data_required?` is now class method only
|
|
27
|
+
- `Helpers::TaskFinder#subtask_query` extracted to reduce AbcSize in `find_subtasks`
|
|
28
|
+
|
|
29
|
+
### Removed
|
|
30
|
+
- `helpers/base.rb` (empty stub)
|
|
31
|
+
- `helpers/fetch_delayed.rb` (merged into TaskFinder)
|
|
32
|
+
- `helpers/find_subtask.rb` (merged into TaskFinder)
|
|
33
|
+
- Debug artifact `log.unknown task.class` in updater
|
|
34
|
+
|
|
35
|
+
## [0.2.3] - 2026-03-17
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
- Qualify `status` column as `tasks.status` in SQL JOIN query to resolve ambiguous column reference in `fetch_delayed` helper
|
|
39
|
+
|
|
40
|
+
## [0.2.2] - 2026-03-13
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
- Initial release
|
data/CLAUDE.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# lex-tasker: Task Lifecycle Manager for LegionIO
|
|
2
|
+
|
|
3
|
+
**Repository Level 3 Documentation**
|
|
4
|
+
- **Parent**: `/Users/miverso2/rubymine/legion/extensions-core/CLAUDE.md`
|
|
5
|
+
- **Grandparent**: `/Users/miverso2/rubymine/legion/CLAUDE.md`
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Legion Extension that manages the full lifecycle of tasks within the framework. Tracks task status, manages subtask relationships, handles delayed task scheduling, extension registration, and provides task logging. Central coordination point for task execution flow. Requires `legion-data` (`data_required? true`).
|
|
10
|
+
|
|
11
|
+
**GitHub**: https://github.com/LegionIO/lex-tasker
|
|
12
|
+
**License**: MIT
|
|
13
|
+
**Version**: 0.3.0
|
|
14
|
+
|
|
15
|
+
## Architecture
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
Legion::Extensions::Tasker
|
|
19
|
+
├── Actors/
|
|
20
|
+
│ ├── CheckSubtask # Subscription: checks subtask completion status
|
|
21
|
+
│ ├── TaskManager # Subscription: core task lifecycle management
|
|
22
|
+
│ ├── FetchDelayed # Subscription: retrieves delayed tasks for execution
|
|
23
|
+
│ ├── FetchDelayedPush # Periodic actor: triggers FetchDelayed polls
|
|
24
|
+
│ ├── Updater # Subscription: updates task status/payload records
|
|
25
|
+
│ └── Log # Subscription: task activity logging
|
|
26
|
+
├── Runners/
|
|
27
|
+
│ ├── CheckSubtask # check_subtasks: find and dispatch relationship subtasks
|
|
28
|
+
│ ├── TaskManager # purge_old, expire_queued: task DB maintenance
|
|
29
|
+
│ ├── FetchDelayed # fetch, push: poll and dispatch delayed tasks
|
|
30
|
+
│ ├── Updater # update_status: update task columns in DB
|
|
31
|
+
│ └── Log # add_log, delete_log, delete_task_logs, delete_node_logs, delete_all
|
|
32
|
+
├── Helpers/
|
|
33
|
+
│ ├── Base # Shared helper utilities
|
|
34
|
+
│ ├── FetchDelayed # Delayed task query helpers
|
|
35
|
+
│ └── FindSubtask # Subtask relationship lookup helpers
|
|
36
|
+
└── Transport/
|
|
37
|
+
├── Exchanges/Task # Task exchange
|
|
38
|
+
├── Queues/
|
|
39
|
+
│ ├── CheckSubtask # Subtask check queue
|
|
40
|
+
│ ├── TaskMananger # Task management queue (note: typo in filename)
|
|
41
|
+
│ ├── FetchDelayed # Delayed task queue
|
|
42
|
+
│ ├── Subtask # Subtask queue
|
|
43
|
+
│ ├── TaskLog # Task log queue
|
|
44
|
+
│ ├── Updater # Status update queue
|
|
45
|
+
│ └── LexRegister # Extension registration queue
|
|
46
|
+
└── Messages/
|
|
47
|
+
└── FetchDelayed # Delayed task poll message
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Key Files
|
|
51
|
+
|
|
52
|
+
| Path | Purpose |
|
|
53
|
+
|------|---------|
|
|
54
|
+
| `lib/legion/extensions/tasker.rb` | Entry point (`data_required? true`) |
|
|
55
|
+
| `lib/legion/extensions/tasker/runners/check_subtask.rb` | Core subtask dispatch: find relationships, build task hash, insert DB record, publish |
|
|
56
|
+
| `lib/legion/extensions/tasker/runners/task_manager.rb` | `purge_old` (delete old completed tasks), `expire_queued` (queries stale tasks - incomplete, does not delete) |
|
|
57
|
+
| `lib/legion/extensions/tasker/runners/fetch_delayed.rb` | Poll DB for delayed tasks, dispatch when delay elapsed |
|
|
58
|
+
| `lib/legion/extensions/tasker/runners/updater.rb` | `update_status`: update task columns (status, function_args, payload, results) |
|
|
59
|
+
| `lib/legion/extensions/tasker/runners/log.rb` | Task log CRUD against `TaskLog` model |
|
|
60
|
+
|
|
61
|
+
## CheckSubtask Flow
|
|
62
|
+
|
|
63
|
+
1. Receives completed task result with `runner_class` and `function`
|
|
64
|
+
2. Looks up trigger function by namespace + name
|
|
65
|
+
3. Queries relationships where `trigger_function_id` matches
|
|
66
|
+
4. For each matching relationship, builds subtask hash with status (`task.delayed` or `conditioner.queued`)
|
|
67
|
+
5. Inserts task record in DB, then publishes to subtask queue (unless delayed)
|
|
68
|
+
|
|
69
|
+
## Delayed Task Flow
|
|
70
|
+
|
|
71
|
+
`FetchDelayedPush` (Every actor, every 1 second) publishes a trigger via `push`. `FetchDelayed` (Subscription actor, `fetch` function) polls DB for tasks in `task.delayed` status, checks if `relationship_delay` or `task_delay` has elapsed, then dispatches them. Routing key is chosen based on whether conditions or transformations are present.
|
|
72
|
+
|
|
73
|
+
## Testing
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
bundle install
|
|
77
|
+
bundle exec rspec
|
|
78
|
+
bundle exec rubocop
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
**Maintained By**: Matthew Iverson (@Esity)
|
data/Dockerfile
CHANGED
data/Gemfile
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
source 'https://rubygems.org'
|
|
2
4
|
|
|
3
|
-
# Specify your gem's dependencies in legion-extensions-tasker.gemspec
|
|
4
5
|
gemspec
|
|
6
|
+
|
|
7
|
+
gem 'bundler', '>= 2'
|
|
8
|
+
gem 'codecov'
|
|
9
|
+
gem 'rake'
|
|
10
|
+
gem 'rspec'
|
|
11
|
+
gem 'rspec_junit_formatter'
|
|
12
|
+
gem 'rubocop'
|
data/README.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
-
#
|
|
1
|
+
# lex-tasker
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Task lifecycle manager for [LegionIO](https://github.com/LegionIO/LegionIO). Manages the full lifecycle of tasks within the framework: status tracking, subtask relationships, delayed task scheduling, task logging, and extension registration.
|
|
4
|
+
|
|
5
|
+
This is a core LEX required for task execution.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
gem install lex-tasker
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Functions
|
|
14
|
+
|
|
15
|
+
- **CheckSubtask** - After a task completes, find all relationship-linked subtasks and dispatch them (with delay, condition, or transformation routing as appropriate)
|
|
16
|
+
- **TaskManager** - DB housekeeping: purge old completed tasks, expire stale queued tasks
|
|
17
|
+
- **FetchDelayed** - Poll for tasks in `task.delayed` status; dispatch when their delay period has elapsed
|
|
18
|
+
- **Updater** - Update task records (status, function args, payload, results)
|
|
19
|
+
- **Log** - Task activity log CRUD (add, delete by task/node/id, delete all)
|
|
20
|
+
|
|
21
|
+
## How It Works
|
|
22
|
+
|
|
23
|
+
When a task completes, its runner calls `check_subtasks` via the task exchange. `lex-tasker` looks up any configured relationships for that function, creates child task records in the database, and publishes them to the appropriate queue - routing through `lex-conditioner`, `lex-transformer`, or directly to the target runner depending on relationship configuration.
|
|
24
|
+
|
|
25
|
+
Delayed tasks (those with `relationship_delay` or `task_delay`) are stored in the database with status `task.delayed` and dispatched by the `FetchDelayed` runner once their delay period has elapsed.
|
|
26
|
+
|
|
27
|
+
## Requirements
|
|
28
|
+
|
|
29
|
+
- Ruby >= 3.4
|
|
30
|
+
- [LegionIO](https://github.com/LegionIO/LegionIO) framework
|
|
31
|
+
- `legion-data` (database persistence required)
|
|
32
|
+
|
|
33
|
+
## License
|
|
34
|
+
|
|
35
|
+
MIT
|
data/Rakefile
CHANGED
data/docker_deploy.rb
CHANGED
data/lex-tasker.gemspec
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
lib = File.expand_path('lib', __dir__)
|
|
2
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
5
|
require 'legion/extensions/tasker/version'
|
|
@@ -10,24 +12,18 @@ Gem::Specification.new do |spec|
|
|
|
10
12
|
|
|
11
13
|
spec.summary = 'LEX::Tasker manages tasks status from Legion'
|
|
12
14
|
spec.description = 'This LEX keeps track of tasks and their status'
|
|
13
|
-
spec.homepage = 'https://
|
|
15
|
+
spec.homepage = 'https://github.com/LegionIO/lex-tasker'
|
|
14
16
|
spec.license = 'MIT'
|
|
15
|
-
spec.required_ruby_version =
|
|
17
|
+
spec.required_ruby_version = '>= 3.4'
|
|
16
18
|
|
|
17
19
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
18
20
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
19
21
|
end
|
|
20
22
|
spec.metadata['homepage_uri'] = spec.homepage
|
|
21
|
-
spec.metadata['source_code_uri'] = 'https://
|
|
22
|
-
spec.metadata['documentation_uri'] = 'https://
|
|
23
|
-
spec.metadata['changelog_uri'] = 'https://
|
|
24
|
-
spec.metadata['bug_tracker_uri'] = 'https://
|
|
23
|
+
spec.metadata['source_code_uri'] = 'https://github.com/LegionIO/lex-tasker'
|
|
24
|
+
spec.metadata['documentation_uri'] = 'https://github.com/LegionIO/lex-tasker'
|
|
25
|
+
spec.metadata['changelog_uri'] = 'https://github.com/LegionIO/lex-tasker'
|
|
26
|
+
spec.metadata['bug_tracker_uri'] = 'https://github.com/LegionIO/lex-tasker/issues'
|
|
27
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
25
28
|
spec.require_paths = ['lib']
|
|
26
|
-
|
|
27
|
-
spec.add_development_dependency 'bundler', '>= 2'
|
|
28
|
-
spec.add_development_dependency 'codecov'
|
|
29
|
-
spec.add_development_dependency 'rake'
|
|
30
|
-
spec.add_development_dependency 'rspec'
|
|
31
|
-
spec.add_development_dependency 'rspec_junit_formatter'
|
|
32
|
-
spec.add_development_dependency 'rubocop'
|
|
33
29
|
end
|
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
module Actor
|
|
3
|
-
class CheckSubtask < Legion::Extensions::Actors::Subscription
|
|
4
|
-
def runner_function
|
|
5
|
-
'check_subtasks'
|
|
6
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
7
2
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Tasker
|
|
6
|
+
module Actor
|
|
7
|
+
class CheckSubtask < Legion::Extensions::Actors::Subscription
|
|
8
|
+
def runner_function
|
|
9
|
+
'check_subtasks'
|
|
10
|
+
end
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
def check_subtask?
|
|
13
|
+
false
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def use_runner?
|
|
17
|
+
false
|
|
18
|
+
end
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
def generate_task?
|
|
21
|
+
false
|
|
22
|
+
end
|
|
23
|
+
end
|
|
18
24
|
end
|
|
19
25
|
end
|
|
20
26
|
end
|
|
@@ -1,24 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
module Actor
|
|
3
|
-
class FetchDelayed < Legion::Extensions::Actors::Subscription
|
|
4
|
-
def runner_function
|
|
5
|
-
'fetch'
|
|
6
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
7
2
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Tasker
|
|
6
|
+
module Actor
|
|
7
|
+
class FetchDelayed < Legion::Extensions::Actors::Subscription
|
|
8
|
+
def runner_function
|
|
9
|
+
'fetch'
|
|
10
|
+
end
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
def runner_class
|
|
13
|
+
Legion::Extensions::Tasker::Runners::FetchDelayed
|
|
14
|
+
end
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
def use_runner?
|
|
17
|
+
false
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def check_subtask?
|
|
21
|
+
false
|
|
22
|
+
end
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
def generate_task?
|
|
25
|
+
false
|
|
26
|
+
end
|
|
27
|
+
end
|
|
22
28
|
end
|
|
23
29
|
end
|
|
24
30
|
end
|
|
@@ -1,28 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
module Actor
|
|
3
|
-
class FetchDelayedPush < Legion::Extensions::Actors::Every
|
|
4
|
-
def runner_function
|
|
5
|
-
'push'
|
|
6
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
7
2
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Tasker
|
|
6
|
+
module Actor
|
|
7
|
+
class FetchDelayedPush < Legion::Extensions::Actors::Every
|
|
8
|
+
def runner_function
|
|
9
|
+
'push'
|
|
10
|
+
end
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
def runner_class
|
|
13
|
+
Legion::Extensions::Tasker::Runners::FetchDelayed
|
|
14
|
+
end
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
def check_subtask?
|
|
17
|
+
false
|
|
18
|
+
end
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
def generate_task?
|
|
21
|
+
false
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def use_runner?
|
|
25
|
+
false
|
|
26
|
+
end
|
|
23
27
|
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
def time
|
|
29
|
+
1
|
|
30
|
+
end
|
|
31
|
+
end
|
|
26
32
|
end
|
|
27
33
|
end
|
|
28
34
|
end
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Tasker
|
|
6
|
+
module Actor
|
|
7
|
+
class Log < Legion::Extensions::Actors::Subscription
|
|
8
|
+
def check_subtask?
|
|
9
|
+
false
|
|
10
|
+
end
|
|
7
11
|
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
def generate_task?
|
|
13
|
+
false
|
|
14
|
+
end
|
|
15
|
+
end
|
|
10
16
|
end
|
|
11
17
|
end
|
|
12
18
|
end
|
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
module Actor
|
|
3
|
-
class TaskManager < Legion::Extensions::Actors::Subscription
|
|
4
|
-
def use_runner?
|
|
5
|
-
true
|
|
6
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
7
2
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Tasker
|
|
6
|
+
module Actor
|
|
7
|
+
class TaskManager < Legion::Extensions::Actors::Subscription
|
|
8
|
+
def use_runner?
|
|
9
|
+
true
|
|
10
|
+
end
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
def check_subtask?
|
|
13
|
+
false
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def generate_task?
|
|
17
|
+
false
|
|
18
|
+
end
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
def prefetch
|
|
21
|
+
1
|
|
22
|
+
end
|
|
23
|
+
end
|
|
18
24
|
end
|
|
19
25
|
end
|
|
20
26
|
end
|
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
module Actor
|
|
3
|
-
class Updater < Legion::Extensions::Actors::Subscription
|
|
4
|
-
def runner_function
|
|
5
|
-
'update_status'
|
|
6
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
7
2
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Tasker
|
|
6
|
+
module Actor
|
|
7
|
+
class Updater < Legion::Extensions::Actors::Subscription
|
|
8
|
+
def runner_function
|
|
9
|
+
'update_status'
|
|
10
|
+
end
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
def check_subtask?
|
|
13
|
+
false
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def generate_task?
|
|
17
|
+
false
|
|
18
|
+
end
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
def use_runner?
|
|
21
|
+
false
|
|
22
|
+
end
|
|
23
|
+
end
|
|
18
24
|
end
|
|
19
25
|
end
|
|
20
26
|
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'helpers/task_finder'
|
|
4
|
+
|
|
5
|
+
module Legion
|
|
6
|
+
module Extensions
|
|
7
|
+
module Tasker
|
|
8
|
+
class Client
|
|
9
|
+
include Helpers::TaskFinder
|
|
10
|
+
|
|
11
|
+
def initialize(data_model: nil)
|
|
12
|
+
@data_model = data_model
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def models_class
|
|
16
|
+
@data_model || Legion::Data::Model
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def log
|
|
20
|
+
@log ||= defined?(Legion::Logging) ? Legion::Logging : Logger.new($stdout)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def settings
|
|
24
|
+
{ options: {} }
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|