Promises[A: Any #share]¶
Constructors¶
create¶
Returns¶
- Promises[A] val^
Public Functions¶
join¶
Create a promise that is fulfilled when all promises in the given sequence are fulfilled. If any promise in the sequence is rejected then the new promise is also rejected. The order that values appear in the final array is based on when each promise is fulfilled and not the order that they are given.
Join three existing promises to make a fourth.
use "promises"
actor Main
new create(env: Env) =>
let p1 = Promise[String val]
let p2 = Promise[String val]
let p3 = Promise[String val]
Promises[String val].join([p1; p2; p3].values())
.next[None]({(a: Array[String val] val) =>
for s in a.values() do
env.out.print(s)
end
})
p2("second")
p3("third")
p1("first")
Parameters¶
Returns¶
eq¶
Parameters¶
- that: Promises[A] val
Returns¶
- Bool val
ne¶
Parameters¶
- that: Promises[A] val
Returns¶
- Bool val