summaryrefslogtreecommitdiff
path: root/Announcer.hs
blob: bc52ee38c31cb59a271ab1b1fe7b904a28059780 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{-# LANGUAGE ExistentialQuantification #-}
module Announcer where

import Network.Kademlia.Search

data Announcer = Announcer

forkAnnouncer :: IO Announcer
forkAnnouncer = return Announcer

stopAnnouncer :: Announcer -> IO ()
stopAnnouncer _ = return ()

data AnnounceMethod ni r = forall nid addr r tok a. AnnounceMethod
    { aSearch  :: Search nid addr tok ni r
    , aPublish :: r -> tok -> Maybe ni -> IO (Maybe a)
    }

schedule :: Announcer -> AnnounceMethod ni r -> r -> IO ()
schedule _ _ _ = return ()

cancel :: Announcer -> AnnounceMethod ni r -> r -> IO ()
cancel _ _ _ = return ()