From c6652f223c6103a4d4d909d6b770cdfc5d140124 Mon Sep 17 00:00:00 2001 From: MSP-Greg Date: Sun, 11 Oct 2020 09:03:02 -0500 Subject: ractor.rb - indent comment code [ci skip] --- ractor.rb | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'ractor.rb') diff --git a/ractor.rb b/ractor.rb index 472b02cc4e..78980b2685 100644 --- a/ractor.rb +++ b/ractor.rb @@ -14,18 +14,18 @@ class Ractor # The result of the block is sent via the outgoing channel # and other # - # r = Ractor.new do - # Ractor.receive # receive via r's mailbox => 1 - # Ractor.receive # receive via r's mailbox => 2 - # Ractor.yield 3 # yield a message (3) and wait for taking by another ractor. - # 'ok' # the return value will be yielded. - # # and r's incoming/outgoing ports are closed automatically. - # end - # r.send 1 # send a message (1) into r's mailbox. - # r << 2 # << is an alias of `send`. - # p r.take # take a message from r's outgoing port => 3 - # p r.take # => 'ok' - # p r.take # raise Ractor::ClosedError + # r = Ractor.new do + # Ractor.receive # receive via r's mailbox => 1 + # Ractor.receive # receive via r's mailbox => 2 + # Ractor.yield 3 # yield a message (3) and wait for taking by another ractor. + # 'ok' # the return value will be yielded. + # # and r's incoming/outgoing ports are closed automatically. + # end + # r.send 1 # send a message (1) into r's mailbox. + # r << 2 # << is an alias of `send`. + # p r.take # take a message from r's outgoing port => 3 + # p r.take # => 'ok' + # p r.take # raise Ractor::ClosedError # # other options: # name: Ractor's name @@ -53,22 +53,22 @@ class Ractor # Multiplex multiple Ractor communications. # - # r, obj = Ractor.select(r1, r2) - # #=> wait for taking from r1 or r2 - # # returned obj is a taken object from Ractor r + # r, obj = Ractor.select(r1, r2) + # #=> wait for taking from r1 or r2 + # # returned obj is a taken object from Ractor r # - # r, obj = Ractor.select(r1, r2, Ractor.current) - # #=> wait for taking from r1 or r2 - # # or receive from incoming queue - # # If receive is succeed, then obj is received value - # # and r is :receive (Ractor.current) + # r, obj = Ractor.select(r1, r2, Ractor.current) + # #=> wait for taking from r1 or r2 + # # or receive from incoming queue + # # If receive is succeed, then obj is received value + # # and r is :receive (Ractor.current) # - # r, obj = Ractor.select(r1, r2, Ractor.current, yield_value: obj) - # #=> wait for taking from r1 or r2 - # # or receive from incoming queue - # # or yield (Ractor.yield) obj - # # If yield is succeed, then obj is nil - # # and r is :yield + # r, obj = Ractor.select(r1, r2, Ractor.current, yield_value: obj) + # #=> wait for taking from r1 or r2 + # # or receive from incoming queue + # # or yield (Ractor.yield) obj + # # If yield is succeed, then obj is nil + # # and r is :yield # def self.select(*ractors, yield_value: yield_unspecified = true, move: false) __builtin_cstmt! %q{ -- cgit v1.2.3