aboutsummaryrefslogtreecommitdiff
path: root/shard/lib/app/pagestore.ex
diff options
context:
space:
mode:
Diffstat (limited to 'shard/lib/app/pagestore.ex')
-rw-r--r--shard/lib/app/pagestore.ex10
1 files changed, 5 insertions, 5 deletions
diff --git a/shard/lib/app/pagestore.ex b/shard/lib/app/pagestore.ex
index f093ed4..e09c513 100644
--- a/shard/lib/app/pagestore.ex
+++ b/shard/lib/app/pagestore.ex
@@ -107,7 +107,7 @@ defmodule SApp.PageStore do
case prefer_ask do
[_|_] ->
for peer <- prefer_ask do
- Shard.Manager.send(peer, {state.shard_id, state.path, {:get, key}})
+ Shard.Manager.send_pid(peer, {state.shard_id, state.path, {:get, key}})
end
_ ->
ask_random_peers(state, key)
@@ -123,14 +123,14 @@ defmodule SApp.PageStore do
{:noreply, state}
end
- def handle_cast({:msg, peer_id, _shard_id, _path, msg}, state) do
+ def handle_cast({:msg, conn_pid, _auth, _shard_id, _path, msg}, state) do
state = case msg do
{:get, key} ->
case :dets.lookup state.store, key do
[{_, _, bin}] ->
- Shard.Manager.send(peer_id, {state.shard_id, state.path, {:info, key, bin}})
+ Shard.Manager.send_pid(conn_pid, {state.shard_id, state.path, {:info, key, bin}})
_ ->
- Shard.Manager.send(peer_id, {state.shard_id, state.path, {:not_found, key}})
+ Shard.Manager.send_pid(conn_pid, {state.shard_id, state.path, {:not_found, key}})
end
state
{:info, hash, bin} ->
@@ -157,7 +157,7 @@ defmodule SApp.PageStore do
value = SData.term_unbin bin
for dep <- SData.Page.refs value do
if :dets.lookup state.store, dep == [] do
- init_rec_pull(state, dep, sub_why, [peer_id])
+ init_rec_pull(state, dep, sub_why, [conn_pid])
end
end
end