[前][次][番号順一覧][スレッド一覧]

ruby-changes:63329

From: MSP-Greg <ko1@a...>
Date: Mon, 12 Oct 2020 13:56:27 +0900 (JST)
Subject: [ruby-changes:63329] c6652f223c (master): ractor.rb - indent comment code [ci skip]

https://git.ruby-lang.org/ruby.git/commit/?id=c6652f223c

From c6652f223c6103a4d4d909d6b770cdfc5d140124 Mon Sep 17 00:00:00 2001
From: MSP-Greg <Greg.mpls@g...>
Date: Sun, 11 Oct 2020 09:03:02 -0500
Subject: ractor.rb - indent comment code [ci skip]


diff --git a/ractor.rb b/ractor.rb
index 472b02c..78980b2 100644
--- a/ractor.rb
+++ b/ractor.rb
@@ -14,18 +14,18 @@ class Ractor https://github.com/ruby/ruby/blob/trunk/ractor.rb#L14
   # 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 https://github.com/ruby/ruby/blob/trunk/ractor.rb#L53
 
   # 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 v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]