dapr 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Readme.adoc +25 -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: e5be2c698d6a8d00b8b21f5238aa7942a1cacf38a4aea6a5c3a0584d93b472a9
|
4
|
+
data.tar.gz: 64d6da53862a61af5aaca44895040e18564c29a652736abfec4211ec2c87f3ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5e3feb9da80ab6d26593634ad56b3a6f5b1d82b19d987a697e26951e2e8a218a85ef29889dd5638d05b73f7c028192727a1b405257665f124464ddd137dd520
|
7
|
+
data.tar.gz: ee01d6c05817cfc6737b6371e5a9bd6785831372094d8f369b2b9a5168d286ec3bf6d09264318944d67bf139c7f853d669acff92af4d22da1db14b8454934c78
|
data/Readme.adoc
CHANGED
@@ -6,24 +6,46 @@
|
|
6
6
|
:caution-caption: :fire:
|
7
7
|
:warning-caption: :warning:
|
8
8
|
endif::[]
|
9
|
+
:dapr-building-block: https://docs.dapr.io/concepts/building-blocks-overview/[Dapr Building Block]
|
9
10
|
|
10
11
|
== Overview
|
11
12
|
|
12
13
|
This library provides a Ruby client for the Dapr runtime. It is a work in progress and is not yet ready for production use.
|
13
14
|
|
15
|
+
Documentation will be added as the library matures.
|
16
|
+
|
14
17
|
== Installation
|
15
18
|
|
16
19
|
Install the gem and add to the application's Gemfile by executing:
|
17
20
|
|
18
|
-
$ bundle add dapr
|
21
|
+
$ bundle add dapr --require dapr/client
|
19
22
|
|
20
23
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
21
24
|
|
22
|
-
$ gem install dapr
|
25
|
+
$ gem install dapr
|
23
26
|
|
24
27
|
== Usage
|
25
28
|
|
26
|
-
|
29
|
+
Dapr being such a kitchen sink, the client exposes each dapr building block as either a
|
30
|
+
client or a service, depending on whether it uses the AppCallback runtime (Service) or
|
31
|
+
the Dapr API (Client). The clients art thin wrappers around the Dapr API, while the service
|
32
|
+
is a more opinionated and higher-level abstraction.
|
33
|
+
|
34
|
+
Each {dapr-building-block} is exposed as a class under the `Rubyists::Dapr::Client` or
|
35
|
+
`Rubyists::Dapr::Service` namespace.
|
36
|
+
|
37
|
+
=== Publish a message
|
38
|
+
|
39
|
+
[source,ruby]
|
40
|
+
----
|
41
|
+
require 'dapr/client/publisher'
|
42
|
+
ENV['DAPR_GRPC_PORT'] = '3500' <1>
|
43
|
+
publisher = Rubyists::Dapr::Client::Publisher.new('pubsub-name') <2>
|
44
|
+
publisher.publish('topic-name', { message: 'Hello, Dapr!', from: 'Ruby' })
|
45
|
+
----
|
46
|
+
<1> Set the Dapr gRPC port to the Dapr runtime port. (This is automatically set in kubernetes environments)
|
47
|
+
<2> Create a new publisher for the `pubsub-name` pubsub component. This component must be defined in the Dapr runtime.
|
48
|
+
<3> Publish a message to the `topic-name` topic.
|
27
49
|
|
28
50
|
== Development
|
29
51
|
|
data/lib/dapr/version.rb
CHANGED