42件ヒット
[1-42件を表示]
(0.032秒)
別のキーワード
種類
- インスタンスメソッド (18)
- 文書 (12)
- クラス (12)
ライブラリ
- ビルトイン (30)
クラス
- Fiber (18)
キーワード
-
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 3
. 0 . 0 (5) - raise (18)
検索結果
先頭5件
-
Fiber (38114.0)
-
ノンプリエンプティブな軽量スレッド(以下ファイバーと呼ぶ)を提供します。 他の言語では coroutine あるいは semicoroutine と呼ばれることもあります。 Thread と違いユーザレベルスレッドとして実装されています。
...係を持ちます。Fiber#resume を呼んだファイバーが親になり
呼ばれたファイバーが子になります。親子関係を壊すような遷移(例えば
自分の親の親のファイバーへ切り替えるような処理)はできません。
例外 FiberError が発生しま......す。
できることは
* Fiber#resume により子へコンテキストを切り替える
* Fiber.yield により親へコンテキストを切り替える
の二通りです。この親子関係は一時的なものであり
親ファイバーへコンテキストを切り替えた時点で解......合、親ファイバーに例外が伝播します。
//emlist[例:][ruby]{
f = Fiber.new do
raise StandardError, "hoge"
end
begin
f.resume # ここでも StandardError が発生する。
rescue => e
p e.message #=> "hoge"
end
//}
=== ショートチュートリアル
ファイバーは... -
Fiber
# raise(exception , message = nil , backtrace = nil) -> object (21166.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...ーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
Fiber.yield が呼ばれていないかファイバーがすでに終了している場合、
FiberError が発生します。
引数を渡さない場合、RuntimeError が発生します。
message 引数を渡した......きます。
@param message 例外のメッセージとなる文字列です。
@param exception 発生させる例外です。
@param backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。
//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.......raise "Error!" # => Error! (RuntimeError)
//}
//emlist[ファイバー内のイテレーションを終了させる例][ruby]{
f = Fiber.new do
loop do
Fiber.yield(:loop)
end
:exit
end
p f.resume # => :loop
p f.raise StopIteration # => :exit
//}... -
Fiber
# raise(message) -> object (21166.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...ーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
Fiber.yield が呼ばれていないかファイバーがすでに終了している場合、
FiberError が発生します。
引数を渡さない場合、RuntimeError が発生します。
message 引数を渡した......きます。
@param message 例外のメッセージとなる文字列です。
@param exception 発生させる例外です。
@param backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。
//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.......raise "Error!" # => Error! (RuntimeError)
//}
//emlist[ファイバー内のイテレーションを終了させる例][ruby]{
f = Fiber.new do
loop do
Fiber.yield(:loop)
end
:exit
end
p f.resume # => :loop
p f.raise StopIteration # => :exit
//}... -
Fiber
# raise -> object (21066.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...ーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
Fiber.yield が呼ばれていないかファイバーがすでに終了している場合、
FiberError が発生します。
引数を渡さない場合、RuntimeError が発生します。
message 引数を渡した......きます。
@param message 例外のメッセージとなる文字列です。
@param exception 発生させる例外です。
@param backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。
//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.......raise "Error!" # => Error! (RuntimeError)
//}
//emlist[ファイバー内のイテレーションを終了させる例][ruby]{
f = Fiber.new do
loop do
Fiber.yield(:loop)
end
:exit
end
p f.resume # => :loop
p f.raise StopIteration # => :exit
//}... -
NEWS for Ruby 3
. 0 . 0 (102.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...riable `RUBY_PAGER` or `PAGER` is present and has
a non-empty value, and the standard input and output are tty, the `--help`
option shows the help message via the pager designated by the value.
16754
=== `--backtrace-limit` option
The `--backtrace-limit` option limits the maximum length of a backt......4
* Fiber
* Fiber.new(blocking: true/false) allows you to create non-blocking execution contexts. 16786
* Fiber#blocking? tells whether the fiber is non-blocking. 16786
* Fiber#backtrace and Fiber#backtrace_locations provide per-fiber backtrace. 16815
* The limitation of Fiber#tran......ule M2; end
C.include M1
M1.include M2
p C.ancestors #=> [C, M1, M2, Object, Kernel, BasicObject]
//}
* Mutex
* `Mutex` is now acquired per-`Fiber` instead of per-`Thread`. This change should be compatible for essentially all usages and avoids blocking when using a scheduler. 16792
* Proc... -
NEWS for Ruby 2
. 6 . 0 (12.0) -
NEWS for Ruby 2.6.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...アを新しいキーと値に変換できるようになりました。 15143
* Exception
* 新規オプション
* Exception#full_message が :highlight と :order を受け付けるようになりました。 14324
* Hash
* 変更されたメソッド
* Hash#merge, Hash#......スの改善を計測できました。
* コルーチンのネイティブ実装(arm32, arm64, ppc64le, win32, win64, x86, amd64) により
Fiber のパフォーマンスを大きく改善 14739
=== その他の変更
* macOS で共有ライブラリの名前に Ruby のフルバージ...