diff options
Diffstat (limited to 'Announcer.hs')
-rw-r--r-- | Announcer.hs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Announcer.hs b/Announcer.hs new file mode 100644 index 00000000..2d2c2197 --- /dev/null +++ b/Announcer.hs | |||
@@ -0,0 +1,23 @@ | |||
1 | {-# LANGUAGE ExistentialQuantification #-} | ||
2 | module Announcer where | ||
3 | |||
4 | import Network.Kademlia.Search | ||
5 | |||
6 | data Announcer = Announcer | ||
7 | |||
8 | forkAnnouncer :: IO Announcer | ||
9 | forkAnnouncer = return Announcer | ||
10 | |||
11 | stopAnnouncer :: Announcer -> IO () | ||
12 | stopAnnouncer _ = return () | ||
13 | |||
14 | data AnnounceMethod ni r info = forall nid addr tok. AnnounceMethod | ||
15 | { aSearch :: Search nid addr tok ni r | ||
16 | , aPublish :: info -> Maybe ni -> IO (Maybe r) | ||
17 | } | ||
18 | |||
19 | schedule :: Announcer -> AnnounceMethod ni r info -> info -> IO () | ||
20 | schedule _ _ _ = return () | ||
21 | |||
22 | cancel :: Announcer -> AnnounceMethod ni r info -> info -> IO () | ||
23 | cancel _ _ _ = return () | ||