Class: SearchKit::Polling
- Inherits:
-
Object
- Object
- SearchKit::Polling
- Defined in:
- lib/search_kit/polling.rb,
lib/search_kit/polling/process.rb
Overview
This file houses the polling loop of the Event service.
Defined Under Namespace
Classes: Process
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(channel, &block) ⇒ Polling
constructor
A new instance of Polling.
- #perform ⇒ Object
- #process_queue ⇒ Object
Constructor Details
#initialize(channel, &block) ⇒ Polling
Returns a new instance of Polling.
13 14 15 16 |
# File 'lib/search_kit/polling.rb', line 13 def initialize(channel, &block) @block = block @channel = channel end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
11 12 13 |
# File 'lib/search_kit/polling.rb', line 11 def block @block end |
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
11 12 13 |
# File 'lib/search_kit/polling.rb', line 11 def channel @channel end |
Class Method Details
.perform(channel, &block) ⇒ Object
7 8 9 |
# File 'lib/search_kit/polling.rb', line 7 def self.perform(channel, &block) new(channel, &block).perform end |
Instance Method Details
#perform ⇒ Object
18 19 20 21 22 23 |
# File 'lib/search_kit/polling.rb', line 18 def perform loop do process_queue sleep 1 end end |