168件ヒット
[1-100件を表示]
(0.133秒)
種類
- インスタンスメソッド (135)
- 特異メソッド (22)
- クラス (11)
クラス
-
Encoding
:: Converter (44) -
Process
:: Status (11) - StopIteration (11)
- Thread (71)
-
Thread
:: Queue (9) - Time (11)
キーワード
- StopIteration (11)
- backtrace (11)
-
handle
_ interrupt (11) -
num
_ waiting (9) -
primitive
_ convert (44) -
report
_ on _ exception (8) -
report
_ on _ exception= (8) - result (11)
- run (11)
- status (11)
- stopsig (11)
- strftime (11)
検索結果
先頭5件
-
Thread
. stop -> nil (21239.0) -
他のスレッドから Thread#run メソッドで再起動されるまで、カレ ントスレッドの実行を停止します。
...ドから Thread#run メソッドで再起動されるまで、カレ
ントスレッドの実行を停止します。
//emlist[例][ruby]{
a = Thread.new { print "a"; Thread.stop; print "c" }
sleep 0.1 while a.status!='sleep'
print "b"
a.run
a.join
# => "abc"
//}
@see Thread#run, Thread#wakeup... -
StopIteration (18002.0)
-
イテレーションを止めるときに発生する例外です。
イテレーションを止めるときに発生する例外です。 -
Thread
. handle _ interrupt(hash) { . . . } -> object (12214.0) -
スレッドの割り込みのタイミングを引数で指定した内容に変更してブロックを 実行します。
...込み」とは、非同期イベントや Thread#raise や
Thread#kill、Signal.#trap(未サポート)、メインスレッドの終了
(メインスレッドが終了すると、他のスレッドも終了されます)を意味します。
@param hash 例外クラスがキー、割り込みのタ......る
Symbol が値の Hash を指定します。
値の内容は以下のいずれかです。
: :immediate
すぐに割り込みます。
: :on_blocking
ブロッキング処理(後述)の間は割り込みが発生します。
: :never
まったく割り込みま......同期割り込みは再度有効にされるまで延期されます。本
メソッドは sigprocmask(3) に似ています。
@return ブロックの評価結果を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
=== 注意
非同期割り... -
Thread
:: Queue # num _ waiting -> Integer (12208.0) -
キューを待っているスレッドの数を返します。
...キューを待っているスレッドの数を返します。
//emlist[例][ruby]{
require 'thread'
q = SizedQueue.new(1)
q.push(1)
t = Thread.new { q.push(2) }
sleep 0.05 until t.stop?
q.num_waiting # => 1
q.pop
t.join
//}... -
Thread
# backtrace -> [String] | nil (9308.0) -
スレッドの現在のバックトレースを返します。
... nil を返します。
//emlist[例][ruby]{
class C1
def m1
sleep 5
end
def m2
m1
end
end
th = Thread.new {C1.new.m2; Thread.stop}
th.backtrace
# => [
# [0] "(irb):3:in `sleep'",
# [1] "(irb):3:in `m1'",
# [2] "(irb):6:in `m2'",
# [3] "(irb):10:in `block in irb......_binding'"
# ]
th.kill
th.backtrace # => nil
//}... -
Thread
# report _ on _ exception=(newstate) (9238.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...Thread.report_on_exception です。
@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。
//emlist[例][ruby]{
a = Thread.new{ Thread.stop; raise }
a.report_on_exception = true
a.report_on_exception #......> true
a.run
# => #<Thread:0x00007fc3f48c7908@(irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thread:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }......b.report_on_exception = false
b.run # => #<Thread:0x00007fc3f48aefc0@(irb):4 dead>
//}
@see Thread.report_on_exception... -
Process
:: Status # stopsig -> Integer | nil (9202.0) -
stopped? が真の場合そのシグナルの番号を、そうでない場合は nil を返します。
...
stopped? が真の場合そのシグナルの番号を、そうでない場合は
nil を返します。... -
Thread
# run -> self (9166.0) -
停止状態(stop)のスレッドを再開させます。 Thread#wakeup と異なりすぐにスレッドの切り替え を行います。
...止状態(stop)のスレッドを再開させます。
Thread#wakeup と異なりすぐにスレッドの切り替え
を行います。
@raise ThreadError 死んでいるスレッドに対して実行すると発生します。
//emlist[例][ruby]{
a = Thread.new { puts "a"; Thread.stop; puts "c"......}
sleep 0.1 while a.status!='sleep'
puts "Got here"
a.run
a.join
# => a
# => Got here
# => c
//}
@see Thread#wakeup, Thread.stop... -
Thread
# report _ on _ exception -> bool (9138.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...Thread.report_on_exception です。
@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。
//emlist[例][ruby]{
a = Thread.new{ Thread.stop; raise }
a.report_on_exception = true
a.report_on_exception #......> true
a.run
# => #<Thread:0x00007fc3f48c7908@(irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thread:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }......b.report_on_exception = false
b.run # => #<Thread:0x00007fc3f48aefc0@(irb):4 dead>
//}
@see Thread.report_on_exception... -
StopIteration
# result -> object (9002.0) -
この例外オブジェクトを発生させる原因となったメソッド等の返り値を返します。
...ect = Object.new
def object.each
yield :yield1
yield :yield2
:each_returned
end
enumerator = object.to_enum
p enumerator.next #=> :yield1
p enumerator.next #=> :yield2
begin
enumerator.next
rescue StopIteration => error
p error.result #=> :each_returned
end...