event_people 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -0
- data/Gemfile.lock +2 -1
- data/README.md +2 -2
- data/bin/setup +8 -0
- data/examples/listener.rb +6 -1
- data/lib/event_people/broker/rabbit/queue.rb +2 -1
- data/lib/event_people/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2edc78cae5809676875057845aa4646b5b7c2cf10b2c0cd19a3db4303c20ed6d
|
4
|
+
data.tar.gz: f02920c4bcc5fa8851677050e33ad91fe09a647f598ae6bb5b955e0a72bafcf6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38b52078fbdf1dc410aba893b0269dc39bdfef91a651975100c3ec0d236e2dace74b3bda66e9d0fa9f9c0a8287cddeb0c369afe32c65a94fb00384acc41282cf
|
7
|
+
data.tar.gz: ebf453a791a7184943d92157b8bf693712e94f4fb40146cf3db4f76e10c4b35e0cf9b1de03cfe20619076226c4a3e5b546865c3d6bb2a53d5e49c386d263268e
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -224,7 +224,7 @@ EventPeople::Daemon.start
|
|
224
224
|
|
225
225
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
226
226
|
|
227
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
227
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
228
228
|
|
229
229
|
## Contributing
|
230
230
|
|
@@ -236,4 +236,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
236
236
|
|
237
237
|
## License
|
238
238
|
|
239
|
-
The gem is available as open source under the terms of the [
|
239
|
+
The gem is available as open source under the terms of the [LGPL 3.0 License](https://www.gnu.org/licenses/lgpl-3.0.en.html).
|
data/bin/setup
ADDED
data/examples/listener.rb
CHANGED
@@ -17,13 +17,18 @@ event_name = 'resource.origin.action'
|
|
17
17
|
|
18
18
|
puts 'Start receiving messages'
|
19
19
|
|
20
|
-
EventPeople::Listener.on(event_name) do |event|
|
20
|
+
EventPeople::Listener.on(event_name) do |event, context|
|
21
21
|
puts ''
|
22
22
|
puts " - Received a message from #{event.name}:"
|
23
23
|
puts " Message: #{event.body}"
|
24
24
|
puts ''
|
25
|
+
|
26
|
+
context.success!
|
25
27
|
end
|
26
28
|
|
29
|
+
# Wait for job to finish!
|
30
|
+
sleep(0.5)
|
31
|
+
|
27
32
|
puts 'Stop receiving messages'
|
28
33
|
|
29
34
|
EventPeople::Config.broker.close_connection
|
@@ -29,8 +29,9 @@ module EventPeople
|
|
29
29
|
event_name = delivery_info.routing_key
|
30
30
|
|
31
31
|
event = EventPeople::Event.new(event_name, payload)
|
32
|
+
context = EventPeople::Listeners::Base.new(channel, delivery_info)
|
32
33
|
|
33
|
-
block.call(event,
|
34
|
+
block.call(event, context)
|
34
35
|
end
|
35
36
|
|
36
37
|
def topic
|
data/lib/event_people/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: event_people
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pin People
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -97,6 +97,7 @@ files:
|
|
97
97
|
- LICENSE.txt
|
98
98
|
- README.md
|
99
99
|
- Rakefile
|
100
|
+
- bin/setup
|
100
101
|
- event_people.gemspec
|
101
102
|
- examples/daemon.rb
|
102
103
|
- examples/emitter.rb
|