On Oct 15, 2013, at 1:58 PM, Patrick Carlisle <patr...@puppetlabs.com> wrote:
> > On Tue, Oct 15, 2013 at 1:50 PM, Nick Lewis <n...@puppetlabs.com> wrote: >> If, in the course of implementing this, you happen to find it easy to >> implement an easy way to delay resources that might not be "ready", that >> would be awesome, too. That is, if there were a hook similar to those below >> that could be used to see if a resource is ready to run, then resources that >> aren't ready could be put into the back of the queue. This would be useful >> for things like waiting to bring up services until a remote required service >> is ready. >> > > Assuming I'm understanding correctly, this actually already basically > happens. Resources have a "suitable?" method, which currently just checks > whether the resource has a provider available. If the next unblocked (all > dependencies evaluated) resource in the list isn't suitable, it will be > deferred until the rest of the resources have been processed. Once there are > no more unblocked resources to process, the deferred resources are queued up > again. Repeat until we're either done or don't make progress in an iteration > (in which case we fail). > > The main difference is we currently expect readiness to be resolved simply by > applying resources. If we end up in a state where there are no ready > resources left we can say that you made some sort of mistake and the catalog > failed. If checking for readiness involves waiting on something external then > we have timeouts and external state dependencies and we have to answer some > harder questions about when to fail. I agree on both counts - it's a similar resource-deferral system, but as Patrick says, with different semantics. At the least, we'd need to provide a means for the user of specifying the remote resource dependency, and this would likely hook into the resource rather than the provider, like the current 'suitable?' check does. Anyway, just keeping it in mind is all I was really asking for right now, but I'd love to have that. For what it's worth, here's my prototype of a resource type that will just pause all execution (rather than delay resources): https://github.com/puppetlabs/puppetlabs-external_resource -- http://puppetlabs.com/ | http://about.me/lak | @puppetmasterd -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+unsubscr...@googlegroups.com. To post to this group, send email to puppet-dev@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-dev. For more options, visit https://groups.google.com/groups/opt_out.