job-workflow 0.1.3
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 +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +91 -0
- data/CHANGELOG.md +23 -0
- data/LICENSE.txt +21 -0
- data/README.md +47 -0
- data/Rakefile +55 -0
- data/Steepfile +10 -0
- data/guides/API_REFERENCE.md +112 -0
- data/guides/BEST_PRACTICES.md +113 -0
- data/guides/CACHE_STORE_INTEGRATION.md +145 -0
- data/guides/CONDITIONAL_EXECUTION.md +66 -0
- data/guides/DEPENDENCY_WAIT.md +386 -0
- data/guides/DRY_RUN.md +390 -0
- data/guides/DSL_BASICS.md +216 -0
- data/guides/ERROR_HANDLING.md +187 -0
- data/guides/GETTING_STARTED.md +524 -0
- data/guides/INSTRUMENTATION.md +131 -0
- data/guides/LIFECYCLE_HOOKS.md +415 -0
- data/guides/NAMESPACES.md +75 -0
- data/guides/OPENTELEMETRY_INTEGRATION.md +86 -0
- data/guides/PARALLEL_PROCESSING.md +302 -0
- data/guides/PRODUCTION_DEPLOYMENT.md +110 -0
- data/guides/QUEUE_MANAGEMENT.md +141 -0
- data/guides/README.md +174 -0
- data/guides/SCHEDULED_JOBS.md +165 -0
- data/guides/STRUCTURED_LOGGING.md +268 -0
- data/guides/TASK_OUTPUTS.md +240 -0
- data/guides/TESTING_STRATEGY.md +56 -0
- data/guides/THROTTLING.md +198 -0
- data/guides/TROUBLESHOOTING.md +53 -0
- data/guides/WORKFLOW_COMPOSITION.md +675 -0
- data/guides/WORKFLOW_STATUS_QUERY.md +288 -0
- data/lib/job-workflow.rb +3 -0
- data/lib/job_workflow/argument_def.rb +16 -0
- data/lib/job_workflow/arguments.rb +40 -0
- data/lib/job_workflow/auto_scaling/adapter/aws_adapter.rb +66 -0
- data/lib/job_workflow/auto_scaling/adapter.rb +31 -0
- data/lib/job_workflow/auto_scaling/configuration.rb +85 -0
- data/lib/job_workflow/auto_scaling/executor.rb +43 -0
- data/lib/job_workflow/auto_scaling.rb +69 -0
- data/lib/job_workflow/cache_store_adapters.rb +46 -0
- data/lib/job_workflow/context.rb +352 -0
- data/lib/job_workflow/dry_run_config.rb +31 -0
- data/lib/job_workflow/dsl.rb +236 -0
- data/lib/job_workflow/error_hook.rb +24 -0
- data/lib/job_workflow/hook.rb +24 -0
- data/lib/job_workflow/hook_registry.rb +66 -0
- data/lib/job_workflow/instrumentation/log_subscriber.rb +194 -0
- data/lib/job_workflow/instrumentation/opentelemetry_subscriber.rb +221 -0
- data/lib/job_workflow/instrumentation.rb +257 -0
- data/lib/job_workflow/job_status.rb +92 -0
- data/lib/job_workflow/logger.rb +86 -0
- data/lib/job_workflow/namespace.rb +36 -0
- data/lib/job_workflow/output.rb +81 -0
- data/lib/job_workflow/output_def.rb +14 -0
- data/lib/job_workflow/queue.rb +74 -0
- data/lib/job_workflow/queue_adapter.rb +38 -0
- data/lib/job_workflow/queue_adapters/abstract.rb +87 -0
- data/lib/job_workflow/queue_adapters/null_adapter.rb +127 -0
- data/lib/job_workflow/queue_adapters/solid_queue_adapter.rb +224 -0
- data/lib/job_workflow/runner.rb +173 -0
- data/lib/job_workflow/schedule.rb +46 -0
- data/lib/job_workflow/semaphore.rb +71 -0
- data/lib/job_workflow/task.rb +83 -0
- data/lib/job_workflow/task_callable.rb +43 -0
- data/lib/job_workflow/task_context.rb +70 -0
- data/lib/job_workflow/task_dependency_wait.rb +66 -0
- data/lib/job_workflow/task_enqueue.rb +50 -0
- data/lib/job_workflow/task_graph.rb +43 -0
- data/lib/job_workflow/task_job_status.rb +70 -0
- data/lib/job_workflow/task_output.rb +51 -0
- data/lib/job_workflow/task_retry.rb +64 -0
- data/lib/job_workflow/task_throttle.rb +46 -0
- data/lib/job_workflow/version.rb +5 -0
- data/lib/job_workflow/workflow.rb +87 -0
- data/lib/job_workflow/workflow_status.rb +112 -0
- data/lib/job_workflow.rb +59 -0
- data/rbs_collection.lock.yaml +172 -0
- data/rbs_collection.yaml +14 -0
- data/sig/generated/job-workflow.rbs +2 -0
- data/sig/generated/job_workflow/argument_def.rbs +14 -0
- data/sig/generated/job_workflow/arguments.rbs +26 -0
- data/sig/generated/job_workflow/auto_scaling/adapter/aws_adapter.rbs +32 -0
- data/sig/generated/job_workflow/auto_scaling/adapter.rbs +22 -0
- data/sig/generated/job_workflow/auto_scaling/configuration.rbs +50 -0
- data/sig/generated/job_workflow/auto_scaling/executor.rbs +29 -0
- data/sig/generated/job_workflow/auto_scaling.rbs +47 -0
- data/sig/generated/job_workflow/cache_store_adapters.rbs +28 -0
- data/sig/generated/job_workflow/context.rbs +155 -0
- data/sig/generated/job_workflow/dry_run_config.rbs +16 -0
- data/sig/generated/job_workflow/dsl.rbs +117 -0
- data/sig/generated/job_workflow/error_hook.rbs +18 -0
- data/sig/generated/job_workflow/hook.rbs +18 -0
- data/sig/generated/job_workflow/hook_registry.rbs +47 -0
- data/sig/generated/job_workflow/instrumentation/log_subscriber.rbs +102 -0
- data/sig/generated/job_workflow/instrumentation/opentelemetry_subscriber.rbs +113 -0
- data/sig/generated/job_workflow/instrumentation.rbs +138 -0
- data/sig/generated/job_workflow/job_status.rbs +46 -0
- data/sig/generated/job_workflow/logger.rbs +56 -0
- data/sig/generated/job_workflow/namespace.rbs +24 -0
- data/sig/generated/job_workflow/output.rbs +39 -0
- data/sig/generated/job_workflow/output_def.rbs +12 -0
- data/sig/generated/job_workflow/queue.rbs +49 -0
- data/sig/generated/job_workflow/queue_adapter.rbs +18 -0
- data/sig/generated/job_workflow/queue_adapters/abstract.rbs +56 -0
- data/sig/generated/job_workflow/queue_adapters/null_adapter.rbs +73 -0
- data/sig/generated/job_workflow/queue_adapters/solid_queue_adapter.rbs +111 -0
- data/sig/generated/job_workflow/runner.rbs +66 -0
- data/sig/generated/job_workflow/schedule.rbs +34 -0
- data/sig/generated/job_workflow/semaphore.rbs +37 -0
- data/sig/generated/job_workflow/task.rbs +60 -0
- data/sig/generated/job_workflow/task_callable.rbs +30 -0
- data/sig/generated/job_workflow/task_context.rbs +52 -0
- data/sig/generated/job_workflow/task_dependency_wait.rbs +42 -0
- data/sig/generated/job_workflow/task_enqueue.rbs +27 -0
- data/sig/generated/job_workflow/task_graph.rbs +27 -0
- data/sig/generated/job_workflow/task_job_status.rbs +42 -0
- data/sig/generated/job_workflow/task_output.rbs +29 -0
- data/sig/generated/job_workflow/task_retry.rbs +30 -0
- data/sig/generated/job_workflow/task_throttle.rbs +20 -0
- data/sig/generated/job_workflow/version.rbs +5 -0
- data/sig/generated/job_workflow/workflow.rbs +48 -0
- data/sig/generated/job_workflow/workflow_status.rbs +55 -0
- data/sig/generated/job_workflow.rbs +8 -0
- data/sig-private/activejob.rbs +35 -0
- data/sig-private/activesupport.rbs +23 -0
- data/sig-private/aws.rbs +32 -0
- data/sig-private/opentelemetry.rbs +40 -0
- data/sig-private/solid_queue.rbs +108 -0
- data/tmp/.keep +0 -0
- metadata +190 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Generated from lib/job_workflow/schedule.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module JobWorkflow
|
|
4
|
+
class Schedule
|
|
5
|
+
attr_reader key: Symbol
|
|
6
|
+
|
|
7
|
+
attr_reader class_name: String
|
|
8
|
+
|
|
9
|
+
attr_reader expression: String
|
|
10
|
+
|
|
11
|
+
attr_reader queue: String?
|
|
12
|
+
|
|
13
|
+
attr_reader priority: Integer?
|
|
14
|
+
|
|
15
|
+
attr_reader args: Hash[Symbol, untyped]
|
|
16
|
+
|
|
17
|
+
attr_reader description: String?
|
|
18
|
+
|
|
19
|
+
# rubocop:disable Metrics/ParameterLists
|
|
20
|
+
# : (
|
|
21
|
+
# expression: String,
|
|
22
|
+
# class_name: String,
|
|
23
|
+
# ?key: (String | Symbol)?,
|
|
24
|
+
# ?queue: String?,
|
|
25
|
+
# ?priority: Integer?,
|
|
26
|
+
# ?args: Hash[Symbol, untyped],
|
|
27
|
+
# ?description: String?
|
|
28
|
+
# ) -> void
|
|
29
|
+
def initialize: (expression: String, class_name: String, ?key: (String | Symbol)?, ?queue: String?, ?priority: Integer?, ?args: Hash[Symbol, untyped], ?description: String?) -> void
|
|
30
|
+
|
|
31
|
+
# : () -> Hash[Symbol, untyped]
|
|
32
|
+
def to_config: () -> Hash[Symbol, untyped]
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Generated from lib/job_workflow/semaphore.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module JobWorkflow
|
|
4
|
+
class Semaphore
|
|
5
|
+
DEFAULT_POLLING_INTERVAL: Float
|
|
6
|
+
|
|
7
|
+
attr_reader concurrency_key: String
|
|
8
|
+
|
|
9
|
+
attr_reader concurrency_limit: Integer
|
|
10
|
+
|
|
11
|
+
attr_reader concurrency_duration: ActiveSupport::Duration
|
|
12
|
+
|
|
13
|
+
# : () -> bool
|
|
14
|
+
def self.available?: () -> bool
|
|
15
|
+
|
|
16
|
+
# : (
|
|
17
|
+
# concurrency_key: String,
|
|
18
|
+
# concurrency_duration: ActiveSupport::Duration,
|
|
19
|
+
# ?concurrency_limit: Integer,
|
|
20
|
+
# ?polling_interval: Float
|
|
21
|
+
# ) -> void
|
|
22
|
+
def initialize: (concurrency_key: String, concurrency_duration: ActiveSupport::Duration, ?concurrency_limit: Integer, ?polling_interval: Float) -> void
|
|
23
|
+
|
|
24
|
+
# : () -> bool
|
|
25
|
+
def wait: () -> bool
|
|
26
|
+
|
|
27
|
+
# : () -> bool
|
|
28
|
+
def signal: () -> bool
|
|
29
|
+
|
|
30
|
+
# : [T] () { () -> T } -> T
|
|
31
|
+
def with: [T] () { () -> T } -> T
|
|
32
|
+
|
|
33
|
+
private
|
|
34
|
+
|
|
35
|
+
attr_reader polling_interval: Float
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Generated from lib/job_workflow/task.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module JobWorkflow
|
|
4
|
+
class Task
|
|
5
|
+
attr_reader job_name: String
|
|
6
|
+
|
|
7
|
+
attr_reader namespace: Namespace
|
|
8
|
+
|
|
9
|
+
attr_reader block: ^(untyped) -> void
|
|
10
|
+
|
|
11
|
+
attr_reader each: ^(Context) -> untyped
|
|
12
|
+
|
|
13
|
+
attr_reader enqueue: TaskEnqueue
|
|
14
|
+
|
|
15
|
+
attr_reader output: Array[OutputDef]
|
|
16
|
+
|
|
17
|
+
attr_reader depends_on: Array[Symbol]
|
|
18
|
+
|
|
19
|
+
attr_reader condition: ^(Context) -> bool
|
|
20
|
+
|
|
21
|
+
attr_reader task_retry: TaskRetry
|
|
22
|
+
|
|
23
|
+
attr_reader throttle: TaskThrottle
|
|
24
|
+
|
|
25
|
+
attr_reader timeout: Numeric?
|
|
26
|
+
|
|
27
|
+
attr_reader dependency_wait: TaskDependencyWait
|
|
28
|
+
|
|
29
|
+
attr_reader dry_run_config: DryRunConfig
|
|
30
|
+
|
|
31
|
+
# rubocop:disable Metrics/ParameterLists, Metrics/MethodLength, Metrics/AbcSize
|
|
32
|
+
# : (
|
|
33
|
+
# job_name: String,
|
|
34
|
+
# name: Symbol,
|
|
35
|
+
# namespace: Namespace,
|
|
36
|
+
# block: ^(untyped) -> void,
|
|
37
|
+
# ?each: ^(Context) -> untyped,
|
|
38
|
+
# ?enqueue: true | false | ^(Context) -> bool | Hash[Symbol, untyped],
|
|
39
|
+
# ?output: Hash[Symbol, String],
|
|
40
|
+
# ?depends_on: Array[Symbol],
|
|
41
|
+
# condition: ^(Context) -> bool,
|
|
42
|
+
# ?task_retry: Integer | Hash[Symbol, untyped],
|
|
43
|
+
# ?throttle: Integer | Hash[Symbol, untyped],
|
|
44
|
+
# ?timeout: Numeric?,
|
|
45
|
+
# ?dependency_wait: Hash[Symbol, untyped],
|
|
46
|
+
# ?dry_run: bool | ^(Context) -> bool
|
|
47
|
+
# ) -> void
|
|
48
|
+
def initialize: (job_name: String, name: Symbol, namespace: Namespace, block: ^(untyped) -> void, condition: ^(Context) -> bool, ?each: ^(Context) -> untyped, ?enqueue: true | false | ^(Context) -> bool | Hash[Symbol, untyped], ?output: Hash[Symbol, String], ?depends_on: Array[Symbol], ?task_retry: Integer | Hash[Symbol, untyped], ?throttle: Integer | Hash[Symbol, untyped], ?timeout: Numeric?, ?dependency_wait: Hash[Symbol, untyped], ?dry_run: bool | ^(Context) -> bool) -> void
|
|
49
|
+
|
|
50
|
+
# : () -> Symbol
|
|
51
|
+
def task_name: () -> Symbol
|
|
52
|
+
|
|
53
|
+
# : () -> String
|
|
54
|
+
def throttle_prefix_key: () -> String
|
|
55
|
+
|
|
56
|
+
private
|
|
57
|
+
|
|
58
|
+
attr_reader name: Symbol
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Generated from lib/job_workflow/task_callable.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module JobWorkflow
|
|
4
|
+
class TaskCallable
|
|
5
|
+
class NotCalledError < StandardError
|
|
6
|
+
# : (Symbol) -> void
|
|
7
|
+
def initialize: (Symbol) -> void
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
class AlreadyCalledError < StandardError
|
|
11
|
+
# : () -> void
|
|
12
|
+
def initialize: () -> void
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# : () { () -> void } -> void
|
|
16
|
+
def initialize: () { () -> void } -> void
|
|
17
|
+
|
|
18
|
+
# : () -> void
|
|
19
|
+
def call: () -> void
|
|
20
|
+
|
|
21
|
+
# : () -> bool
|
|
22
|
+
def called?: () -> bool
|
|
23
|
+
|
|
24
|
+
private
|
|
25
|
+
|
|
26
|
+
attr_reader block: untyped
|
|
27
|
+
|
|
28
|
+
attr_accessor called: bool
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Generated from lib/job_workflow/task_context.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module JobWorkflow
|
|
4
|
+
class TaskContext
|
|
5
|
+
NULL_VALUE: nil
|
|
6
|
+
|
|
7
|
+
attr_reader task: Task?
|
|
8
|
+
|
|
9
|
+
attr_reader parent_job_id: String?
|
|
10
|
+
|
|
11
|
+
attr_reader index: Integer
|
|
12
|
+
|
|
13
|
+
attr_reader value: untyped
|
|
14
|
+
|
|
15
|
+
attr_reader retry_count: Integer
|
|
16
|
+
|
|
17
|
+
attr_reader dry_run: bool
|
|
18
|
+
|
|
19
|
+
# : (Hash[String, untyped]) -> TaskContext
|
|
20
|
+
def self.deserialize: (Hash[String, untyped]) -> TaskContext
|
|
21
|
+
|
|
22
|
+
# : (
|
|
23
|
+
# ?task: Task?,
|
|
24
|
+
# ?parent_job_id: String?,
|
|
25
|
+
# ?index: Integer,
|
|
26
|
+
# ?value: untyped,
|
|
27
|
+
# ?retry_count: Integer,
|
|
28
|
+
# ?dry_run: bool
|
|
29
|
+
# ) -> void
|
|
30
|
+
def initialize: (?task: Task?, ?parent_job_id: String?, ?index: Integer, ?value: untyped, ?retry_count: Integer, ?dry_run: bool) -> void
|
|
31
|
+
|
|
32
|
+
# : () -> bool
|
|
33
|
+
def enabled?: () -> bool
|
|
34
|
+
|
|
35
|
+
# : () -> Hash[String, untyped]
|
|
36
|
+
def serialize: () -> Hash[String, untyped]
|
|
37
|
+
|
|
38
|
+
private
|
|
39
|
+
|
|
40
|
+
attr_writer task: Task?
|
|
41
|
+
|
|
42
|
+
attr_writer parent_job_id: String?
|
|
43
|
+
|
|
44
|
+
attr_writer index: Integer
|
|
45
|
+
|
|
46
|
+
attr_writer value: untyped
|
|
47
|
+
|
|
48
|
+
attr_writer retry_count: Integer
|
|
49
|
+
|
|
50
|
+
attr_writer dry_run: bool
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Generated from lib/job_workflow/task_dependency_wait.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module JobWorkflow
|
|
4
|
+
# TaskDependencyWait holds configuration for waiting on dependent tasks.
|
|
5
|
+
#
|
|
6
|
+
# When a task has dependencies (depends_on:), the runner waits for those tasks to complete.
|
|
7
|
+
# This class configures how long to poll before rescheduling the job.
|
|
8
|
+
#
|
|
9
|
+
# @example Default behavior (polling only, no reschedule)
|
|
10
|
+
# task :process, depends_on: [:fetch]
|
|
11
|
+
#
|
|
12
|
+
# @example Wait up to 30 seconds with polling, then reschedule
|
|
13
|
+
# task :process, depends_on: [:fetch], dependency_wait: { poll_timeout: 30 }
|
|
14
|
+
#
|
|
15
|
+
# @example Wait 60 seconds total, poll every 10 seconds, reschedule after 5 seconds
|
|
16
|
+
# task :process, depends_on: [:fetch], dependency_wait: { poll_timeout: 60, poll_interval: 10, reschedule_delay: 5 }
|
|
17
|
+
class TaskDependencyWait
|
|
18
|
+
DEFAULT_POLL_TIMEOUT: Integer
|
|
19
|
+
|
|
20
|
+
DEFAULT_POLL_INTERVAL: Integer
|
|
21
|
+
|
|
22
|
+
DEFAULT_RESCHEDULE_DELAY: Integer
|
|
23
|
+
|
|
24
|
+
attr_reader poll_timeout: Integer
|
|
25
|
+
|
|
26
|
+
attr_reader poll_interval: Integer
|
|
27
|
+
|
|
28
|
+
attr_reader reschedule_delay: Integer
|
|
29
|
+
|
|
30
|
+
# : (Integer | Hash[Symbol, untyped] | nil) -> TaskDependencyWait
|
|
31
|
+
def self.from_primitive_value: (Integer | Hash[Symbol, untyped] | nil) -> TaskDependencyWait
|
|
32
|
+
|
|
33
|
+
# : (?poll_timeout: Integer, ?poll_interval: Integer, ?reschedule_delay: Integer) -> void
|
|
34
|
+
def initialize: (?poll_timeout: Integer, ?poll_interval: Integer, ?reschedule_delay: Integer) -> void
|
|
35
|
+
|
|
36
|
+
# : () -> bool
|
|
37
|
+
def polling_only?: () -> bool
|
|
38
|
+
|
|
39
|
+
# : (Time) -> bool
|
|
40
|
+
def polling_keep?: (Time) -> bool
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Generated from lib/job_workflow/task_enqueue.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module JobWorkflow
|
|
4
|
+
class TaskEnqueue
|
|
5
|
+
attr_reader condition: true | false | ^(Context) -> bool
|
|
6
|
+
|
|
7
|
+
attr_reader queue: String?
|
|
8
|
+
|
|
9
|
+
attr_reader concurrency: Integer?
|
|
10
|
+
|
|
11
|
+
# : (true | false | ^(Context) -> bool | Hash[Symbol, untyped] | nil) -> TaskEnqueue
|
|
12
|
+
def self.from_primitive_value: (true | false | ^(Context) -> bool | Hash[Symbol, untyped] | nil) -> TaskEnqueue
|
|
13
|
+
|
|
14
|
+
# : (
|
|
15
|
+
# ?condition: true | false | ^(Context) -> bool,
|
|
16
|
+
# ?queue: String?,
|
|
17
|
+
# ?concurrency: Integer?
|
|
18
|
+
# ) -> void
|
|
19
|
+
def initialize: (?condition: true | false | ^(Context) -> bool, ?queue: String?, ?concurrency: Integer?) -> void
|
|
20
|
+
|
|
21
|
+
# : (Context) -> bool
|
|
22
|
+
def should_enqueue?: (Context) -> bool
|
|
23
|
+
|
|
24
|
+
# : () -> bool
|
|
25
|
+
def should_limits_concurrency?: () -> bool
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Generated from lib/job_workflow/task_graph.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module JobWorkflow
|
|
4
|
+
class TaskGraph
|
|
5
|
+
include TSort[Task]
|
|
6
|
+
|
|
7
|
+
include Enumerable[Task]
|
|
8
|
+
|
|
9
|
+
# : () -> void
|
|
10
|
+
def initialize: () -> void
|
|
11
|
+
|
|
12
|
+
# : (Task) -> void
|
|
13
|
+
def add: (Task) -> void
|
|
14
|
+
|
|
15
|
+
# : (Symbol?) -> Task?
|
|
16
|
+
def fetch: (Symbol?) -> Task?
|
|
17
|
+
|
|
18
|
+
# : () { (Task) -> void } -> void
|
|
19
|
+
def each: () { (Task) -> void } -> void
|
|
20
|
+
|
|
21
|
+
# : () { (Task) -> void } -> void
|
|
22
|
+
def tsort_each_node: () { (Task) -> void } -> void
|
|
23
|
+
|
|
24
|
+
# : (Task task) { (Task) -> void } -> void
|
|
25
|
+
def tsort_each_child: (Task task) { (Task) -> void } -> void
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Generated from lib/job_workflow/task_job_status.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module JobWorkflow
|
|
4
|
+
class TaskJobStatus
|
|
5
|
+
attr_reader task_name: Symbol
|
|
6
|
+
|
|
7
|
+
attr_reader job_id: String
|
|
8
|
+
|
|
9
|
+
attr_reader each_index: Integer
|
|
10
|
+
|
|
11
|
+
attr_reader status: Symbol
|
|
12
|
+
|
|
13
|
+
# : (Hash[Symbol, untyped]) -> TaskJobStatus
|
|
14
|
+
def self.from_hash: (Hash[Symbol, untyped]) -> TaskJobStatus
|
|
15
|
+
|
|
16
|
+
# : (Hash[String, untyped]) -> TaskJobStatus
|
|
17
|
+
def self.deserialize: (Hash[String, untyped]) -> TaskJobStatus
|
|
18
|
+
|
|
19
|
+
# : (
|
|
20
|
+
# task_name: Symbol,
|
|
21
|
+
# job_id: String,
|
|
22
|
+
# each_index: Integer,
|
|
23
|
+
# ?status: Symbol
|
|
24
|
+
# ) -> void
|
|
25
|
+
def initialize: (task_name: Symbol, job_id: String, each_index: Integer, ?status: Symbol) -> void
|
|
26
|
+
|
|
27
|
+
# : (Symbol) -> void
|
|
28
|
+
def update_status: (Symbol) -> void
|
|
29
|
+
|
|
30
|
+
# : () -> bool
|
|
31
|
+
def finished?: () -> bool
|
|
32
|
+
|
|
33
|
+
# : () -> bool
|
|
34
|
+
def succeeded?: () -> bool
|
|
35
|
+
|
|
36
|
+
# : () -> bool
|
|
37
|
+
def failed?: () -> bool
|
|
38
|
+
|
|
39
|
+
# : () -> Hash[String, untyped]
|
|
40
|
+
def serialize: () -> Hash[String, untyped]
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Generated from lib/job_workflow/task_output.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module JobWorkflow
|
|
4
|
+
class TaskOutput
|
|
5
|
+
attr_reader task_name: Symbol
|
|
6
|
+
|
|
7
|
+
attr_reader each_index: Integer
|
|
8
|
+
|
|
9
|
+
attr_reader data: Hash[Symbol, untyped]
|
|
10
|
+
|
|
11
|
+
# : (task: Task, each_index: Integer, data: Hash[Symbol, untyped]) -> TaskOutput
|
|
12
|
+
def self.from_task: (task: Task, each_index: Integer, data: Hash[Symbol, untyped]) -> TaskOutput
|
|
13
|
+
|
|
14
|
+
# : (Hash[String, untyped]) -> TaskOutput
|
|
15
|
+
def self.deserialize: (Hash[String, untyped]) -> TaskOutput
|
|
16
|
+
|
|
17
|
+
# : (task_name: Symbol, each_index: Integer, ?data: Hash[Symbol, untyped]) -> void
|
|
18
|
+
def initialize: (task_name: Symbol, each_index: Integer, ?data: Hash[Symbol, untyped]) -> void
|
|
19
|
+
|
|
20
|
+
# : () -> Hash[String, untyped]
|
|
21
|
+
def serialize: () -> Hash[String, untyped]
|
|
22
|
+
|
|
23
|
+
# : ...
|
|
24
|
+
def method_missing: ...
|
|
25
|
+
|
|
26
|
+
# : (Symbol, bool) -> bool
|
|
27
|
+
def respond_to_missing?: (Symbol, bool) -> bool
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Generated from lib/job_workflow/task_retry.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module JobWorkflow
|
|
4
|
+
class TaskRetry
|
|
5
|
+
attr_reader count: Integer
|
|
6
|
+
|
|
7
|
+
attr_reader strategy: Symbol
|
|
8
|
+
|
|
9
|
+
attr_reader base_delay: Integer
|
|
10
|
+
|
|
11
|
+
attr_reader jitter: bool
|
|
12
|
+
|
|
13
|
+
# : (Integer | Hash[Symbol, untyped]) -> TaskRetry
|
|
14
|
+
def self.from_primitive_value: (Integer | Hash[Symbol, untyped]) -> TaskRetry
|
|
15
|
+
|
|
16
|
+
# : (?count: Integer, ?strategy: Symbol, ?base_delay: Integer, ?jitter: bool) -> void
|
|
17
|
+
def initialize: (?count: Integer, ?strategy: Symbol, ?base_delay: Integer, ?jitter: bool) -> void
|
|
18
|
+
|
|
19
|
+
# : (Integer) -> Float
|
|
20
|
+
def delay_for: (Integer) -> Float
|
|
21
|
+
|
|
22
|
+
private
|
|
23
|
+
|
|
24
|
+
# : (Integer) -> Integer
|
|
25
|
+
def calculate_base_delay: (Integer) -> Integer
|
|
26
|
+
|
|
27
|
+
# : (Integer) -> Float
|
|
28
|
+
def apply_jitter: (Integer) -> Float
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Generated from lib/job_workflow/task_throttle.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module JobWorkflow
|
|
4
|
+
class TaskThrottle
|
|
5
|
+
attr_reader key: String
|
|
6
|
+
|
|
7
|
+
attr_reader limit: Integer?
|
|
8
|
+
|
|
9
|
+
attr_reader ttl: Integer
|
|
10
|
+
|
|
11
|
+
# : (value: Integer | Hash[Symbol, untyped], task: Task) -> TaskThrottle
|
|
12
|
+
def self.from_primitive_value_with_task: (value: Integer | Hash[Symbol, untyped], task: Task) -> TaskThrottle
|
|
13
|
+
|
|
14
|
+
# : (key: String, ?limit: Integer?, ?ttl: Integer) -> void
|
|
15
|
+
def initialize: (key: String, ?limit: Integer?, ?ttl: Integer) -> void
|
|
16
|
+
|
|
17
|
+
# : () -> Semaphore?
|
|
18
|
+
def semaphore: () -> Semaphore?
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Generated from lib/job_workflow/workflow.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module JobWorkflow
|
|
4
|
+
class Workflow
|
|
5
|
+
attr_reader namespace: Namespace
|
|
6
|
+
|
|
7
|
+
attr_reader dry_run_config: DryRunConfig
|
|
8
|
+
|
|
9
|
+
# : () -> void
|
|
10
|
+
def initialize: () -> void
|
|
11
|
+
|
|
12
|
+
# : (bool | ^(Context) -> bool) -> void
|
|
13
|
+
def dry_run_config=: (bool | ^(Context) -> bool) -> void
|
|
14
|
+
|
|
15
|
+
# : (Namespace) { () -> void } -> void
|
|
16
|
+
def add_namespace: (Namespace) { () -> void } -> void
|
|
17
|
+
|
|
18
|
+
# : (Task) -> void
|
|
19
|
+
def add_task: (Task) -> void
|
|
20
|
+
|
|
21
|
+
# : (ArgumentDef) -> void
|
|
22
|
+
def add_argument: (ArgumentDef) -> void
|
|
23
|
+
|
|
24
|
+
# : (Schedule) -> void
|
|
25
|
+
def add_schedule: (Schedule) -> void
|
|
26
|
+
|
|
27
|
+
# : (Symbol, task_names: Array[Symbol], block: untyped) -> void
|
|
28
|
+
def add_hook: (Symbol, task_names: Array[Symbol], block: untyped) -> void
|
|
29
|
+
|
|
30
|
+
# : () -> HookRegistry
|
|
31
|
+
def hooks: () -> HookRegistry
|
|
32
|
+
|
|
33
|
+
# : () -> Array[Task]
|
|
34
|
+
def tasks: () -> Array[Task]
|
|
35
|
+
|
|
36
|
+
# : (Symbol?) -> Task?
|
|
37
|
+
def fetch_task: (Symbol?) -> Task?
|
|
38
|
+
|
|
39
|
+
# : () -> Array[ArgumentDef]
|
|
40
|
+
def arguments: () -> Array[ArgumentDef]
|
|
41
|
+
|
|
42
|
+
# : () -> Hash[Symbol, Hash[Symbol, untyped]]
|
|
43
|
+
def build_schedules_hash: () -> Hash[Symbol, Hash[Symbol, untyped]]
|
|
44
|
+
|
|
45
|
+
# : () -> Hash[Symbol, untyped]
|
|
46
|
+
def build_arguments_hash: () -> Hash[Symbol, untyped]
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Generated from lib/job_workflow/workflow_status.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module JobWorkflow
|
|
4
|
+
class WorkflowStatus
|
|
5
|
+
class NotFoundError < StandardError
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
type status_type = :pending | :running | :completed | :failed
|
|
9
|
+
|
|
10
|
+
attr_reader context: Context
|
|
11
|
+
|
|
12
|
+
attr_reader job_class_name: String
|
|
13
|
+
|
|
14
|
+
attr_reader status: status_type
|
|
15
|
+
|
|
16
|
+
# : (String) -> WorkflowStatus
|
|
17
|
+
def self.find: (String) -> WorkflowStatus
|
|
18
|
+
|
|
19
|
+
# : (job_id: String) -> WorkflowStatus?
|
|
20
|
+
def self.find_by: (job_id: String) -> WorkflowStatus?
|
|
21
|
+
|
|
22
|
+
# : (Hash[String, untyped]) -> WorkflowStatus
|
|
23
|
+
def self.from_job_data: (Hash[String, untyped]) -> WorkflowStatus
|
|
24
|
+
|
|
25
|
+
# : (context: Context, job_class_name: String, status: status_type) -> void
|
|
26
|
+
def initialize: (context: Context, job_class_name: String, status: status_type) -> void
|
|
27
|
+
|
|
28
|
+
# : () -> Symbol?
|
|
29
|
+
def current_task_name: () -> Symbol?
|
|
30
|
+
|
|
31
|
+
# : () -> Arguments
|
|
32
|
+
def arguments: () -> Arguments
|
|
33
|
+
|
|
34
|
+
# : () -> Output
|
|
35
|
+
def output: () -> Output
|
|
36
|
+
|
|
37
|
+
# : () -> JobStatus
|
|
38
|
+
def job_status: () -> JobStatus
|
|
39
|
+
|
|
40
|
+
# : () -> bool
|
|
41
|
+
def running?: () -> bool
|
|
42
|
+
|
|
43
|
+
# : () -> bool
|
|
44
|
+
def completed?: () -> bool
|
|
45
|
+
|
|
46
|
+
# : () -> bool
|
|
47
|
+
def failed?: () -> bool
|
|
48
|
+
|
|
49
|
+
# : () -> bool
|
|
50
|
+
def pending?: () -> bool
|
|
51
|
+
|
|
52
|
+
# : () -> Hash[Symbol, untyped]
|
|
53
|
+
def to_h: () -> Hash[Symbol, untyped]
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
module ActiveJob
|
|
2
|
+
def self.perform_all_later: (*ActiveJob::Base) -> void
|
|
3
|
+
|
|
4
|
+
module Continuable
|
|
5
|
+
def step: (Symbol, ?start: ActiveJob::Continuation::_Succ, ?isolated: bool) -> void
|
|
6
|
+
| (Symbol, ?start: ActiveJob::Continuation::_Succ, ?isolated: bool) { (ActiveJob::Continuation::Step) -> void } -> void
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
module Continuation
|
|
10
|
+
class Interrupt < StandardError
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
interface _Succ
|
|
14
|
+
def succ: () -> self
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
class Step
|
|
18
|
+
def advance!: (?from: _Succ?) -> void
|
|
19
|
+
|
|
20
|
+
def advanced?: () -> bool
|
|
21
|
+
|
|
22
|
+
def checkpoint!: () -> void
|
|
23
|
+
|
|
24
|
+
def description: () -> String
|
|
25
|
+
|
|
26
|
+
def initialize: (Symbol, _Succ, job: ActiveJob::Base, resumed: bool) -> void
|
|
27
|
+
|
|
28
|
+
def resumed?: () -> bool
|
|
29
|
+
|
|
30
|
+
def set!: (_Succ) -> void
|
|
31
|
+
|
|
32
|
+
def to_a: () -> [String, _Succ]
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module ActiveSupport
|
|
2
|
+
module Notifications
|
|
3
|
+
# Interface for start/finish subscribers (Monotonic subscriber)
|
|
4
|
+
interface _StartFinishSubscriber
|
|
5
|
+
def start: (String, String, Hash[Symbol, untyped]) -> void
|
|
6
|
+
def finish: (String, String, Hash[Symbol, untyped]) -> void
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
# Allow start/finish subscriber objects
|
|
10
|
+
def self.subscribe: (String | Regexp, _StartFinishSubscriber) -> Subscriber
|
|
11
|
+
| ...
|
|
12
|
+
|
|
13
|
+
# Allow instrument with a no-arg block
|
|
14
|
+
def self.instrument: (String name, ?Hash[untyped, untyped] payload) ?{ () -> untyped } -> untyped
|
|
15
|
+
| ...
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
module Cache
|
|
19
|
+
# SolidCacheStore is an optional cache store provided by the solid_cache gem
|
|
20
|
+
class SolidCacheStore < Store
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
data/sig-private/aws.rbs
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module Aws
|
|
2
|
+
module ECS
|
|
3
|
+
class Client
|
|
4
|
+
def describe_services: (Hash[untyped, untyped]) -> Types::DescribeServicesResponse
|
|
5
|
+
def describe_tasks: (Hash[untyped, untyped]) -> Types::DescribeTasksResponse
|
|
6
|
+
def update_service: (Hash[untyped, untyped]) -> Types::UpdateServiceResponse
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
module Types
|
|
10
|
+
class Task
|
|
11
|
+
def group: () -> String
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
class Service
|
|
15
|
+
def cluster_arn: () -> String
|
|
16
|
+
def service_name: () -> String
|
|
17
|
+
def desired_count: () -> Integer
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
class DescribeTasksResponse
|
|
21
|
+
def tasks: () -> Array[Task]
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
class DescribeServicesResponse
|
|
25
|
+
def services: () -> Array[Service]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
class UpdateServiceResponse
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|