Class: EventStoreClient::GRPC::Options::Streams::ReadOptions
- Inherits:
-
Object
- Object
- EventStoreClient::GRPC::Options::Streams::ReadOptions
- Defined in:
- lib/event_store_client/adapters/grpc/options/streams/read_options.rb
Instance Method Summary collapse
-
#initialize(stream_name, options, config:) ⇒ ReadOptions
constructor
A new instance of ReadOptions.
-
#request_options ⇒ Hash
See event_store.client.streams.ReadReq.Options for available options.
Constructor Details
#initialize(stream_name, options, config:) ⇒ ReadOptions
Returns a new instance of ReadOptions.
41 42 43 44 45 |
# File 'lib/event_store_client/adapters/grpc/options/streams/read_options.rb', line 41 def initialize(stream_name, , config:) @stream_name = stream_name @options = @config = config end |
Instance Method Details
#request_options ⇒ Hash
Returns see event_store.client.streams.ReadReq.Options for available options.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/event_store_client/adapters/grpc/options/streams/read_options.rb', line 48 def = {} .merge!( Shared::Options::StreamOptions.new(stream_name, ). ) [:read_direction] = [:direction] [:count] = [:max_count] || config.per_page [:resolve_links] = [:resolve_link_tos] .merge!( Shared::Options::FilterOptions.new([:filter]). ) # This option means how event#id would look like in the response. If you provided # :string key, then #id will be a normal UUID string. If you provided :structured # key, then #id will be an instance of EventStore::Client::UUID::Structured class. # Note: for some reason if you don't provide this option - the request hangs forever # Examples: # <EventStore::Client::UUID::Structured: # most_significant_bits: 1266766466329758182, # least_significant_bits: -8366670759139390653> # <EventStore::Client::UUID: string: "f0e1771c-334b-4b8d-ad88-c2024ccbe141"> [:uuid_option] = { string: EventStore::Client::Empty.new } end |