Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new abort / kill API #5

Closed
d4tocchini opened this issue Feb 28, 2015 · 4 comments
Closed

new abort / kill API #5

d4tocchini opened this issue Feb 28, 2015 · 4 comments

Comments

@d4tocchini
Copy link
Member

wants:

  • n.killPath() kill current path, same thing as else passing down error, stops at nearest continue or tree
  • n.killTree(), kills up to nearest tree, through any continue
  • n.killContestant() kill execution up to nearest contest, same thing as making contestant lose

By far most useful would be n.killPath.

Not sure about usefulness of killing up to nearest composite, but for that another method name maybe?

Another option would be

n.kill( type )

type in ['path', 'tree', 'composite', 'contest', 'root']

This was referenced Feb 28, 2015
@paulyoung
Copy link
Contributor

Having n.killX() appears to break encapsulation. Could n.abort() bubble up and be handled by whatever ancestor deems itself necessary to handle the error?

@d4tocchini
Copy link
Member Author

Yes, descendent aborts should be handled by an else, which is to say that all aborts would be what I was referring to as killTree - the same thing as if that subTree failed without a catching else

Clearly, abort should only terminate it's current tree & we really don't need different types of aborts because parent trees can decide whether or not they should abort too...

@d4tocchini
Copy link
Member Author

@bergie, this is the top of my wishlist :)

@paulyoung
Copy link
Contributor

I think we can close this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants