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

Add a Deferred data type for lazy function call



    • New Feature
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 6.0.0
    • None
    • None
    • New Feature
    • 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.
    • Needs Assessment


      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.




            tony.vu Tony Vu
            henrik.lindberg Henrik Lindberg
            0 Vote for this issue
            1 Start watching this issue



              Zendesk Support