GitHub user grkvlt opened a pull request:

    https://github.com/apache/brooklyn-server/pull/155

    [WIP] Add DSL support for calling effectors in YAML

    Adds a new DSL function `$brooklyn:effector` that takes two parameters, a 
string with the effector name and an optional map of the named effector 
arguments. Use in a blueprint wherever you can substitute a `$brooklyn` 
function, like this:
    
    ```YAML
    thing:
      $brooklyn:entity("other").effector("findInformation")
    stuff:
      $brooklyn:effector:
      - "getData"
      - arg1: "value"
        arg2: 3.14159d
        arg3: $brooklyn:config("key")
    ```
    
    See #153 for a complementary mechanism to create effectors in YAML directly.
    
    ### Issues
    
    It is hard to determine when the effector will be executed, but lazy 
evaluation can be effected by assigning the result of an `attributeWhenReady()` 
call to one of the effector arguments. It may be useful to have a version of 
the function that explicitly waits until some sensor has a specific value. 
Different predicates could be defined for start conditions, or implicit or 
explicit latches could be used. It would also be interesting to allow the tasks 
created when running an effector to be used in places like the 
`install.command` configuration of a `VanillaSoftwareProcess` in place of the 
SSH command executing task. This would require a version of the function that 
returned a `Task<?>` rather than a value directly, perhaps via another new 
function like `$brooklyn:task()`?
    
    Further work is still required to complete this feature, including more 
tests and documentation.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/grkvlt/brooklyn-server dsl-effector

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/155.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #155
    
----
commit 405c69bc65c274f60b7281b420003a71161599a9
Author: Andrew Donald Kennedy <[email protected]>
Date:   2016-05-23T22:31:13Z

    Add DSL support for calling effectors in YAML

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to