dapr 0.1.17 → 0.1.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/Readme.adoc +76 -2
  3. data/lib/dapr/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 13ce22237006e209c4a40049d3a95efc8f1ce02ac0381453a7c67c1171a9f212
4
- data.tar.gz: 8a0f1317ea37de9b33ccffdfb714d25e3ff946dc58562a783c6e082f638dc237
3
+ metadata.gz: 67d8484ce4365b192ba1756fa63085371e3224370b500a341a3ca2428581a0d3
4
+ data.tar.gz: c97c4d0b0e40940039f83dc041a81897b958086ba38d1a96b560d6e86dc25874
5
5
  SHA512:
6
- metadata.gz: 6f871e883715d58a76177a9dbeb52a27ef43eeb5c49e71aaf0fbe844594b81ffaa5e760ae4ecf42fac5a3f1d2904f35194bcf309611aeb256d6b8b4543c4c6f1
7
- data.tar.gz: 5875a5e190d97170fb58fc60f8a99be4aeb85280a46d66794ae8e390f390dae3c2e9d82cbb3cf4a0d7c1ca13f9fbba38edd49380a5427817cd93fce20c7b202f
6
+ metadata.gz: b19abf8c5983476ee14abfe9235fc84f34055a6ab49148bc9eef369a56ee20ca56e5f36e491e1de0e08c3c5cf85b3cb1bc4aad8696f442aaa21eb041f3e5f461
7
+ data.tar.gz: 565d9d2296feda65259fc5c0b30c5f462a6c44399ae97b7b3d1581751e541c9dc46fa9a1023bfe0924358b3ef870a5c857b17dd9b1263e03531606f8a286c47a
data/Readme.adoc CHANGED
@@ -6,7 +6,17 @@
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
+ :dapr-building-block: https://docs.dapr.io/concepts/building-blocks-concept/[Dapr Building Block]
10
+ :pubsub-block: https://docs.dapr.io/developing-applications/building-blocks/pubsub/pubsub-overview/[Dapr Pub/Sub Building Block]
11
+ :state-block: https://docs.dapr.io/developing-applications/building-blocks/state-management/state-management-overview/[Dapr State Management Building Block]
12
+ :actors-block: https://docs.dapr.io/developing-applications/building-blocks/actors/actors-overview/[Dapr Actor Building Block]
13
+ :binding-block: https://docs.dapr.io/developing-applications/building-blocks/bindings/bindings-overview/[Dapr Binding Building Block]
14
+ :secret-block: https://docs.dapr.io/developing-applications/building-blocks/secrets/secrets-overview/[Dapr Secret Building Block]
15
+ :configuration-block: https://docs.dapr.io/developing-applications/building-blocks/configuration/configuration-api-overview/[Dapr Configuration Building Block]
16
+ :distributed-lock-block: https://docs.dapr.io/developing-applications/building-blocks/distributed-lock/distributed-lock-api-overview/[Dapr Distributed Lock Building Block]
17
+ :workflow-block: https://docs.dapr.io/developing-applications/building-blocks/workflow/workflow-overview/[Dapr Workflow Building Block]
18
+ :cryptography-block: https://docs.dapr.io/developing-applications/building-blocks/cryptography/cryptography-overview/[Dapr Cryptography Building Block]
19
+
10
20
 
11
21
  == Overview
12
22
 
@@ -34,7 +44,11 @@ is a more opinionated and higher-level abstraction.
34
44
  Each {dapr-building-block} is exposed as a class under the `Rubyists::Dapr::Client` or
35
45
  `Rubyists::Dapr::Service` namespace.
36
46
 
37
- === Publish a message
47
+ === Pub/Sub
48
+
49
+ Implementation of {pubsub-block}
50
+
51
+ ==== Publish a message
38
52
 
39
53
  [source,ruby]
40
54
  ----
@@ -47,6 +61,66 @@ publisher.publish('topic-name', { message: 'Hello, Dapr!', from: 'Ruby' })
47
61
  <2> Create a new publisher for the `pubsub-name` pubsub component. This component must be defined in the Dapr runtime.
48
62
  <3> Publish a message to the `topic-name` topic.
49
63
 
64
+ ==== Subscribe to topics
65
+
66
+ Subscriptions in Dapr work a little different than you may be used to. Instead of subscribing to a topic
67
+ 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 appreach allows you to
69
+ focus on the business logic of your service, rather than the plumbing of message consumption.
70
+
71
+ [source,ruby]
72
+ ----
73
+ require 'dapr/service/subscriber'
74
+ handler = ->(event) { puts "Got event: #{event}" } <1>
75
+ pubsub_name = 'pubsub' <2>
76
+ topics = 'TOPIC-A' <3>
77
+ sub = Rubyists::Dapr::Service::Subscriber.new(pubsub_name:, topics:, handler:) <4>
78
+ sub.start! <5>
79
+ ----
80
+ <1> Define a handler that will be called for each message received. `event` will be a `CloudEvents::Event` instance.
81
+ +
82
+ NOTE: The handler can be anything that responds to `#call`, such as a lambda, proc, or instance. Sky's the limit! (Dependency injection, anyone?)
83
+ +
84
+ <2> The name of the Dapr pubsub component this subscriber will utilize.
85
+ <3> The name of the topic(s) to subscribe to.
86
+ +
87
+ TIP: Multiple topics can be subscribed to simultaneously by passing an array of topic names to the `topics` argument.
88
+ +
89
+ <4> Create a new subscriber for the `pubsub` pubsub component, subscribing to the `TOPIC-A` topic.
90
+ <5> Start the subscriber. This will block the current thread and call the handler for each message received.
91
+
92
+ === State Management
93
+
94
+ Implementation of {state-block}
95
+
96
+ === Actors
97
+
98
+ Implementation of {actors-block}
99
+
100
+ === Bindings
101
+
102
+ Implementation of {binding-block}
103
+
104
+ === Secrets
105
+
106
+ Implementation of {secret-block}
107
+
108
+ === Configuration
109
+
110
+ Implementation of {configuration-block}
111
+
112
+ === Distributed Lock
113
+
114
+ Implementation of {distributed-lock-block}
115
+
116
+ === Workflow
117
+
118
+ Implementation of {workflow-block}
119
+
120
+ === Cryptography
121
+
122
+ Implementation of {cryptography-block}
123
+
50
124
  == Development
51
125
 
52
126
  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.
data/lib/dapr/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rubyists
4
4
  module Dapr
5
- VERSION = '0.1.17'
5
+ VERSION = '0.1.19'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dapr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tj (bougyman) Vanderpoel
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-04-16 00:00:00.000000000 Z
12
+ date: 2024-04-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dapr-ruby