Class: Rubyists::Dapr::Client::Publisher
- Inherits:
-
Object
- Object
- Rubyists::Dapr::Client::Publisher
- Includes:
- Rubyists::Dapr::Client
- Defined in:
- lib/dapr/client/publisher.rb
Overview
Handles publishing messages to Dapr pub/sub topics
Constant Summary collapse
- Proto =
The proto class for the publish event request
::Dapr::Proto::Runtime::V1::PublishEventRequest
Constants included from Rubyists::Dapr::Client
DAPR_PORT, DAPR_STUB, DAPR_URI, Runtime
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
The name of the pubsub component, the client, and the serialization to use.
-
#pubsub_name ⇒ Object
readonly
The name of the pubsub component, the client, and the serialization to use.
-
#serialization ⇒ Object
readonly
The name of the pubsub component, the client, and the serialization to use.
Instance Method Summary collapse
-
#initialize(name, serialization: :to_json) ⇒ Publisher
constructor
Initialize the publisher.
- #publish(topic, message) ⇒ Object
Methods included from Rubyists::Dapr::Client
Constructor Details
#initialize(name, serialization: :to_json) ⇒ Publisher
Initialize the publisher
24 25 26 27 |
# File 'lib/dapr/client/publisher.rb', line 24 def initialize(name, serialization: :to_json) @serialization = serialization @pubsub_name = name end |
Instance Attribute Details
#client ⇒ Object (readonly)
The name of the pubsub component, the client, and the serialization to use
14 15 16 |
# File 'lib/dapr/client/publisher.rb', line 14 def client @client end |
#pubsub_name ⇒ Object (readonly)
The name of the pubsub component, the client, and the serialization to use
14 15 16 |
# File 'lib/dapr/client/publisher.rb', line 14 def pubsub_name @pubsub_name end |
#serialization ⇒ Object (readonly)
The name of the pubsub component, the client, and the serialization to use
14 15 16 |
# File 'lib/dapr/client/publisher.rb', line 14 def serialization @serialization end |