pwwka 0.22.0.RC2 → 0.22.2.RC2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pwwka.rb +1 -1
- data/lib/pwwka/send_message_async_sidekiq_job.rb +23 -20
- data/lib/pwwka/transmitter.rb +0 -1
- data/lib/pwwka/version.rb +3 -2
- 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: 1d0298c5a0f635b09568c5b6b292b7ca1a05b86f8a06e3585f0a3d800d8a996b
|
4
|
+
data.tar.gz: 4c47bf2d72bf028d8b27779727736769cfddc54a9d93893ab61efff12aa64008
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc345b5236032d09a2fc29e642996dee53c1a58b6e98d04019c037d2e295c1f4403c9eb302d37fae41a11d76829e6df29cc183d3cca77ea44576663892232642
|
7
|
+
data.tar.gz: a6e774210fd2be5484520a8f844ff409751e30b913e918d2ed6fea23d4e0b45cff12f9b1e047018a57c701ff8fb9146a140854b719708ecec9d7e606f5f8554c
|
data/lib/pwwka.rb
CHANGED
@@ -30,5 +30,5 @@ require 'pwwka/transmitter'
|
|
30
30
|
require 'pwwka/message_queuer'
|
31
31
|
require 'pwwka/error_handlers'
|
32
32
|
require 'pwwka/configuration'
|
33
|
-
require 'pwwka/send_message_async_sidekiq_job'
|
34
33
|
require 'pwwka/send_message_async_job'
|
34
|
+
require 'pwwka/send_message_async_sidekiq_job'
|
@@ -1,29 +1,32 @@
|
|
1
|
-
|
1
|
+
begin # in case the app doesn't use Sidekiq
|
2
|
+
require 'sidekiq'
|
2
3
|
|
3
|
-
module Pwwka
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
module Pwwka
|
5
|
+
class SendMessageAsyncSidekiqJob
|
6
|
+
include Sidekiq::Worker
|
7
|
+
extend Pwwka::Logging
|
7
8
|
|
8
|
-
|
9
|
+
sidekiq_options queue: 'pwwka_send_message_async', retry: 3
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
def perform(payload, routing_key, options = {})
|
12
|
+
type = options["type"]
|
13
|
+
message_id = options["message_id"] || "auto_generate"
|
14
|
+
headers = options["headers"]
|
14
15
|
|
15
|
-
|
16
|
+
logger.info("Sending message async #{routing_key}, #{payload}")
|
16
17
|
|
17
|
-
|
18
|
+
message_id = message_id.to_sym if message_id == "auto_generate"
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
20
|
+
Pwwka::Transmitter.send_message!(
|
21
|
+
payload,
|
22
|
+
routing_key,
|
23
|
+
type: type,
|
24
|
+
message_id: message_id,
|
25
|
+
headers: headers,
|
26
|
+
on_error: :raise,
|
27
|
+
)
|
28
|
+
end
|
27
29
|
end
|
28
30
|
end
|
31
|
+
rescue LoadError
|
29
32
|
end
|
data/lib/pwwka/transmitter.rb
CHANGED
data/lib/pwwka/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pwwka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.22.
|
4
|
+
version: 0.22.2.RC2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stitch Fix Engineering
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2019-01-
|
18
|
+
date: 2019-01-15 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: bunny
|