Generating a stream using Stream.resource
Stream.resource is a powerful function that can be a bit confusing to use. See some examples from generating prime numbers to executing a long-running function on each item in a enum in parallel.
Read next Elixir ETS/DETS/Mnesia/BEAM vs Redis