Class: LogicalConstruct::ResolutionServer::States::Resolving

Inherits:
PlanState
  • Object
show all
Defined in:
lib/logical-construct/target/plan-records.rb

Constant Summary

Constants included from Protocol::PlanValidation

Protocol::PlanValidation::BIG_CHUNK

Instance Attribute Summary

Attributes inherited from PlanState

#record

Instance Method Summary collapse

Methods inherited from PlanState

#==, #alive?, #can_receive?, #change, #current_path, #current_plans_dir, #delivered_plans_dir, #exists?, #filehash, #initialize, #inspect, #name, #receive, #received_path, #resolve, #resolved?, #state, #storage_path_for, #stored_plans_dir

Methods included from Protocol::PlanValidation

#check_digest, #chunk_size, #digest, #file_checksum, #generate_checksum, #realpath

Constructor Details

This class inherits a constructor from LogicalConstruct::ResolutionServer::States::PlanState

Instance Method Details

#cancel!Object



232
233
234
235
236
237
238
239
# File 'lib/logical-construct/target/plan-records.rb', line 232

def cancel!
  unless @thread.nil?
    if @working
      @thread.kill
    end
  end
  super
end

#enterObject



246
247
248
249
250
251
252
253
# File 'lib/logical-construct/target/plan-records.rb', line 246

def enter
  @working = true
  @thread = Thread.new do
    ResolutionMethods.run_all(self)
    @working = false
    change(Unresolved)
  end
end

#joinObject



241
242
243
244
# File 'lib/logical-construct/target/plan-records.rb', line 241

def join
  super if @thread.nil?
  @thread.join
end