Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Lightweight library for AWS SWF.

Project Description

Lightweight library for AWS SWF.

Garcon deals with easy going clients and kitchens. It takes orders from clients (deciders), and send them to the kitchen (activities). Difficult clients and kitchens can be handled directly by the restaurant manager.

Requirements

  • Python 2.7, 3.4 (tested)
  • Boto 2.34.0 (tested)

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.

from __future__ import print_function

from garcon import activity
from garcon import runner


domain = 'dev'
name = 'workflow_sample'
create = activity.create(domain, name)

test_activity_1 = create(
    name='activity_1',
    run=runner.Sync(
        lambda activity, context: print('activity_1')))

test_activity_2 = create(
    name='activity_2',
    requires=[test_activity_1],
    run=runner.Async(
        lambda activity, context: print('activity_2_task_1'),
        lambda activity, context: print('activity_2_task_2')))

test_activity_3 = create(
    name='activity_3',
    requires=[test_activity_1],
    run=runner.Sync(
        lambda activity, context: print('activity_3')))

test_activity_4 = create(
    name='activity_4',
    requires=[test_activity_3, test_activity_2],
    run=runner.Sync(
        lambda activity, context: print('activity_4')))

Application architecture

.
├── cli.py # Instantiate the workers
├── flows # All your application flows.
│   ├── __init__.py
│   └── example.py # Should contain a structure similar to the code sample.
├── tasks # All your tasks
│   ├── __init__.py
│   └── s3.py # Task that focuses on s3 files.
└── task_example.py # Your different tasks.

Contributors

  • Michael Ortali
  • Adam Griffiths
  • Raphael Antonmattei
Release History

Release History

This version
History Node

0.3.5

History Node

0.3.4

History Node

0.3.3

History Node

0.3.2

History Node

0.3.1

History Node

0.3.0

History Node

0.2.3

History Node

0.2.2

History Node

0.2.1

History Node

0.2.0

History Node

0.1.0

History Node

0.0.7

History Node

0.0.6

History Node

0.0.5

History Node

0.0.4

History Node

0.0.3

History Node

0.0.2

History Node

0.0.2a10

History Node

0.0.2a8

History Node

0.0.2a7

History Node

0.0.2a6

History Node

0.0.2a5

History Node

0.0.2a4

History Node

0.0.2a3

History Node

0.0.2a2

History Node

0.0.2a1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
Garcon-0.3.5.tar.gz (28.8 kB) Copy SHA256 Checksum SHA256 Source Aug 22, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting