Top Level Namespace
- Includes:
- Cuboid
Defined Under Namespace
Modules: Cuboid Classes: Array, Hash, Object
Constant Summary
Constants included from Cuboid
Cuboid::BANNER, Cuboid::VERSION, Cuboid::WEBSITE
Instance Method Summary collapse
- #agent_connect(*args) ⇒ RPC::Client::Agent
- #agent_kill(*args) ⇒ Object
- #agent_killall ⇒ Object
- #agent_spawn(*args) ⇒ RPC::Client::Agent
- #ap(obj) ⇒ Object
- #instance_agent_spawn(*args) ⇒ RPC::Client::Instance
- #instance_connect(*args) ⇒ RPC::Client::Instance
- #instance_grid_spawn(*args) ⇒ RPC::Client::Instance
- #instance_kill(url) ⇒ Object
- #instance_killall ⇒ Object
-
#instance_spawn(*args) ⇒ RPC::Client::Instance, Integer
RPC client and PID.
-
#instance_token_for(*args) ⇒ String
Cached authentication token for the given Instance.
- #parent_alive? ⇒ Boolean
- #ppid ⇒ Object
- #process_kill(*args) ⇒ Object
- #process_kill_many(*args) ⇒ Object
- #process_kill_reactor(*args) ⇒ Object
- #process_killall(*args) ⇒ Object
- #puts_stderr(str) ⇒ Object
- #scheduler_connect(*args) ⇒ RPC::Client::Scheduler
- #scheduler_kill(*args) ⇒ Object
- #scheduler_killall ⇒ Object
- #scheduler_spawn(*args) ⇒ RPC::Client::Queue
Methods included from Cuboid
collect_young_objects, #get_long_win32_filename, linux?, mac?, null_device, profile?, windows?
Instance Method Details
#agent_connect(*args) ⇒ RPC::Client::Agent
21 22 23 |
# File 'lib/cuboid/processes/helpers/agents.rb', line 21 def agent_connect( *args ) Cuboid::Processes::Agents.connect( *args ) end |
#agent_kill(*args) ⇒ Object
9 10 11 |
# File 'lib/cuboid/processes/helpers/agents.rb', line 9 def agent_kill( *args ) Cuboid::Processes::Agents.kill( *args ) end |
#agent_killall ⇒ Object
15 16 17 |
# File 'lib/cuboid/processes/helpers/agents.rb', line 15 def agent_killall Cuboid::Processes::Agents.killall end |
#agent_spawn(*args) ⇒ RPC::Client::Agent
3 4 5 |
# File 'lib/cuboid/processes/helpers/agents.rb', line 3 def agent_spawn( *args ) Cuboid::Processes::Agents.spawn( *args ) end |
#ap(obj) ⇒ Object
11 12 13 |
# File 'lib/cuboid.rb', line 11 def ap( obj ) super obj, raw: true end |
#instance_agent_spawn(*args) ⇒ RPC::Client::Instance
15 16 17 |
# File 'lib/cuboid/processes/helpers/instances.rb', line 15 def instance_agent_spawn( *args ) Cuboid::Processes::Instances.agent.spawn( *args ) end |
#instance_connect(*args) ⇒ RPC::Client::Instance
31 32 33 |
# File 'lib/cuboid/processes/helpers/instances.rb', line 31 def instance_connect( *args ) Cuboid::Processes::Instances.connect( *args ) end |
#instance_grid_spawn(*args) ⇒ RPC::Client::Instance
9 10 11 |
# File 'lib/cuboid/processes/helpers/instances.rb', line 9 def instance_grid_spawn( *args ) Cuboid::Processes::Instances.grid_spawn( *args ) end |
#instance_kill(url) ⇒ Object
19 20 21 |
# File 'lib/cuboid/processes/helpers/instances.rb', line 19 def instance_kill( url ) Cuboid::Processes::Instances.kill url end |
#instance_killall ⇒ Object
25 26 27 |
# File 'lib/cuboid/processes/helpers/instances.rb', line 25 def instance_killall Cuboid::Processes::Instances.killall end |
#instance_spawn(*args) ⇒ RPC::Client::Instance, Integer
Returns RPC client and PID.
3 4 5 |
# File 'lib/cuboid/processes/helpers/instances.rb', line 3 def instance_spawn( *args ) Cuboid::Processes::Instances.spawn( *args ) end |
#instance_token_for(*args) ⇒ String
Returns Cached authentication token for the given Instance.
37 38 39 |
# File 'lib/cuboid/processes/helpers/instances.rb', line 37 def instance_token_for( *args ) Cuboid::Processes::Instances.token_for( *args ) end |
#parent_alive? ⇒ Boolean
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/cuboid/processes/executables/base.rb', line 25 def parent_alive? # Windows is not big on POSIX so try it its own way if possible. if Gem.win_platform? begin alive = false wmi = WIN32OLE.connect( 'winmgmts://' ) processes = wmi.ExecQuery( "select ProcessId from win32_process where ProcessID='#{ppid}'") processes.each do |proc| proc.ole_free alive = true end processes.ole_free wmi.ole_free return alive rescue WIN32OLERuntimeError end end !!(Process.kill( 0, ppid ) rescue false) end |
#ppid ⇒ Object
21 22 23 |
# File 'lib/cuboid/processes/executables/base.rb', line 21 def ppid $options[:ppid] end |
#process_kill(*args) ⇒ Object
9 10 11 |
# File 'lib/cuboid/processes/helpers/processes.rb', line 9 def process_kill( *args ) Cuboid::Processes::Manager.kill( *args ) end |
#process_kill_many(*args) ⇒ Object
21 22 23 |
# File 'lib/cuboid/processes/helpers/processes.rb', line 21 def process_kill_many( *args ) Cuboid::Processes::Manager.kill_many( *args ) end |
#process_kill_reactor(*args) ⇒ Object
3 4 5 |
# File 'lib/cuboid/processes/helpers/processes.rb', line 3 def process_kill_reactor( *args ) Cuboid::Processes::Manager.kill_reactor( *args ) end |
#process_killall(*args) ⇒ Object
15 16 17 |
# File 'lib/cuboid/processes/helpers/processes.rb', line 15 def process_killall( *args ) Cuboid::Processes::Manager.killall( *args ) end |
#puts_stderr(str) ⇒ Object
47 48 49 50 51 52 |
# File 'lib/cuboid/processes/executables/base.rb', line 47 def puts_stderr( str ) return if $stderr.closed? $stderr.puts str rescue end |
#scheduler_connect(*args) ⇒ RPC::Client::Scheduler
21 22 23 |
# File 'lib/cuboid/processes/helpers/schedulers.rb', line 21 def scheduler_connect( *args ) Cuboid::Processes::Schedulers.connect( *args ) end |
#scheduler_kill(*args) ⇒ Object
9 10 11 |
# File 'lib/cuboid/processes/helpers/schedulers.rb', line 9 def scheduler_kill( *args ) Cuboid::Processes::Schedulers.kill( *args ) end |
#scheduler_killall ⇒ Object
15 16 17 |
# File 'lib/cuboid/processes/helpers/schedulers.rb', line 15 def scheduler_killall Cuboid::Processes::Schedulers.killall end |
#scheduler_spawn(*args) ⇒ RPC::Client::Queue
3 4 5 |
# File 'lib/cuboid/processes/helpers/schedulers.rb', line 3 def scheduler_spawn( *args ) Cuboid::Processes::Schedulers.spawn( *args ) end |