aboutsummaryrefslogtreecommitdiff
path: root/shard
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2018-10-10 17:50:06 +0200
committerAlex Auvolat <alex@adnab.me>2018-10-10 17:50:06 +0200
commita2f678dc510e642479d61b81148a433edd7b76fe (patch)
tree0aced76cdd90ba14a83705fdf249124a7d3f5c49 /shard
parent062faf49cbd98fc7ef68f8387a18c5a0a131025e (diff)
downloadshard-a2f678dc510e642479d61b81148a433edd7b76fe.tar.gz
shard-a2f678dc510e642479d61b81148a433edd7b76fe.zip
Remove useless file
Diffstat (limited to 'shard')
-rw-r--r--shard/lib/net/chan.ex_67
1 files changed, 0 insertions, 67 deletions
diff --git a/shard/lib/net/chan.ex_ b/shard/lib/net/chan.ex_
deleted file mode 100644
index 5aba960..0000000
--- a/shard/lib/net/chan.ex_
+++ /dev/null
@@ -1,67 +0,0 @@
-defprotocol SNet.Chan do
- @moduledoc"""
- Abstract definition for a communication channel
- """
-
- @doc"""
- Function to send a message to relevant peers.
- """
- def send(chan, msg)
-
- @doc"""
- Function to declare a handler for a channel
- """
- def handle(chan, func)
-end
-
-defmodule SNet.PeerChan do
- @moduledoc"""
- Direct channel to a peer
- """
-
- defstruct [:peer_id, :shard_id, :path]
-
- def new(peer_id, shard_id, path) do
- %__MODULE__{peer_id: peer_id, shard_id: shard_id, path: path}
- end
-
- defimpl SNet.Chan do
- def send(chan, msg) do
- Shard.Manager.send(chan.peer_id, {chan.shard_id, chan.path, msg})
- end
-
- def handle(chan, func) do
- # DO NOT USE THIS
- raise :do_not_use_this
- # assert false
- end
- end
-end
-
-defmodule SNet.FloodChan do
- @moduledoc"""
- Channel that send a message to all know peers for shard (floods the network)
- """
-
- defstruct [:shard_id, :path]
-
- def new(shard_id, path) do
- %__MODULE__{shard_id: shard_id, path: path}
- end
-
- defimpl SNet.Chan do
- def send(chan, msg) do
- for x <- Shard.Manager.get_shard_peers(chan.shard_id) do
- Shard.Manager.send(x, {chan.shard_id, chan.path, msg})
- end
- end
-
- def handle(chan, func) do
- # TODO
- end
- end
-end
-
-defmodule SNet.CipherChan do
- # TODO
-end