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
226 227 228 |
# File 'lib/concurrent_worker/worker.rb', line 226 def channel_close @thread_channel.close end |
#cncr_block ⇒ Object
207 208 209 210 211 212 |
# File 'lib/concurrent_worker/worker.rb', line 207 def cncr_block @thread_channel = Queue.new @thread = result_handle_thread do yield_base_block end end |
#receive_req ⇒ Object
218 219 220 |
# File 'lib/concurrent_worker/worker.rb', line 218 def receive_req @thread_channel.pop end |
#send_req(args) ⇒ Object
214 215 216 |
# File 'lib/concurrent_worker/worker.rb', line 214 def send_req(args) @thread_channel.push(args) end |
#send_res(args) ⇒ Object
222 223 224 |
# File 'lib/concurrent_worker/worker.rb', line 222 def send_res(args) call_result_callbacks(args) end |
#wait_cncr_proc ⇒ Object
230 231 232 |
# File 'lib/concurrent_worker/worker.rb', line 230 def wait_cncr_proc @thread && @thread.join end |