Library for AWS SWF.
Fixes:
Fix:
Fixes:
New feature:
You can now set a custom error handler for failures. The signature of the method should contain actor
and exception
. To have it on the decider, just set on the flow: on_exception
and for activities, just set the on_exception
attribute on the create
method.
Example of a flow:
domain = 'dev'
name = 'country_flow'
def on_exception(actor, exception):
"""Handle exception.
"""
print(actor, exception)
create = activity.create(domain, name, on_exception=on_exception)
Introducing a few feature:
(Introduced in https://github.com/xethorn/garcon/pull/59)
Until now, the creation of the decider was automated. It means that adding conditions around activity execution, creating several activities from a loop was not easy (you had to use generators.) This change allows to manually write the decider.
Example:
def decider(schedule):
activity_1 = schedule(
'activity_1', test_activity_1)
activity_2 = schedule(
'activity_2', test_activity_2, requires=[activity_1])
for i in range(3):
activity_3 = schedule(
'activity-3.{}'.format(i), test_activity_3, requires=[activity_2])
if activity_3.ready and activity_2.result.get('4') == 4:
last_activity = schedule(
'last_activity.{}'.format(i), test_activity_last,
input=dict(the='end'))
Few things:
require
flag on them.)New feature:
Introduces:
The params notifies how information should be sent to the activity. For instance: if you have a local information (e.g. database username, password), you shouldn't send this information to SWF – instead, you can use the garcon.param.StaticParam
to provide this information.
Please note: external activities do not support this param.
Updates:
garcon.contrib
)Introduces: