Created
May 17, 2011 07:11
-
-
Save anonymous/976077 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define array_scaling | |
# | |
# making sure some initial fields are set | |
precondition | |
server_array_href type: string, empty: false | |
# | |
# body of the process | |
repeat | |
server_array list_instances | |
# sets the 'instances' workitem field | |
make_scaling_decision | |
# has to be provided by the user, as a participant | |
subprocess 'scale_${scaling_direction}', if: '${scaling_count} != 0' | |
# 'scale_up' or 'scale_down' | |
wait '${scaling_rest_time}' | |
# this field was computed by 'make_scaling_decision' | |
# | |
# default/suggested implementations for the subflows | |
# | |
# may be overriden by the user | |
define scale_up | |
citerator times: '$f:scaling_count', merge_type: union | |
server_array launch_next_instance, id: '${v:i}' | |
define scale_down | |
server_array select_oldest_instances | |
citerator on: '${oldest_instances}', to: instance_href | |
instance terminate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment