Sha256: 4e3c86cad4857d66e8583218abd1da3468d3f516dae08f3b1f9e259045a97ddc

Contents?: true

Size: 845 Bytes

Versions: 30

Compression:

Stored size: 845 Bytes

Contents

# frozen_string_literal: true

# The [`background()` plan function](plan_functions.md#background) returns a
# `Future` object, which can be passed to the [`wait()` plan
# function](plan_functions.md#wait) to block on the result of the backgrounded
# code block.
#
# @!method state
#   Either 'running' if the Future is still executing, 'done' if the Future
#   finished successfully, or 'error' if the Future finished with an error.
#
Puppet::DataTypes.create_type('Future') do
  interface <<-PUPPET
    attributes => {},
    functions => {
      state => Callable[[], Enum['running', 'done', 'error']],
    }
  PUPPET

  load_file('bolt/plan_future')

  # Needed for Puppet to recognize Bolt::Result as a Puppet object when deserializing
  Bolt::PlanFuture.include(Puppet::Pops::Types::PuppetObject)
  implementation_class Bolt::PlanFuture
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
bolt-4.0.0 bolt-modules/boltlib/lib/puppet/datatypes/future.rb
bolt-3.29.0 bolt-modules/boltlib/lib/puppet/datatypes/future.rb
bolt-3.28.0 bolt-modules/boltlib/lib/puppet/datatypes/future.rb
bolt-3.27.4 bolt-modules/boltlib/lib/puppet/datatypes/future.rb
bolt-3.27.2 bolt-modules/boltlib/lib/puppet/datatypes/future.rb
bolt-3.27.1 bolt-modules/boltlib/lib/puppet/datatypes/future.rb
bolt-3.26.2 bolt-modules/boltlib/lib/puppet/datatypes/future.rb
bolt-3.26.1 bolt-modules/boltlib/lib/puppet/datatypes/future.rb
bolt-3.25.0 bolt-modules/boltlib/lib/puppet/datatypes/future.rb
bolt-3.24.0 bolt-modules/boltlib/lib/puppet/datatypes/future.rb
bolt-3.23.1 bolt-modules/boltlib/lib/puppet/datatypes/future.rb
bolt-3.23.0 bolt-modules/boltlib/lib/puppet/datatypes/future.rb
bolt-3.22.1 bolt-modules/boltlib/lib/puppet/datatypes/future.rb
bolt-3.22.0 bolt-modules/boltlib/lib/puppet/datatypes/future.rb
bolt-3.21.0 bolt-modules/boltlib/lib/puppet/datatypes/future.rb
bolt-3.20.0 bolt-modules/boltlib/lib/puppet/datatypes/future.rb
bolt-3.19.0 bolt-modules/boltlib/lib/puppet/datatypes/future.rb
bolt-3.18.0 bolt-modules/boltlib/lib/puppet/datatypes/future.rb
bolt-3.17.0 bolt-modules/boltlib/lib/puppet/datatypes/future.rb
bolt-3.16.1 bolt-modules/boltlib/lib/puppet/datatypes/future.rb