dapr 0.1.21 → 0.1.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/Readme.adoc +3 -3
- data/lib/dapr/service/subscriber.rb +12 -2
- data/lib/dapr/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3594c97afeef8db520aea812dae24e17f6e443d50b455aa63904e41b9556f8e
|
4
|
+
data.tar.gz: 209e77fc0eeba207f142c8d07cc0107bf27b8c4b98dd48cc764e901893797160
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f4176d49928933f38bc12c3eb2a1d68c46ab8b02e5b4ea74911df9747ab7aba4b20ce5021e43cf6c2d7fcc32d50ecd7ca6724de4690aa4d01e5cca78f91d10c
|
7
|
+
data.tar.gz: 73b1e732fa7d3dce83f35c6e155ae1c79e90676dffdee79439f206a4950057d601357d60af6f286764f96f9e288ec5812656538a6a257b29d93f8edf12a4f94b
|
data/.rubocop.yml
CHANGED
data/Readme.adoc
CHANGED
@@ -26,7 +26,7 @@ Documentation will be added as the library matures.
|
|
26
26
|
|
27
27
|
== Installation
|
28
28
|
|
29
|
-
Install the gem and add to the application's Gemfile by executing:
|
29
|
+
Install the gem and add it to the application's Gemfile by executing:
|
30
30
|
|
31
31
|
$ bundle add dapr --require dapr/client
|
32
32
|
|
@@ -71,7 +71,7 @@ TIP: JSON is our default serializer. To use a different serializer, you can pass
|
|
71
71
|
|
72
72
|
==== Subscribe to topics
|
73
73
|
|
74
|
-
Subscriptions in Dapr work a little
|
74
|
+
Subscriptions in Dapr work a little differently than you may be used to. Instead of subscribing to a topic
|
75
75
|
then looping through consumed messages, you define a fully-fledged service that Dapr will
|
76
76
|
send each message to in the topic(s) that you specify. This unique approach allows you to
|
77
77
|
focus on the business logic of your service, rather than the plumbing of message consumption.
|
@@ -133,7 +133,7 @@ Implementation of {cryptography-block}
|
|
133
133
|
|
134
134
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
135
135
|
|
136
|
-
To install this gem
|
136
|
+
To install this gem on your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to https://rubygems.org[rubygems.org].
|
137
137
|
|
138
138
|
== Contributing
|
139
139
|
|
@@ -13,6 +13,15 @@ module Rubyists
|
|
13
13
|
|
14
14
|
attr_reader(:service_proto, :runtime_proto, :pubsub_name, :topics, :handler)
|
15
15
|
|
16
|
+
# Create a new Subscriber instance.
|
17
|
+
#
|
18
|
+
# @param [String] pubsub_name name of the pubsub component
|
19
|
+
# @param [String|Array<String>] topics topic (or topics) to subscribe to
|
20
|
+
# @param [Proc|Object] handler handler to call when an event is received. Must respond to #call
|
21
|
+
# @param [Class] service_proto Dapr Runtime Service Class to use for the subscriber
|
22
|
+
# @param [Module] runtime_proto Dapr Runtime Proto Module to use for the subscriber
|
23
|
+
#
|
24
|
+
# @return [Subscriber] the subscriber instance
|
16
25
|
def initialize(pubsub_name:,
|
17
26
|
topics:,
|
18
27
|
handler: nil,
|
@@ -38,9 +47,10 @@ module Rubyists
|
|
38
47
|
def start!(grpc_port: nil, listen_address: '0.0.0.0')
|
39
48
|
server = GRPC::RpcServer.new
|
40
49
|
grpc_port ||= port
|
41
|
-
|
50
|
+
listener = "#{listen_address}:#{grpc_port}"
|
51
|
+
server.add_http2_port(listener, :this_port_is_insecure)
|
42
52
|
server.handle(service)
|
43
|
-
logger.warn('Starting Dapr Subscriber service', grpc_port:)
|
53
|
+
logger.warn('Starting Dapr Subscriber service', listen_address:, grpc_port:)
|
44
54
|
server.run_till_terminated_or_interrupted([1, +'int', +'SIGQUIT'])
|
45
55
|
self
|
46
56
|
end
|
data/lib/dapr/version.rb
CHANGED