9 ms·
Congratulations on the project! It works great, until we need to handle the best part of Elixir, that's creating multiple actors. This Task code, for example d
by pesnk 1y ago
Congratulations on the project!
It works great, until we need to handle the best part of Elixir, that's creating multiple actors.
This Task code, for example doesn't work.
Enum.map(0..10, fn(_) ->
Task.async(fn -> IO.puts("new process") end)
end) |> Task.await_many()
- mathek 1y agoTasks seem not to work indeed, but spawning processes works. Try Enum.map(1..10, fn _i -> spawn(fn -> IO.puts("new process") end) end) Also, there are two scenarios: compiling code in the browser and running it, and running precompiled code in the browser. In the latter case more things work, for example the 'game of life' example uses GenServers, Supervisors and Registry: https://popcorn.swmansion.com/game_of_life/ https://popcorn.swmansion.com/game_of_life/ https://github.com/software-mansion/popcorn/tree/main/examples/game_of_life https://github.com/software-mansion/popcorn/tree/main/exampl... But yes, it's still unstable. Improving the stability is our main focus right now.