dapr 0.1.19 → 0.1.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Readme.adoc +15 -7
- 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: fdf83662412d807b7dc76ff2e4bd51bf2ebbad695a7662ec88033cea4c6d87ac
|
4
|
+
data.tar.gz: aeb5cc9b26d7060985e72e3211caf4187e3a46f5f4a4a05675e6711dca4e5350
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8735f21119190abe0a6b907aba635fd60986af1472787c45f406adb71d58fe66a772b4a7915a74308d8807a97a2e7689fd7bdf16b50803e965c084b1c5838fb
|
7
|
+
data.tar.gz: d2f8fe56cab2649512debdfc09ef3eb99cbda0f9edde1108a8b8dbe9f9c1307df5b813b8ebf3cd07f295c88587161058df22404d8bc66578049b9f2ba51e5cf2
|
data/Readme.adoc
CHANGED
@@ -36,11 +36,17 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
36
36
|
|
37
37
|
== Usage
|
38
38
|
|
39
|
-
Dapr being such a kitchen sink,
|
40
|
-
|
41
|
-
the Dapr API (Client). The clients
|
42
|
-
|
39
|
+
Dapr being such a kitchen sink, this library exposes each {dapr-building-block} as either a
|
40
|
+
Client or a Service, depending on whether it uses the AppCallback runtime (Service) or
|
41
|
+
the Dapr API (Client). The clients are thin wrappers around the Dapr API, while the service
|
42
|
+
implementations will be more opinionated, higher-level abstractions. See the specific section on
|
43
|
+
the building block you are interested in for its usage information.
|
43
44
|
|
45
|
+
== Building Blocks
|
46
|
+
|
47
|
+
=== Namespace Convention
|
48
|
+
|
49
|
+
In order to avoid conflicts with any other `Dapr` top level namespace(s),
|
44
50
|
Each {dapr-building-block} is exposed as a class under the `Rubyists::Dapr::Client` or
|
45
51
|
`Rubyists::Dapr::Service` namespace.
|
46
52
|
|
@@ -55,17 +61,19 @@ Implementation of {pubsub-block}
|
|
55
61
|
require 'dapr/client/publisher'
|
56
62
|
ENV['DAPR_GRPC_PORT'] = '3500' <1>
|
57
63
|
publisher = Rubyists::Dapr::Client::Publisher.new('pubsub-name') <2>
|
58
|
-
publisher.publish('topic-name', { message: 'Hello, Dapr!', from: 'Ruby' })
|
64
|
+
publisher.publish('topic-name', { message: 'Hello, Dapr!', from: 'Ruby' }) <3>
|
59
65
|
----
|
60
66
|
<1> Set the Dapr gRPC port to the Dapr runtime port. (This is automatically set in kubernetes environments)
|
61
67
|
<2> Create a new publisher for the `pubsub-name` pubsub component. This component must be defined in the Dapr runtime.
|
62
|
-
<3> Publish a message to the `topic-name` topic.
|
68
|
+
<3> Publish a message to the `topic-name` topic. The message can be any Ruby object that can be serialized to JSON.
|
69
|
+
+
|
70
|
+
TIP: JSON is our default serializer. To use a different serializer, you can pass a `serializer:` argument to the publisher's initializer
|
63
71
|
|
64
72
|
==== Subscribe to topics
|
65
73
|
|
66
74
|
Subscriptions in Dapr work a little different than you may be used to. Instead of subscribing to a topic
|
67
75
|
then looping through consumed messages, you define a fully-fledged service that Dapr will
|
68
|
-
send each message to in the topic(s) that you specify. This unique
|
76
|
+
send each message to in the topic(s) that you specify. This unique approach allows you to
|
69
77
|
focus on the business logic of your service, rather than the plumbing of message consumption.
|
70
78
|
|
71
79
|
[source,ruby]
|
data/lib/dapr/version.rb
CHANGED