Github user aledsage commented on the issue:

    https://github.com/apache/brooklyn-server/pull/565
  
    @neykov you beat me to replying - agreed :-)
    
    @ahgittin to give some more background, the original use-case for 
"immediate" stemmed from a failure in clocker: 
https://github.com/brooklyncentral/clocker/blob/v2.1.0/swarm/catalog/swarm/swarm.bom#L260-L270
    
    In a `Transformer` enricher, the target value is evaluated each time the 
"trigger sensor" changes, but its value may not yet be resolvable. It uses the 
idea of "immediately" to avoid leaving a bunch of threads running - see 
https://github.com/apache/brooklyn-server/blob/rel/apache-brooklyn-0.10.0/core/src/main/java/org/apache/brooklyn/enricher/stock/Transformer.java#L81-L98.
 Originally this was purely time-based (cancel after 200ms).
    
    However, sometimes on a heavily loaded machine, the "immediately" would 
time out after 200ms even though the value really was available. The trigger 
sensor would never change again, so the target sensor would never be set.
    
    By adding `ImmediateSupplier` we were able to call something that would 
only return "absent" if it really could not be resolved yet.
    
    It is that style of use-case / usage that makes me want to let 
`$brooklyn:external` do IO operations (rather than aborting them by 
interrupting the thread).
    
    I believe this model would be simpler for a user to understand, rather than 
explaining to tell them that their config resolution will fail in certain 
situations, such as the `Transformer`, if it requires IO operations (e.g. if it 
tries to contact vault, or read from a file, etc).
    
    Longer term, I definitely want to get rid of the ugly/brittle "wait for up 
to 500ms", but I'd prefer we leave that in for a while longer rather than 
remove support for the above use-case.


---
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