Last active
July 20, 2016 23:36
-
-
Save cyounkins/a9f0a0fb87a250fea877d72ae9c3f86c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from pyswfaws.datastores import * | |
from pyswfaws.serializers import * | |
from pyswfaws.decorators import * | |
from pyswfaws.activityworker import * | |
from pyswfaws.decisionworker import * | |
@activity_task(swf_domain='test', swf_task_type='TestActivityA', swf_task_version='1.0', | |
swf_task_list='task_list', | |
input_data_serializer=JsonSerializer(), input_data_store=SwfDataStore(), | |
result_data_serializer=JsonSerializer(), result_data_store=SwfDataStore()) | |
def activity_task_a(a): | |
return a * a | |
if __name__ == "__main__": | |
activity_task_a_runner = DistributedActivityWorker(activity_task_a) | |
activity_task_a_runner.start() |
This file contains hidden or 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
from pyswfaws.datastores import * | |
from pyswfaws.serializers import * | |
from pyswfaws.decorators import * | |
from pyswfaws.activityworker import * | |
from pyswfaws.decisionworker import * | |
@decision_task(swf_domain='test', swf_workflow_type='TestWorkflow', swf_workflow_version='1.0', | |
swf_task_list='task_list', | |
input_data_store=SwfDataStore(), input_data_serializer=JsonSerializer(), | |
result_data_store=SwfDataStore(), result_data_serializer=JsonSerializer()) | |
def decider_a(): | |
a1 = activity_task_a(5) | |
a2 = activity_task_a(10) | |
return a1.result + a2.result | |
if __name__ == "__main__": | |
decision_task_a_runner = DistributedDecisionWorker(decider_a) | |
decision_task_a_runner.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment