todo: fix links
* First one wins * What is a race? * Do multiple things at the same time, get the first result * Loser cancellation (but not validated in this scenario) * Result Oriented Programming * ZIO, Kyo, Ox * ZIO & Kyo - Effect Oriented * Direct syntax explanation * Ox * non effect oriented * race isn’t on a datatype * def instead of val * Loom * Kyo * Multiple effect types * val that absolves the Requests * Rust * Macro for race * async functions * Java * Scopes to define SC * ShutdownOnSuccess is the race * Direct Loom usage * client.send is blocking but not really
* An error loser does not win or cancel the race
* 10000 concurrent requires efficient resource utilization * ZIO * raceAll to send a Seq * Rust * No macro for you. Multiple Producer, Single Consumer Channel
* Talking points * Validating that a connection is open for 1 second, then closed * Timeout’d racer doesn’t fail the race * Timeout shouldn’t block the main thread * Timeout with SC is generally implemented with a race * ZIO * we want the loser to fail (default .timeout returns an Option) * Ox * timeout is not on a datatype * Java * The timeout is a race within the request race * Rust * Error types get combined
* Modifying the task based on the value it produces * Different HTTP clients handle response codes differently and some mapping of non-2xx to fail the request is sometimes necessary
Some use different libraries when your arity goes from 2 to 3
* Hedging is a common use case for race * why & example of hedging. P99 * Different approaches to a “delay” and like timeout, it shouldn’t block the main thread
* Resource management - how hard is it to be sure open resources get closed with success & failures * Effect systems make resources management + concurrency easy * ZIO * Managed with acquireReleaseWith * Semantic blocking on close * Uninterruptible on acquire * .disconnect will fork the close * Ox * unsupervised & forkPlain
* Different APIs to make reqs in parallel and return all/some results * Different semantics for only keeping successes * ZIO * collectAllSuccessesPar
* Cancellation of blocking operations * Is it possible? How? * ZIO * attemptBlockingInterrupt * Java & Ox * Thread.interrupted * Rust * Cancellation token * Recursion of async stuff * Stack safe? * Java * Yuck * Rust * #[async_recursion] ?