Class: SearchKit::Events::Poll
- Inherits:
-
Object
- Object
- SearchKit::Events::Poll
- Defined in:
- lib/search_kit/events/poll.rb,
lib/search_kit/events/poll/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) ⇒ Poll
constructor
A new instance of Poll.
- #perform ⇒ Object
- #process_queue ⇒ Object
Constructor Details
#initialize(channel, &block) ⇒ Poll
Returns a new instance of Poll.
14 15 16 17 |
# File 'lib/search_kit/events/poll.rb', line 14 def initialize(channel, &block) @block = block @channel = channel end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
12 13 14 |
# File 'lib/search_kit/events/poll.rb', line 12 def block @block end |
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
12 13 14 |
# File 'lib/search_kit/events/poll.rb', line 12 def channel @channel end |
Class Method Details
.perform(channel, &block) ⇒ Object
8 9 10 |
# File 'lib/search_kit/events/poll.rb', line 8 def self.perform(channel, &block) new(channel, &block).perform end |
Instance Method Details
#perform ⇒ Object
19 20 21 22 23 24 |
# File 'lib/search_kit/events/poll.rb', line 19 def perform loop do process_queue sleep 1 end end |