python-simple-workflow icon indicating copy to clipboard operation
python-simple-workflow copied to clipboard

models.event: non-deterministic lookup in factory

Open ggreg opened this issue 10 years ago • 0 comments

The way simple-workflow lookups the name of event types is non-deterministic. It iterates of the keys of the EVENTS dict. There is no guaranty in the order of keys in a Python dict, that's why there is a collections.OrderedDict class. Thus when it encounters a StartChildWorkflowExecutionInitiated event it either returns a ChildWorkflowExecution or a WorkflowExecution type. I had the two cases by executing code with CPython2.7 (returns WorkflowExecution) and pypy 2.5.0 (returns ChildWorkflowExecution), though of course it depends on the environment and not on the interpreter itself (even CPython2.7 dict may iterate keys on a different order).

ggreg avatar Mar 24 '15 15:03 ggreg