Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-8635

Add a Deferred data type for lazy function call

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 6.0.0
    • Component/s: None
    • Labels:
      None
    • Release Notes:
      New Feature
    • Release Notes Summary:
      A new data type {{Deferred}} has been added. It is used to describe a function call that can be invoked at a later point in time.
    • QA Risk Assessment:
      Needs Assessment

      Description

      Add a data type Deferred that is used to describe a function call that is to be performed in the future (at some time when a resolution/call is wanted). The data type should be an Object and have the attributes name - the name of the function, and optional arguments an array with arguments to the function.

      The data type is not parameterized. While it would be of interest to have a Deferred[T] where T is the return type - this gets complicated as it is not possible in general to infer what the return type of a variable is because of overloading. We do not have such functionality (yet) in puppet and adding this could be done sometime in the future to ensure that the result of a deferred has a particular data type. This will most likely also mean that an instance of Deferred will need to have that type as a type constraint. The same can however be achieved by making a deferred call to assert_type, and giving a Deferred as an argument.

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                tony.vu Tony Vu
                Reporter:
                henrik.lindberg Henrik Lindberg
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: