Class: CPEE::Properties::PutState
- Inherits:
-
Riddl::Implementation
- Object
- Riddl::Implementation
- CPEE::Properties::PutState
- Defined in:
- lib/cpee/implementation_properties.rb
Overview
}}}
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.run(id, opts, state) ⇒ Object
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/cpee/implementation_properties.rb', line 239 def self::run(id,opts,state) case state when 'running' seh = Object.const_get('CPEE::ExecutionHandler::' + CPEE::Persistence::extract_item(id,opts,'executionhandler').capitalize) seh::prepare(id,opts) seh::run(id,opts) when 'stopping' seh = Object.const_get('CPEE::ExecutionHandler::' + CPEE::Persistence::extract_item(id,opts,'executionhandler').capitalize) if seh::stop(id,opts) # process is not running anyway, so change redis PutState::set id, opts, 'stopped' end else PutState::set id, opts, state end end |
.set(id, opts, state) ⇒ Object
{{{
235 236 237 |
# File 'lib/cpee/implementation_properties.rb', line 235 def self::set(id,opts,state) CPEE::Persistence::set_item(id,opts,'state',:state => state, :attributes => CPEE::Persistence::extract_list(id,opts,'attributes').to_h) end |