Module: ConcurrentWorker::ConcurrentThread
- Defined in:
- lib/concurrent_worker/worker.rb
Instance Method Summary collapse
- #channel_close ⇒ Object
- #cncr_block ⇒ Object
- #receive_req ⇒ Object
- #send_req(args) ⇒ Object
- #send_res(args) ⇒ Object
- #wait_cncr_proc ⇒ Object
Instance Method Details
#channel_close ⇒ Object
223 224 225 |
# File 'lib/concurrent_worker/worker.rb', line 223 def channel_close @thread_channel.close end |
#cncr_block ⇒ Object
204 205 206 207 208 209 |
# File 'lib/concurrent_worker/worker.rb', line 204 def cncr_block @thread_channel = Queue.new @thread = result_handle_thread do yield_base_block end end |
#receive_req ⇒ Object
215 216 217 |
# File 'lib/concurrent_worker/worker.rb', line 215 def receive_req @thread_channel.pop end |
#send_req(args) ⇒ Object
211 212 213 |
# File 'lib/concurrent_worker/worker.rb', line 211 def send_req(args) @thread_channel.push(args) end |
#send_res(args) ⇒ Object
219 220 221 |
# File 'lib/concurrent_worker/worker.rb', line 219 def send_res(args) call_result_callbacks(args) end |
#wait_cncr_proc ⇒ Object
227 228 229 |
# File 'lib/concurrent_worker/worker.rb', line 227 def wait_cncr_proc @thread && @thread.join end |