{-# 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 ()