lambdakiq 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/README.md +4 -15
- data/lib/lambdakiq/version.rb +1 -1
- data/lib/lambdakiq.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84d147fdbb851da5e7e6ebace4cd2eb5a00ae53d3bd0d36981d9cb90c93bac5b
|
4
|
+
data.tar.gz: 534d3f92cde56e7462202ebfd0b828039974d37792ee19d4c30b64ea0e901d61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cff69c86fae5f46a63cfbd7ee6290fb8aa472a6dc1377424df1cf8daf17ca96c373a87577c4f50ebaf081d8c9b13421e032f8b71b314cbd4135ec2ca7ca7dfe
|
7
|
+
data.tar.gz: bed7c2407983c15b2ed48ba63362afe7b7a305c7415ec0deb533e25928ea805b8b5c8ad91bbeee4b51a7d3b69008e4854910b9093f392f454fdb78c8e8550db6
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -56,21 +56,7 @@ ActionMailer::MailDeliveryJob.include Lambdakiq::Worker
|
|
56
56
|
ActionMailer::MailDeliveryJob.queue_as ENV['JOBS_QUEUE_NAME']
|
57
57
|
```
|
58
58
|
|
59
|
-
The same Docker image will be used for both your `web` and `jobs` functions (example setup in following sections)
|
60
|
-
|
61
|
-
```ruby
|
62
|
-
def handler(event:, context:)
|
63
|
-
Lamby.handler $app, event, context
|
64
|
-
end
|
65
|
-
```
|
66
|
-
|
67
|
-
You can use the Lambdakiq handler directly in cases where your handler is a different method. Likewise there is a `Lambdakiq.jobs?(event)` helper function which returns true if the `messageAttributes` has a `lambdakiq` attribute.
|
68
|
-
|
69
|
-
```ruby
|
70
|
-
def jobs_handler(event:, context:)
|
71
|
-
Lambdakiq.handler(event)
|
72
|
-
end
|
73
|
-
```
|
59
|
+
The same Docker image will be used for both your `web` and `jobs` functions (example setup in following sections). The [Lamby](https://lamby.custominktech.com) gem can automatically can detect if Lambdakiq is present when using the newer `Lamby.cmd` or older lower `Lamby.handler` method. That said, please take a look at the `JobsLambda` in the following section and how `ImageConfig` is used as the golden path for sharing containers.
|
74
60
|
|
75
61
|
### SQS Resources
|
76
62
|
|
@@ -146,6 +132,8 @@ JobsLambda:
|
|
146
132
|
BatchSize: 1
|
147
133
|
FunctionResponseTypes:
|
148
134
|
- ReportBatchItemFailures
|
135
|
+
ImageConfig:
|
136
|
+
Command: ["config/environment.Lambdakiq.cmd"]
|
149
137
|
MemorySize: 1792
|
150
138
|
PackageType: Image
|
151
139
|
Policies:
|
@@ -161,6 +149,7 @@ JobsLambda:
|
|
161
149
|
|
162
150
|
Here are some key aspects of our `JobsLambda` resource above:
|
163
151
|
|
152
|
+
- We use the `ImageConfig.Command` to load your Rails env and invoke the `Lambdakiq.cmd` which calls the `Lambdakiq.handler` on your behalf.
|
164
153
|
- The `Events` property uses the [SQS Type](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-sqs.html).
|
165
154
|
- The [BatchSize](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-sqs.html#sam-function-sqs-batchsize) can be any number you like. Less means more Lambda concurrency, more means some jobs could take longer. The jobs function `Timeout` must be lower than the `JobsQueue`'s `VisibilityTimeout` property. When the batch size is one, the queue's visibility is generally one second more.
|
166
155
|
- You must use `ReportBatchItemFailures` response types. Lambdakiq assumes we are [reporting batch item failures](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-batchfailurereporting). This is a new feature of SQS introduced in [November 2021](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-batchfailurereporting).
|
data/lib/lambdakiq/version.rb
CHANGED
data/lib/lambdakiq.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lambdakiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ken Collins
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|