4 ms·
The main difference is that reading from channels will block if its empty where Futures, return the same value. Written more concisely. f := New(func() Type{r
by stephen123 4y ago
The main difference is that reading from channels will block if its empty where Futures, return the same value.
Written more concisely.
f := New(func() Type{return t})
v := g.Get()
w := g.Get()
- ilyt 4y agoI wish Go had macros a'la Rust, it would be possible to write the whole thing in so much nicer way.
- philosopher1234 4y agosay good bye to all your nice tooling, fast compile times, uniform code bases... Programmer write cost <<<<<<<<< read cost
- sa46 4y agoWhen do you find reusing a promise useful? I know one canonical example is a loadable hashmap as in Concurrent Programming in Java, but I was curious if you knew of other examples.