Ejemplo n.º 1
0
                                        default_decision_duration=10,
                                        default_workflow_duration=60,
                                        default_child_policy='TERMINATE')
conf_use_activities.conf_activity('task', VERSION, 'tactivity')
conf_use_activities.conf_activity('short_task', VERSION, 'tactivity',
                                  schedule_to_close=1,
                                  retry=(0, ))
conf_use_activities.conf_activity('delayed_task', VERSION, 'tactivity',
                                  retry=(3, ))
conf_use_activities.conf_activity('non_existing_task', 1, 'xxx')

conf_use_workflow = SWFWorkflowConfig(default_task_list=TASKLIST,
                                      default_decision_duration=10,
                                      default_workflow_duration=60,
                                      default_child_policy='TERMINATE')
conf_use_workflow.conf_workflow('task', VERSION, 'TWorkflow')
conf_use_workflow.conf_workflow('short_task', VERSION, 'TWorkflow',
                                workflow_duration=1,
                                retry=(0, ))
conf_use_workflow.conf_workflow('delayed_task', VERSION, 'TWorkflow',
                                retry=(3, ))
conf_use_workflow.conf_workflow('non_existing_task', 1, 'xxx')


@conf_use_activities(version=VERSION)
@conf_use_workflow(version=VERSION, name='TestWorkflowW')
class TestWorkflow(BaseWorkflow):
    def __init__(self, task, short_task, delayed_task, non_existing_task):
        self.task = task
        self.short_task = short_task
        self.delayed_task = delayed_task
Ejemplo n.º 2
0
    default_decision_duration=10,
    default_workflow_duration=60,
    default_child_policy="TERMINATE",
)
conf_use_activities.conf_activity("task", VERSION, "tactivity")
conf_use_activities.conf_activity("short_task", VERSION, "tactivity", schedule_to_close=1, retry=(0,))
conf_use_activities.conf_activity("delayed_task", VERSION, "tactivity", retry=(3,))
conf_use_activities.conf_activity("non_existing_task", 1, "xxx")

conf_use_workflow = SWFWorkflowConfig(
    default_task_list=TASKLIST,
    default_decision_duration=10,
    default_workflow_duration=60,
    default_child_policy="TERMINATE",
)
conf_use_workflow.conf_workflow("task", VERSION, "TWorkflow")
conf_use_workflow.conf_workflow("short_task", VERSION, "TWorkflow", workflow_duration=1, retry=(0,))
conf_use_workflow.conf_workflow("delayed_task", VERSION, "TWorkflow", retry=(3,))
conf_use_workflow.conf_workflow("non_existing_task", 1, "xxx")


@conf_use_activities(version=VERSION)
@conf_use_workflow(version=VERSION, name="TestWorkflowW")
class TestWorkflow(BaseWorkflow):
    def __init__(self, task, short_task, delayed_task, non_existing_task):
        self.task = task
        self.short_task = short_task
        self.delayed_task = delayed_task
        self.non_existing_task = non_existing_task

    def call(self):
Ejemplo n.º 3
0
task_activity_workflow_rl = SWFWorkflowConfig(rate_limit=3)
task_activity_workflow_rl.conf_activity('task', version=1)

sa_workflow_custom_timers = SWFWorkflowConfig()
sa_workflow_custom_timers.conf_activity('task',
                                     version=1,
                                     heartbeat=10,
                                     schedule_to_start=11,
                                     schedule_to_close=12,
                                     start_to_close=13,
                                     task_list='TL', )

sa_workflow_custom_timers_W = SWFWorkflowConfig()
sa_workflow_custom_timers_W.conf_workflow('task',
                                      version=1,
                                      decision_duration=10,
                                      workflow_duration=11,
                                      task_list='TL',
                                      child_policy='TERMINATE')
task_red_activities_workflow = SWFWorkflowConfig()
task_red_activities_workflow.conf_activity('task', version=1)
task_red_activities_workflow.conf_activity('red', version=1)

worker = SWFWorkflowWorker()
worker.register(no_activity_workflow, NoTask, version=1)
worker.register(no_activity_workflow, Closure, version=1)
worker.register(no_activity_workflow, Arguments, version=1)
worker.register(task_activity_workflow, Dependency, version=1)
worker.register(task_activity_workflow, Parallel, version=1)
worker.register(task_activity_workflow_rl, Parallel, version=1, name='ParallelRL')
worker.register(no_activity_workflow, UnhandledException, version=1)
worker.register(task_activity_workflow, SingleTask, version=1)
Ejemplo n.º 4
0
sa_workflow_custom_timers = SWFWorkflowConfig()
sa_workflow_custom_timers.conf_activity(
    'task',
    version=1,
    heartbeat=10,
    schedule_to_start=11,
    schedule_to_close=12,
    start_to_close=13,
    task_list='TL',
)

sa_workflow_custom_timers_W = SWFWorkflowConfig()
sa_workflow_custom_timers_W.conf_workflow('task',
                                          version=1,
                                          decision_duration=10,
                                          workflow_duration=11,
                                          task_list='TL',
                                          child_policy='TERMINATE')
task_red_activities_workflow = SWFWorkflowConfig()
task_red_activities_workflow.conf_activity('task', version=1)
task_red_activities_workflow.conf_activity('red', version=1)

worker = SWFWorkflowWorker()
worker.register(no_activity_workflow, NoTask, version=1)
worker.register(no_activity_workflow, Closure, version=1)
worker.register(no_activity_workflow, Arguments, version=1)
worker.register(task_activity_workflow, Dependency, version=1)
worker.register(task_activity_workflow, Parallel, version=1)
worker.register(task_activity_workflow_rl,
                Parallel,
                version=1,
Ejemplo n.º 5
0
conf_use_activities.conf_activity('short_task',
                                  VERSION,
                                  'tactivity',
                                  schedule_to_close=1,
                                  retry=(0, ))
conf_use_activities.conf_activity('delayed_task',
                                  VERSION,
                                  'tactivity',
                                  retry=(3, ))
conf_use_activities.conf_activity('non_existing_task', 1, 'xxx')

conf_use_workflow = SWFWorkflowConfig(default_task_list=TASKLIST,
                                      default_decision_duration=10,
                                      default_workflow_duration=60,
                                      default_child_policy='TERMINATE')
conf_use_workflow.conf_workflow('task', VERSION, 'TWorkflow')
conf_use_workflow.conf_workflow('short_task',
                                VERSION,
                                'TWorkflow',
                                workflow_duration=1,
                                retry=(0, ))
conf_use_workflow.conf_workflow('delayed_task',
                                VERSION,
                                'TWorkflow',
                                retry=(3, ))
conf_use_workflow.conf_workflow('non_existing_task', 1, 'xxx')


@conf_use_activities(version=VERSION)
@conf_use_workflow(version=VERSION, name='TestWorkflowW')
class TestWorkflow(BaseWorkflow):