Comments (8)
Is it possible to config a parallel()? For example to choose behavior: failure if any fail and vice versa, wait first finished only, wait all etc
from stories.
I think it could be split into several context managers.
parallel
will execute every step specifiedwait_first
will wait for the first step which returnsSuccess
. A step could returnSkip
marker to specify if we should ignore its status. #141 could be considered as well to give the marker a proper name.
In my opinion, this feature should not change the semantic of the Result
and Failure
markers. We also should not ignore uncaught exceptions in any steps.
Would it work for you?
from stories.
I think it could be split into several context managers.
parallel
will execute every step specifiedwait_first
will wait for the first step which returnsSuccess
. A step could returnSkip
marker to specify if we should ignore its status. #141 could be considered as well to give the marker a proper name.In my opinion, this feature should not change the semantic of the
Result
andFailure
markers. We also should not ignore uncaught exceptions in any steps.Would it work for you?
Yes wait_first
sounds as good solution. Also I agree we have to keep current semantic. More over I think Skip
is right naming in this context, because it closely to Ignore semantic then Break
in #141. I guess we need something like a parallel_ignore_failure
for case when we want run few tasks and want success any one. For example send a notification by mail, slack and push.
from stories.
For example send a notification by mail, slack, and push.
Is it really a parallel task? Or we want it to be a sequence that will exit after the first successful execution?
from stories.
Syntax:
from stories import story, parallel class Order: @story def purchase(I): I.one with parallel: I.two I.three I.fourRequirements:
- This feature should work both for sync and async stories. The semantic of execution and decision making should be the same. Or at least as close as possible.
parallel
should have at least two steps in it.- Context changes made by
two
should not be visible to thethree
and wise versa. Context changes made bytwo
andthree
should be visible byfour
.two
,three
or both of them could be a substory. Context restrictions continue to be the same independent from this detail.- If some of the step returns
Result
this will be a result of the whole story. If other parallel steps are still running, their result should be ignored when they return. The story returns only after all the steps complete. If other running steps returnsFailure
orResult
a warning of this clash should be reported.- If some of the step returns
Failure
this will be a failure of the whole story. If other parallel steps are still running, their result should be ignored when they return. The story fails only after all the steps complete. If other running steps returnsFailure
orResult
a warning of this clash should be reported.<parallel>
should be present in the representation of the story.- History representation should contain the execution of all steps in order of the actual execution even if it is mixed between parallel substories.
- The warning mentioned by items 5 and 6 of this list should be present in history representation as well.
Why don't we group the failures' reasons in a tuple and return that as a Failure
instead of warning about other failures.
If there's a result and a failure, I think I'd rather the story to fail since it didn't complete successfully.
from stories.
Maybe we should not allow returning Result
or Failure
markers from the steps and substories within a parallel section?
from stories.
That's going to be a problem. Stories and steps can fail.
They can also return results.
from stories.
Superseded by #39
from stories.
Related Issues (20)
- State union should fail on Variable normalization conflict. HOT 1
- State union should fail on Argument normalization conflict. HOT 1
- Only State subclasses are allowed to join the union. HOT 1
- Story step could assign state variable.
- State representation should support variable aliases. HOT 1
- Deny empty string in conditional declaration. HOT 1
- Story could define an actor. HOT 1
- Deny to use stories with different actors in composition. HOT 1
- Actor class representation should show stories assigned to it. HOT 1
- Deny to instantiate actor class and its subclasses. HOT 1
- Deny to use `Actor` class directly in the story. HOT 1
- Add Variable and Argument placeholders. HOT 1
- Any examples when i need to return a database object from a story? HOT 3
- Document feature flags.
- Examples for attrs library should use modern syntax.
- Validate early, error lately.
- Other state unions could join the union. HOT 1
- Do not reinvent DTOs with State object.
- Story should return its execution result. HOT 1
- Question: A way to see initial attributes for a story like @attributes in version 0.15.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stories.