<div dir="ltr">This might be a true problem when you don't map what event should fire what code in the hook. The majority, if not all, of charms that currently implement this pattern do so by either using charm-helpers or by having a giant if/else case statement at the bottom of the hook which maps which code should execute with each hook that has invoked the symlink'd file. I can take a survey of current charms which use symlinks to see if any don't fit this pattern.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Aug 17, 2014 at 6:28 AM, John Meinel <span dir="ltr"><<a href="mailto:john@arbash-meinel.com" target="_blank">john@arbash-meinel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The main problem with having a hook that just fires instead of the others is that you end up firing a hook a whole bunch of times where it essentially "does nothing" because it is still waiting for some other hook for it to actually be ready. The "something-changed" proposal essentially colapses the 10 calls to various hooks into a single firing.<div>
<br></div><div>William has thought much more about it, so I'd like him to fill in any details I've missed.<br><div><br></div><div>John</div><div>=:-></div></div><div><br></div></div><div class="HOEnZb"><div class="h5">
<div class="gmail_extra"><br>
<br><div class="gmail_quote">On Sun, Aug 17, 2014 at 1:59 PM, Nate Finch <span dir="ltr"><<a href="mailto:nate.finch@canonical.com" target="_blank">nate.finch@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">That's an interesting document, but I feel like it doesn't really explain the problem it's trying to solve. <div><br></div><div>Why does a single entry point cause a lot of boilerplate (I presume he means code boilerplate)? Isn't it just a switch on the name of the hook? What does it mean "when a new hook is introduced"? Doesn't the charm define what hooks it has? And wouldn't the aforementioned switch mean that any new hook (whatever that means) would be ignored the same way it would if the hook file wasn't there?</div>
<div><br></div><div>Can someone explain to me what exactly the problem is?</div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Aug 17, 2014 at 1:30 AM, John Meinel <span dir="ltr"><<a href="mailto:john@arbash-meinel.com" target="_blank">john@arbash-meinel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I'd just like to point out that William has thought long and hard about this problem, and what semantics make the most sense (does it get called for any hook, does it always get called, does it only get called when the hook doesn't exist, etc).<br>
</div><div>I feel like had some really good decisions on it: <a href="https://docs.google.com/a/canonical.com/document/d/1V5G6v6WgSoNupCYcRmkPrFKvbfTGjd4DCUZkyUIpLcs/edit#" target="_blank">https://docs.google.com/a/canonical.com/document/d/1V5G6v6WgSoNupCYcRmkPrFKvbfTGjd4DCUZkyUIpLcs/edit#</a></div>
<div><br></div><div>default-hook sounds (IMO) like it may run into problems where we do logic based on whether a hook exists or not. There are hooks being designed like leader-election and address-changed that might have side effects, and default-hook should (probably?) not get called for those.</div>
<div><br></div><div>I'd just like us to make sure that we actually think about (and document) what hooks will fall into this, and make sure that it always makes sense to rebuild the world on every possible hook (which is how charm writers will be implementing default-hook, IMO).</div>
<div><br></div><div>John</div><div>=:-></div><div><div><div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Aug 16, 2014 at 1:02 AM, Aaron Bentley <span dir="ltr"><<a href="mailto:aaron.bentley@canonical.com" target="_blank">aaron.bentley@canonical.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<div><br>
On 14-08-15 04:36 PM, Nate Finch wrote:<br>
> There's new hook in town: default-hook. If it exists and a hook<br>
> gets called that doesn't have a corresponding hook file,<br>
> default-hook gets called with the name of the original hook as its<br>
> first argument (arg[1]).<br>
><br>
> That's it.<br>
<br>
</div>Nice! Thank you.<br>
<br>
Aaron<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1<br>
<br>
iQEcBAEBAgAGBQJT7nVvAAoJEK84cMOcf+9h90UH/RMVabfJp4Ynkueh5XQiS6mD<br>
TPWwY0FVHfpAWEIbnQTQpnmkhMzSOKIFy0fkkXkEx4jSUt6I+iNYXdu8T77mA38G<br>
7IZ7HAi+dAzRCrGTIZHsextrs5VpxhdzFJYOxL+TN5VUWYt+U+awSPFn0MlUZfAC<br>
5aUuV3p3KjlHByLNT7ob3eMzR2mwylP+AS/9UgiojbUOahlff/9y83dYqkCDYzih<br>
C2rlwf0Wal12svu70ifggGKWcnF/eiwSm4TQjJsfMdCfw0gSg4ICgmIbWQ78OytJ<br>
AM4UBk1/Ue94dUm3YP+lcgAqJCC9GW5HksCFN74Qr+4xcnuqYoCJJxpU5fBOTls=<br>
=5YwW<br>
-----END PGP SIGNATURE-----<br>
<div><div><br>
--<br>
Juju-dev mailing list<br>
<a href="mailto:Juju-dev@lists.ubuntu.com" target="_blank">Juju-dev@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju-dev</a><br>
</div></div></blockquote></div><br></div></div></div></div>
<br>--<br>
Juju-dev mailing list<br>
<a href="mailto:Juju-dev@lists.ubuntu.com" target="_blank">Juju-dev@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju-dev</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div><br>--<br>
Juju-dev mailing list<br>
<a href="mailto:Juju-dev@lists.ubuntu.com">Juju-dev@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju-dev</a><br>
<br></blockquote></div><br></div>