るりまサーチ

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

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method gets
  4. irb/input-method new
  5. matrix -

ライブラリ

モジュール

キーワード

検索結果

Thread#kill -> self (18207.0)

スレッドの実行を終了させます。終了時に ensure 節が実行されます。

....#exit(0)
により終了します。

Kernel.#exit と違い例外 SystemExit を発生しません。

th1 = Thread.new do
begin
sleep 10
ensure
p "this will be displayed"
end
end

sleep 0.1
th1.kill

#=> "this will be displayed"

@see Kernel.#exit, Kernel.#exit...

IRB::ExtendCommand::Kill#execute(*obj) -> object (12200.0)

指定したサブ irb を停止します。

指定したサブ irb を停止します。

@param obj 停止するサブ irb を識別する以下のいずれかのオブジェクトを指定します。

* irb インタプリタ番号
* irb オブジェクト
* スレッド ID
* 各インタプリタの self (「irb(obj)」で起動した時の obj)

IRB::ExtendCommandBundle.install_extend_commands -> object (9212.0)

定義済みの拡張を読み込みます。

...* irb_push_workspace
* irb_pop_workspace
* irb_load
* irb_require
* irb_source
* irb
* irb_jobs
* irb_fg
* irb_kill
* irb_help

irb/extend-command が require された時にライブラリ内部で自動的
に実行されます。

@see IRB::ExtendCommandBundle.install_extend_commands...

Thread#exit -> self (6207.0)

スレッドの実行を終了させます。終了時に ensure 節が実行されます。

....#exit(0)
により終了します。

Kernel.#exit と違い例外 SystemExit を発生しません。

th1 = Thread.new do
begin
sleep 10
ensure
p "this will be displayed"
end
end

sleep 0.1
th1.kill

#=> "this will be displayed"

@see Kernel.#exit, Kernel.#exit...

Thread#terminate -> self (3107.0)

スレッドの実行を終了させます。終了時に ensure 節が実行されます。

....#exit(0)
により終了します。

Kernel.#exit と違い例外 SystemExit を発生しません。

th1 = Thread.new do
begin
sleep 10
ensure
p "this will be displayed"
end
end

sleep 0.1
th1.kill

#=> "this will be displayed"

@see Kernel.#exit, Kernel.#exit...

絞り込み条件を変える

SignalException#signm -> String (3106.0)

self.message のエイリアスです。

...self.message のエイリアスです。

//emlist[例][ruby]{
begin
Process.kill('HUP', Process.pid)
sleep
rescue SignalException => e
puts e.signm # => SIGHUP
end
//}...

SignalException#signo -> Integer (3106.0)

self のシグナル番号を返します。

...self のシグナル番号を返します。

//emlist[例][ruby]{
p Signal.signame(1) # => "HUP"
begin
Process.kill('HUP', Process.pid)
sleep
rescue SignalException => e
p e.signo # => 1
end
//}...

Timeout.#timeout(sec, exception_class = nil) {|i| ... } -> object (236.0)

ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。

...を sec 秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。

ex
ception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec が...
...ものは実用レベルでは少ないのですが、
Socket などは DNSの名前解決に時間がかかった場合割り込めません
(resolv-replace を使用する必要があります)。
その処理を Ruby で実装しなおすか C 側で Ruby
のスレッドを意識してあげる...
...pid = com.pid
while line = com.gets
print line
end
}
rescue Timeout::Error => err
puts "timeout: shell execution."
Process.kill('SIGINT', pid)
printf "[result]\t%s", com.read
com.close unless com.nil?
end

#止まっているか確認する。
#sys...

Timeout.#timeout(sec, exception_class, message) {|i| ... } -> object (236.0)

ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。

...を sec 秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。

ex
ception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec が...
...ものは実用レベルでは少ないのですが、
Socket などは DNSの名前解決に時間がかかった場合割り込めません
(resolv-replace を使用する必要があります)。
その処理を Ruby で実装しなおすか C 側で Ruby
のスレッドを意識してあげる...
...pid = com.pid
while line = com.gets
print line
end
}
rescue Timeout::Error => err
puts "timeout: shell execution."
Process.kill('SIGINT', pid)
printf "[result]\t%s", com.read
com.close unless com.nil?
end

#止まっているか確認する。
#sys...