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)
|
new_chunks = MapSet.difference(chunks, prev_chunks)
|
||||||
# We can process all chunks in parallel
|
# We can process all chunks in parallel
|
||||||
me = self()
|
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,
|
new_chunks,
|
||||||
fn chunk -> process_chunk(me, chunk, state) end,
|
fn chunk -> process_chunk(me, chunk, state) end,
|
||||||
[ordered: false]
|
[ordered: false]
|
||||||
) |> Stream.run()
|
) |> Stream.run() end)
|
||||||
end
|
end
|
||||||
loop(socket, connstate, version, state)
|
loop(socket, connstate, version, state)
|
||||||
{:send_packet, packet} ->
|
{:send_packet, packet} ->
|
||||||
|
Loading…
Reference in New Issue
Block a user