Performance tweaks
This commit is contained in:
parent
18a80874df
commit
847644d8cf
@ -87,11 +87,13 @@ defmodule Amethyst.ConnectionHandler do
|
||||
new_chunks = MapSet.difference(chunks, prev_chunks)
|
||||
# We can process all chunks in parallel
|
||||
me = self()
|
||||
Task.Supervisor.async_stream(state |> Map.get(:game) |> Map.get(:refs) |> Map.get(:task_supervisor),
|
||||
ts = state |> Map.get(:game) |> Map.get(:refs) |> Map.get(:task_supervisor)
|
||||
Task.Supervisor.async(ts, fn ->
|
||||
Task.Supervisor.async_stream(ts,
|
||||
new_chunks,
|
||||
fn chunk -> process_chunk(me, chunk, state) end,
|
||||
[ordered: false]
|
||||
) |> Stream.run()
|
||||
) |> Stream.run() end)
|
||||
end
|
||||
loop(socket, connstate, version, state)
|
||||
{:send_packet, packet} ->
|
||||
|
Loading…
Reference in New Issue
Block a user