While - Elixir macro for ruby traditional while - looking for feedback

Stream.repeatedly doesn’t take an arg, so it’d look more like:

Stream.repeatedly(&start_workers/1)
|> Enum.find(fn _ -> worker_online() == target end)

Regardless though, the root issue in this case is less about the chosen method of iteration and more about polling workers_online to determine if workers are in fact online. Message passing would be a lot more idiomatic here.

1 Like