aboutsummaryrefslogtreecommitdiff
path: root/shard/lib/app/pagestore.ex
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2018-10-11 15:11:52 +0200
committerAlex Auvolat <alex@adnab.me>2018-10-11 15:11:52 +0200
commit1646bc57eae9880fd408d23ca692364dc6fd6442 (patch)
tree0f65d47498f33772152b20ee082d34e218f16df4 /shard/lib/app/pagestore.ex
parenteb8c949551ffb8b3600357d7ff2bebe750af96e5 (diff)
downloadshard-1646bc57eae9880fd408d23ca692364dc6fd6442.tar.gz
shard-1646bc57eae9880fd408d23ca692364dc6fd6442.zip
Move somme functionnality to SNet.Manager
Diffstat (limited to 'shard/lib/app/pagestore.ex')
-rw-r--r--shard/lib/app/pagestore.ex8
1 files changed, 4 insertions, 4 deletions
diff --git a/shard/lib/app/pagestore.ex b/shard/lib/app/pagestore.ex
index e09c513..ad18eac 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_pid(peer, {state.shard_id, state.path, {:get, key}})
+ SNet.Manager.send_pid(peer, {state.shard_id, state.path, {:get, key}})
end
_ ->
ask_random_peers(state, key)
@@ -128,9 +128,9 @@ defmodule SApp.PageStore do
{:get, key} ->
case :dets.lookup state.store, key do
[{_, _, bin}] ->
- Shard.Manager.send_pid(conn_pid, {state.shard_id, state.path, {:info, key, bin}})
+ SNet.Manager.send_pid(conn_pid, {state.shard_id, state.path, {:info, key, bin}})
_ ->
- Shard.Manager.send_pid(conn_pid, {state.shard_id, state.path, {:not_found, key}})
+ SNet.Manager.send_pid(conn_pid, {state.shard_id, state.path, {:not_found, key}})
end
state
{:info, hash, bin} ->
@@ -251,7 +251,7 @@ defmodule SApp.PageStore do
|> Enum.shuffle
|> Enum.take(3)
for peer <- peers do
- Shard.Manager.send(peer, {state.shard_id, state.path, {:get, key}})
+ SNet.Manager.send(peer, {state.shard_id, state.path, {:get, key}})
end
end