Skip to main content

Amazon SWF library

Project description

Goal

The goal of this library is to allow the creation of Amazon Simple Workflow without the need to worry about the orchestration of the different activities and building out the different workers. This framework aims to help simple workflows. If you have a more complex case, you might want to use directly boto.

Code sample

The code sample shows a workflow that has 4 activities. It starts with activity_1, which after being completed schedule activity_2 and activity_3 to be ran in parallel. The workflow ends after the completion of activity_4 which requires activity_2 and activity_3 to be completed.

Example:

import boto.swf.layer2 as swf

from garcon import activity
from garcon import task


domain = 'dev'
create = activity.create(domain)

activity_1 = create(
    name='activity_1',
    tasks=task.SyncTasks(
        lambda: print('activity_1')))

test_activity_2 = create(
    name='activity_2',
    requires=[test_activity_1],
    tasks=task.AsyncTasks(
        lambda: print('activity_2_task_1'),
        lambda: print('activity_2_task_2')))

test_activity_3 = create(
    name='activity_3',
    requires=[test_activity_1],
    tasks=task.SyncTasks(
        lambda: print('activity_3')))

test_activity_4 = create(
    name='activity_4',
    requires=[test_activity_3, test_activity_2],
    tasks=task.SyncTasks(
        lambda: print('activity_4')))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Garcon-0.0.2a1.tar.gz (8.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page