在Kotlin的zip方法中,用作参数的Observable数量似乎受到限制。如果这是正确的,最好的选择是什么?
例如,当我使用9个参数时,它可以按预期工作。当我添加第十个参数时,我收到错误消息:无法推断该参数的类型。请明确指定
Observable.zip(
//TODO: parameterize exchange symbols based on pair
methodOne() as Observable<Any>),
methodTwo() as Observable<Any>),
methodThree() as Observable<Any>),
methodFour() as Observable<Any>),
methodFive() as Observable<Any>),
methodSix() as Observable<Any>),
methodSeven() as Observable<Any>),
methodEight() as Observable<Any>),
methodNine() as Observable<Any>),
{ oneResult, twoResult, threeResult, fourResult, fiveResult, sixResult, sevenResult, eightResult, nineResult ->
//logic here applying computation to results
})
.subscribe(
{},
{
println(String.format("Error: %s", it.message))
})
.unsubscribe()
}
小怪兽爱吃肉
相关分类