mirror of https://github.com/voidlizard/hbs2
29 lines
573 B
Haskell
29 lines
573 B
Haskell
module RPC2.Die where
|
|
|
|
import HBS2.Prelude.Plated
|
|
import HBS2.Clock
|
|
import HBS2.Net.Proto.Service
|
|
|
|
import HBS2.System.Logger.Simple
|
|
import Data.Config.Suckless.KeyValue
|
|
|
|
import HBS2.Peer.RPC.Internal.Types
|
|
import RPC2.Peer.API
|
|
|
|
import System.Exit qualified as Exit
|
|
import Control.Concurrent.Async
|
|
|
|
|
|
instance (MonadIO m) => HandleMethod m RpcDie where
|
|
type instance Input RpcDie = ()
|
|
type instance Output RpcDie = ()
|
|
|
|
handleMethod _ = do
|
|
debug $ "rpc2.die: exiting"
|
|
void $ liftIO $ do
|
|
w <- async $ pause @'Seconds 0.5 >> Exit.exitSuccess
|
|
link w
|
|
|
|
|
|
|