Class: CSP::Process
- Inherits:
-
Object
- Object
- CSP::Process
- Defined in:
- lib/csp/process.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(&block) ⇒ Process
constructor
A new instance of Process.
- #start ⇒ Object
Constructor Details
#initialize(&block) ⇒ Process
7 8 9 |
# File 'lib/csp/process.rb', line 7 def initialize(&block) @block = block end |
Instance Method Details
#call ⇒ Object
11 12 13 |
# File 'lib/csp/process.rb', line 11 def call @block.call end |
#start ⇒ Object
15 16 17 18 19 20 |
# File 'lib/csp/process.rb', line 15 def start callcc do |cont| CSP.enqueue(cont) @block.call end end |