Class: EventStoreClient::GRPC::Commands::PersistentSubscriptions::Read
- Inherits:
-
Command
- Object
- Command
- EventStoreClient::GRPC::Commands::PersistentSubscriptions::Read
- Defined in:
- lib/event_store_client/adapters/grpc/commands/persistent_subscriptions/read.rb
Instance Method Summary collapse
-
#call(stream, group, options: {}) ⇒ Dry::Monads::Result::Success, Dry::Monads::Result::Failure
Read given persistent subscription.
Methods inherited from Command
Methods included from Configuration
Instance Method Details
#call(stream, group, options: {}) ⇒ Dry::Monads::Result::Success, Dry::Monads::Result::Failure
Read given persistent subscription
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/event_store_client/adapters/grpc/commands/persistent_subscriptions/read.rb', line 25 def call(stream, group, options: {}) count = [:count].to_i opts = { stream_identifier: { streamName: stream }, buffer_size: count, group_name: group, uuid_option: { structured: {} } } requests = [request.new(options: opts)] # please notice that it's an array. Should be? skip_decryption = [:skip_decryption] || false service.read(requests, metadata: ).each do |res| next if res.subscription_confirmation yield deserialize_event(res.event.event, skip_decryption: skip_decryption) if block_given? end Success() end |