Module Facter::Core::Resolvable
In: lib/facter/core/resolvable.rb

The resolvable mixin defines behavior for evaluating and returning fact resolutions.

Classes including this mixin should implement at name method describing the value being resolved and a resolve_value that actually executes the code to resolve the value.

Methods

flush   limit   on_flush   value  

Attributes

timeout  [RW]  The timeout, in seconds, for evaluating this resolution. @return [Integer] @api public

Public Instance methods

flush executes the block, if any, stored by the {on_flush} method

@see Facter::Util::Fact#flush @see Facter::Util::Resolution#on_flush

@api private

Return the timeout period for resolving a value. (see timeout) @return [Numeric] @comment requiring ‘timeout’ stdlib class causes Object#timeout to be

  defined which delegates to Timeout.timeout. This method may potentially
  overwrite the #timeout attr_reader on this class, so we define #limit to
  avoid conflicts.

on_flush accepts a block and executes the block when the resolution‘s value is flushed. This makes it possible to model a single, expensive system call inside of a Ruby object and then define multiple dynamic facts which resolve by sending messages to the model instance. If one of the dynamic facts is flushed then it can, in turn, flush the data stored in the model instance to keep all of the dynamic facts in sync without making multiple, expensive, system calls.

Please see the Solaris zones fact for an example of how this feature may be used.

@see Facter::Util::Fact#flush @see Facter::Util::Resolution#flush

@api public

[Validate]