Class: SearchKit::Polling::Process
- Inherits:
-
Object
- Object
- SearchKit::Polling::Process
- Defined in:
- lib/search_kit/polling/process.rb
Overview
The logic of interacting with the event service to retrieve and process events is contained here.
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(channel, &block) ⇒ Process
constructor
A new instance of Process.
- #perform ⇒ Object
Constructor Details
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
11 12 13 |
# File 'lib/search_kit/polling/process.rb', line 11 def block @block end |
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
11 12 13 |
# File 'lib/search_kit/polling/process.rb', line 11 def channel @channel end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
11 12 13 |
# File 'lib/search_kit/polling/process.rb', line 11 def client @client end |
Class Method Details
.perform(channel, &block) ⇒ Object
7 8 9 |
# File 'lib/search_kit/polling/process.rb', line 7 def self.perform(channel, &block) new(channel, &block).perform end |
Instance Method Details
#perform ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/search_kit/polling/process.rb', line 19 def perform events.each do |event| begin block.call(event) rescue raise else client.complete(event.id) end end end |