Class: Hecks::Runtime::DependencyPlanning::Plan

Inherits:
Struct
  • Object
show all
Defined in:
lib/hecks/runtime/dependency_planning.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#complete_stateObject

Returns the value of attribute complete_state

Returns:

  • (Object)

    the current value of complete_state



11
12
13
# File 'lib/hecks/runtime/dependency_planning.rb', line 11

def complete_state
  @complete_state
end

#payload_read_setObject

Returns the value of attribute payload_read_set

Returns:

  • (Object)

    the current value of payload_read_set



11
12
13
# File 'lib/hecks/runtime/dependency_planning.rb', line 11

def payload_read_set
  @payload_read_set
end

#read_setObject

Returns the value of attribute read_set

Returns:

  • (Object)

    the current value of read_set



11
12
13
# File 'lib/hecks/runtime/dependency_planning.rb', line 11

def read_set
  @read_set
end

#state_independentObject

Returns the value of attribute state_independent

Returns:

  • (Object)

    the current value of state_independent



11
12
13
# File 'lib/hecks/runtime/dependency_planning.rb', line 11

def state_independent
  @state_independent
end

#unresolved_dependenciesObject

Returns the value of attribute unresolved_dependencies

Returns:

  • (Object)

    the current value of unresolved_dependencies



11
12
13
# File 'lib/hecks/runtime/dependency_planning.rb', line 11

def unresolved_dependencies
  @unresolved_dependencies
end

#write_setObject

Returns the value of attribute write_set

Returns:

  • (Object)

    the current value of write_set



11
12
13
# File 'lib/hecks/runtime/dependency_planning.rb', line 11

def write_set
  @write_set
end

Instance Method Details

#complete_state?Boolean

Returns:

  • (Boolean)


20
# File 'lib/hecks/runtime/dependency_planning.rb', line 20

def complete_state? = complete_state

#state_independent?Boolean

Returns:

  • (Boolean)


21
# File 'lib/hecks/runtime/dependency_planning.rb', line 21

def state_independent? = state_independent

#strategy_for(capabilities: []) ⇒ Object

Capability negotiation is correctness-first: an optimization is selected only when both the semantic proof and adapter capability are present. This is planning data only; no runtime path calls it yet.



26
27
28
29
30
31
# File 'lib/hecks/runtime/dependency_planning.rb', line 26

def strategy_for(capabilities: [])
  return TRANSACTIONAL_FALLBACK unless complete_state? && state_independent?
  return TRANSACTIONAL_FALLBACK unless capabilities.map(&:to_sym).include?(ATOMIC_PUT)

  ATOMIC_PUT
end