Re: Attempt At Futures

2016-04-09 Thread Leonardo Borges
Something like imminent might be useful here. In particular the section about combinators: https://github.com/leonardoborges/imminent#combinators On Sat, Apr 9, 2016 at 9:33 PM Gary Verhaegen wrote: > You could: > > * Create all futures *without* deref'ing them, so they all start in > parallel

Re: Attempt At Futures

2016-04-09 Thread Gary Verhaegen
You could: * Create all futures *without* deref'ing them, so they all start in parallel; * Loop through the futures, asking them if they have finished, and print those that have (and remove them from the list) But if you want to get each result as it comes back, it's probably a better fit for cor

Re: Attempt At Futures

2016-04-08 Thread Kevin Downey
The thing to remember is map is lazy, so you are lazily (on demand) creating a bunch of futures. Then doseq walks through those futures, demanding one at a time. You deref the future immediately after doseq requested it from the lazy-seq and are blocking on its completion then doseq can move on to

Attempt At Futures

2016-04-08 Thread Chris White
Spoiler alert: I'm really really new to this language so don't expect quality code In an attempt to see how futures work I'm trying to make code that does the following: 1. Take a list of sites 2. Loop through the sites and retrieve the HEAD content via a future for each individual si