Snippets tagged hopac

  • "Fastest wins" parallel download with Hopac

    One of the main features of Hopac - selective synchronization using "alternatives". In this snippet we download three web pages in parallel and the one that finishes first "wins" (or the timeout alternative becomes available for picking). What's nice in this solution is that the other two downloading jobs are cancelled immediately when the winner/timeout is available (i.e. an implicitly provided to the Asyncs CancellationTokens are cancelled). Alts is highly composable and, for example, the whole Alt.choose [ ... ] thing could be nested in another Alt.choose or combined with <|> or <&> operators with another Alt and so on.

    3 people like this

    Posted: 9 years ago by Vasily Kirichenko

  • Joinads' "One place buffer" sample ported to Hopac

    https://github.com/tpetricek/FSharp.Joinads/blob/master/src/Joins/Samples.fs#L60 ported to Hopac.

    1 people like this

    Posted: 9 years ago by Vasily Kirichenko

  • Experimenting with Hopac

    We sometimes come across business processes where it's important to respond within a particular time window. Here's an experiment modelling that with Hopac

    2 people like this

    Posted: 9 years ago by mavnn