Module: SfnJob
- Defined in:
- lib/sfn_job.rb,
lib/sfn_job/runner.rb,
lib/sfn_job/version.rb,
lib/sfn_job/configuration.rb
Defined Under Namespace
Classes: Configuration, Runner
Constant Summary
collapse
- MAX_SERIALIZED_JOB_SIZE =
60_000
- VERSION =
"0.1.2"
Class Method Summary
collapse
Class Method Details
.config ⇒ Object
25
26
27
|
# File 'lib/sfn_job.rb', line 25
def config
@config ||= Configuration.new
end
|
21
22
23
|
# File 'lib/sfn_job.rb', line 21
def configure
yield config
end
|
.deserialize(serialized_job) ⇒ Object
51
52
53
|
# File 'lib/sfn_job.rb', line 51
def deserialize(serialized_job)
JSON.parse(serialized_job)
end
|
.enqueue(job) ⇒ Object
29
30
31
32
33
34
35
|
# File 'lib/sfn_job.rb', line 29
def enqueue(job)
sfn_client.start_execution({
state_machine_arn: build_arn(job.queue_name),
name: "#{job.class.name}-#{job.job_id}",
input: serialize(job),
})
end
|
.sfn_client ⇒ Object
37
38
39
|
# File 'lib/sfn_job.rb', line 37
def sfn_client
@sfn_client ||= Aws::States::Client.new(region: config.region, stub_responses: config.stub_sfn_client)
end
|