Reactive when_file_changed decorator question

Merlijn Sebrechts merlijn.sebrechts at gmail.com
Thu Jan 28 14:55:52 UTC 2016


Hi Cory


I have a question about the reactive handlers. How exactly do
when_file_changed handlers get dispatched? Consider the following:


@when('init')
def handler1():
    change_file('file1')
    set_state('A')

@when_changed('file1')
def handler2():
    restart_service()

@when('A')
def handler3():
    change_file('file1')


The order in which handlers are dispatched is random afaik, so there is the
possibility that handler2 is executed before handler3. This would mean
file1 is changed again after executing handler2. Will handler2 be executed
again?



Kind regards
Merlijn Sebrechts
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20160128/4ac21d87/attachment.html>


More information about the Juju mailing list