@sync_performer
def perform_sequence(dispatcher, intent):
 effects = list(intent.effects)
 if (not effects):
  return []
 results = []
 def succeed(next_effect, result):
  results.append(result)
  return next_effect
 def fail(result):
  reraise(SequenceFailed, SequenceFailed(results=results, exc_info=result), result[2])
 def reducer(next_effect, effect):
  return effect.on(success=partial(succeed, next_effect), error=fail)
 return reduce(reducer, reversed(effects), results)

@ sync_performer def perform_sequence ( dispatcher , intent ) : effects = list ( intent . effects ) if ( not effects ) : return [ ] results = [ ] def succeed ( next_effect , result ) : results . append ( result ) return next_effect def fail ( result ) : reraise ( SequenceFailed , SequenceFailed ( results = results , exc_info = result ) , result [ 2 ] ) def reducer ( next_effect , effect ) : return effect . on ( success = partial ( succeed , next_effect ) , error = fail ) return reduce ( reducer , reversed ( effects ) , results )
performer for :class:sequence .