Comments (2)
The limitation of vargarg
or any other sequence type is that it can only be typed as a whole. Thus when combining/zipping/merging promises of different types you have to resort to a more general type. E.g.:
val p1 : Promise<String, Exception> = //...
val p2 : Promise<Integer, Exception> = //...
//function all does actually exist since 0.1.0 but is undocumented
//since I haven't made my mind up about the signature
val combinedP : Promise<List<Any>, Exception> = all<Any, Exception>(p1, p2)
To use the values you either have to cast the results of new List
or I have introduce get()
on the promises treat all
more like a latch. get()
is one of the considerations of introducing.
It would be interesting whether in the future the Kotlin compiler would be flexible enough to retain types for variable lengths of arguments. There seems to be some groundwork for this with functions in the upcoming M12
For now the Tuples serve a distinct purpose and therefor will stay.
Closing this issue since there is no viable alternative yet.
from kovenant.
Everything that has to do with combining is moved to a separate project. So you can cherry pick. See http://komponents.myjetbrains.com/youtrack/issue/KOV-5
from kovenant.
Related Issues (14)
- Nested promise never complete with all HOT 3
- Android - `onTerminate` will never be called in production environments
- Kotlin Multiplatform support HOT 1
- Question about chaining long processes. HOT 1
- Blocking call in task HOT 2
- unwrapping the return Promise of then HOT 1
- Not supported anymore? HOT 6
- Deferred promise in the middle of chain?
- Using deferred promise in middle of chain..
- Question about chaining with `all()`
- Move the code into a module, so we can do pull requests for additional modules HOT 2
- extension "then" on promise<T, Exception> need one for <T, Throwable> HOT 3
- Rethrow exception in fail block HOT 5
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 kovenant.