Class: EventSource::EventStore::HTTP::Read
- Inherits:
-
Object
- Object
- EventSource::EventStore::HTTP::Read
- Includes:
- Read
- Defined in:
- lib/event_source/event_store/http/read.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.build ⇒ Object
7 8 9 10 11 |
# File 'lib/event_source/event_store/http/read.rb', line 7 def self.build(*) instance = super instance.configure_long_poll instance end |
Instance Method Details
#configure(batch_size: nil, precedence: nil, session: nil) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/event_source/event_store/http/read.rb', line 13 def configure(batch_size: nil, precedence: nil, session: nil) Get.configure( self, batch_size: batch_size, precedence: precedence, session: session ) end |
#configure_long_poll ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/event_source/event_store/http/read.rb', line 22 def configure_long_poll cycle = iterator.cycle return if cycle.instance_of? Cycle::None maximum_milliseconds = cycle.maximum_milliseconds long_poll_duration = Rational(maximum_milliseconds, 1000).ceil get.read_stream.enable_long_poll long_poll_duration end |