brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahgittin <>
Subject [GitHub] brooklyn-server issue #155: [WIP] Add DSL support for calling effectors in Y...
Date Wed, 01 Mar 2017 11:54:48 GMT
Github user ahgittin commented on the issue:
    Okay, the semantics that `some-config: $brooklyn:effector("foo")` means a single call
to `foo` (rather than a call on each lookup) is reasonable, although non-obvious, but that
means the call will happen once, _very_ early in the entity's lifecycle (when validation occurs),
so it's really a back-door way to trigger initialization actions.
    The ideal way to do this I think would be to get on to the `sequence-effector` idea we've
talked about.  But in the absence of that a simple and I think more transparent way to do
this would be to provide an `EffectorOnStartAndStopEntity` which you could do as follows:
    - type: EffectorOnStartAndStopEntity
      id:  key-generator-util-entity
        component: $brooklyn:entity("target")
        effector-name: make-key
        effector-params: [ 1, 2, 3]
        publish-result-as-sensor: my.key
    then wherever you need the "populate config on startup" behaviour you add the above as
a child that starts in parallel and you set the desired config to `$brooklyn:entity("key-generator-util-entity").attributeWhenReady("my.key")`

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 or file a JIRA ticket
with INFRA.

View raw message