-
Notifications
You must be signed in to change notification settings - Fork 148
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
Create base class for promises #35
base: master
Are you sure you want to change the base?
Conversation
This allows code which can handle any type of promise. Creating IPromiseBase allows IPromise, IPromise<int>, and IPromise<MyFunClass> to all be treated identically, without creating code branches for each. The IPromiseBase interface is implemented explicitly, which avoids creating ambiguous functions. Additionally, the Promise_Base class allows for a decent amount of code reuse between generic and non-generic promises.
This looks great - would definitely be a good addition to the library. There are couple of things that would be good to change before we merge it though. Some of the new methods don't have It would also be good to have a couple of extra tests to test chaining different types of promise together, now that that is possible. |
Writing tests made me realize I missed some functionality. I'll have to implement a few more things before this is ready. |
That's fine. Let us know when this pull request is ready to merge and we'll take another look at it. |
What is the status of this @nloewen? This would be a very nice addition, just asking before I implement this myself. What functionality was missing? |
It's unlikely I'll get around to completing this. I don't recall what functionality was missing. Most likely some combination of chained promises wasn't supported. If you start adding test cases, I'm sure you'll find it. |
This allows code which can handle any type of promise. Creating IPromiseBase allows IPromise, IPromise<int>, and IPromise<MyFunClass> to all be treated identically, without creating code branches for each. The IPromiseBase interface is implemented explicitly, which avoids creating ambiguous functions.
Additionally, the Promise_Base class allows for a decent amount of code reuse between generic and non-generic promises.