Class: EventSourcery::Postgres::QueueWithIntervalCallback
- Inherits:
-
Queue
- Object
- Queue
- EventSourcery::Postgres::QueueWithIntervalCallback
- Defined in:
- lib/event_sourcery/postgres/queue_with_interval_callback.rb
Instance Attribute Summary collapse
-
#callback ⇒ Object
Returns the value of attribute callback.
Instance Method Summary collapse
-
#initialize(callback: proc {}, callback_interval: EventSourcery::Postgres.config.callback_interval_if_no_new_events, poll_interval: 0.1) ⇒ QueueWithIntervalCallback
constructor
A new instance of QueueWithIntervalCallback.
- #pop(non_block_without_callback = false) ⇒ Object
Constructor Details
#initialize(callback: proc {}, callback_interval: EventSourcery::Postgres.config.callback_interval_if_no_new_events, poll_interval: 0.1) ⇒ QueueWithIntervalCallback
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/event_sourcery/postgres/queue_with_interval_callback.rb', line 8 def initialize( callback: proc {}, callback_interval: EventSourcery::Postgres.config.callback_interval_if_no_new_events, poll_interval: 0.1 ) @callback = callback @callback_interval = callback_interval @poll_interval = poll_interval super() end |
Instance Attribute Details
#callback ⇒ Object
Returns the value of attribute callback.
6 7 8 |
# File 'lib/event_sourcery/postgres/queue_with_interval_callback.rb', line 6 def callback @callback end |
Instance Method Details
#pop(non_block_without_callback = false) ⇒ Object
19 20 21 22 23 |
# File 'lib/event_sourcery/postgres/queue_with_interval_callback.rb', line 19 def pop(non_block_without_callback = false) return super if non_block_without_callback pop_with_interval_callback end |