Skip to content
instance method

Thread#fetch

(*untyped sym) -> untyped
thr.fetch(sym) → obj
thr.fetch(sym) { } → obj
thr.fetch(sym, default) → obj

Returns a fiber-local for the given key. If the key can’t be found, there are several options: With no other arguments, it will raise a KeyError exception; if default is given, then that will be returned; if the optional code block is specified, then that will be run and its result returned. See Thread#[] and Hash#fetch.

See also #exit #group #backtrace_locations #inspect also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0