Module: Kernel
- Defined in:
- lib/concurrent/goroutine.rb
Class Method Summary collapse
-
.go(*args, &block) ⇒ true, false
Post the given agruments and block to the Global Thread Pool.
Class Method Details
.go(*args, &block) ⇒ true, false
Note:
Althought based on Go’s goroutines and Erlang’s spawn/1,
Post the given agruments and block to the Global Thread Pool.
Ruby has a vastly different runtime. Threads aren’t nearly as efficient in Ruby. Use this function appropriately.
20 21 22 23 |
# File 'lib/concurrent/goroutine.rb', line 20 def go(*args, &block) return false unless block_given? $GLOBAL_THREAD_POOL.post(*args, &block) end |