dapr 0.1.22 → 0.1.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Readme.adoc +3 -3
- data/lib/dapr/service/subscriber.rb +13 -3
- 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: 3f9f12b47b2ab348b8b9f5095344b65bb4da63c278cfb4dcf56ca8b12f7cd67a
|
4
|
+
data.tar.gz: 7908909ca89827446908d97dc90c067893e1d8ddaf2d713cb5d12ea659b28ea4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9f2864759062b40a8d69f964e827c58de2044dfdcb10d17e055ac9c1ab1b8f52f1a762ae1e3d60c3de9bd3949acfdd717c3f3b404e649a13b5fe1db7f8287ce
|
7
|
+
data.tar.gz: e3aa1f63899f004c65985f3169f0ea70aae72b541df1d9977d6da234244e3db21054920cb8b1efcbd5fe9cb8efb9d98a66ef81f5fbffb746b48699f40a8dce3d
|
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
|
|
@@ -11,8 +11,17 @@ module Rubyists
|
|
11
11
|
class Subscriber
|
12
12
|
include SemanticLogger::Loggable
|
13
13
|
|
14
|
-
attr_reader
|
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