Parallel and/or with short-circuit in Elixir
Parallel and/or with short-circuit in Elixir
Hi, this can terminate when either branch of and/or terminates early and short-circuits the operator. def or_(task1, task2) do parent = self pid1 = spawn(fn -> send parent, task1.() end) pid2 = spawn(fn -> send parent, task2.() end) receive do false -> receive do result2 -> Process.exit pid1, :kill Process.exit pid2, :kill result2 end true -> Process.exit pid1, :kill Process.exit pid2, :kill true end end https://gist.github.com/roehst/e98a9b0703ceb75d85f7b212b60005ee
Share cardActual performance
Launch Intel predictions
Analyze your own launch →Incorrect prediction on native model
Similar products
A Parallel Implementation of Graph2Vec
A Parallel Implementation of Graph2Vec
Parallel Gospel
Sorts – parallel radix- and quicksort in Go
Modeling parallel (and hierarchical) agents with Burr
Abstract Calculus, a massively parallel model of computation
WIP] Zephyr NN Jax FrameworkL Short, Simple, Declarative
API for dig +short
Axiom v2.0 – Parallel Ingestion at 125M rows/SEC
Kaleidoscope – A Parallel AI Agent TUI