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
Returns a new instance of QueueWithIntervalCallback.
6 7 8 9 10 11 |
# File 'lib/event_sourcery/postgres/queue_with_interval_callback.rb', line 6 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.
4 5 6 |
# File 'lib/event_sourcery/postgres/queue_with_interval_callback.rb', line 4 def callback @callback end |
Instance Method Details
#pop(non_block_without_callback = false) ⇒ Object
13 14 15 16 |
# File 'lib/event_sourcery/postgres/queue_with_interval_callback.rb', line 13 def pop(non_block_without_callback = false) return super if non_block_without_callback pop_with_interval_callback end |