adler/awsheet — pull request #5 by jl2501 (2014-04-25 21:54:43+00:00)
Title: Sg refactor

Add primitive orchestration ability to Heet
This PR adds:
* a named dictionary of resources
* an add_dependent_resource() method to allow convergence of specific resource attributes to be delayed until script exit

The named dictionary of resources allows resources within a Heet module to know about and refer to other resources by a resource reference, which is simply the heet base name of the resource prefixed with an '@' character.

The add_dependent_resource() takes a resource and a tag which tags the event that occured. The resource that calls this method must implement its own method called converge_dependency() that takes one argument which is the same tag name that was passed in to the Heet object's add_dependent_resource() call. This allows a resource to have multiple requests that refer to different events that must be handled seperately at a later time. This support is primitive in the sense that the only problem directly solved by this (as seen currently by the author) is for an object to be able to wait until it has a reference to all the other objects in the module. It does not directly address any more complex orchestration needs such as a 3 or more step process involving 2 or more resources requiring a strictly ordered execution of specific tasks, however, it does allow Heet to stay simple while allowing for resources to implement this type of logic directly if it is indeed needed for a project.