るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.005秒)
トップページ > クエリ:ld[x] > クラス:Fiber[x]

別のキーワード

  1. date ld
  2. ld date

ライブラリ

検索結果

Fiber.yield(*arg = nil) -> object (6101.0)

現在のファイバーの親にコンテキストを切り替えます。

...す。

コンテキストの切り替えの際に Fiber#resume に与えられた引数を yield メソッドは返します。

@param arg 現在のファイバーの親に渡したいオブジェクトを指定します。

@raise FiberError Fiber でのルートファイバーで呼ばれた場...
...合に発生します。


//emlist[例:][ruby]{
a = nil
f = Fiber.new do
a = Fiber.yield()
end

f.resume()
f.resume(:foo)

p a #=> :foo
//}...