Distributor should excert backpressure due to filtering overhead
This commit is contained in:
parent
c74d1b061c
commit
30daf44281
|
@ -58,7 +58,7 @@ defmodule Floof.Distributor do
|
|||
end
|
||||
|
||||
@impl true
|
||||
def handle_cast({:xfer, {origin, dcdhash, dcd}}, state) do
|
||||
def handle_call({:xfer, {origin, dcdhash, dcd}}, _, state) do
|
||||
# we split the state such that only the parts necessary get
|
||||
# copied into the spawned-off process
|
||||
fconf = dstate(state, :fconf)
|
||||
|
@ -99,7 +99,7 @@ defmodule Floof.Distributor do
|
|||
end)
|
||||
end
|
||||
|
||||
{:noreply, state}
|
||||
{:reply, :ok, state}
|
||||
end
|
||||
|
||||
@impl true
|
||||
|
|
|
@ -6,7 +6,7 @@ defmodule Floof.Message do
|
|||
def emit(xf) do
|
||||
{:XferBlob, _, _, _, xfinner} = xf
|
||||
mhash = :crypto.hash(:blake2b, xfinner)
|
||||
GenServer.cast(Floof.Distributor, {:xfer, {self(), mhash, xf}})
|
||||
GenServer.call(Floof.Distributor, {:xfer, {self(), mhash, xf}})
|
||||
mhash
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue