-- |Data type indicating whether to kill a process after exiting its scope.
module Polysemy.Process.Data.ProcessKill where

import Polysemy.Time (NanoSeconds)

-- |Indicate whether to kill a process after exiting the scope in which it was used, if it hasn't terminated.
data ProcessKill =
  -- |Wait for the specified interval, then kill.
  KillAfter NanoSeconds
  |
  -- |Kill immediately.
  KillImmediately
  |
  -- |Wait indefinitely for the process to terminate.
  KillNever
  deriving stock (ProcessKill -> ProcessKill -> Bool
(ProcessKill -> ProcessKill -> Bool)
-> (ProcessKill -> ProcessKill -> Bool) -> Eq ProcessKill
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProcessKill -> ProcessKill -> Bool
$c/= :: ProcessKill -> ProcessKill -> Bool
== :: ProcessKill -> ProcessKill -> Bool
$c== :: ProcessKill -> ProcessKill -> Bool
Eq, Int -> ProcessKill -> ShowS
[ProcessKill] -> ShowS
ProcessKill -> String
(Int -> ProcessKill -> ShowS)
-> (ProcessKill -> String)
-> ([ProcessKill] -> ShowS)
-> Show ProcessKill
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProcessKill] -> ShowS
$cshowList :: [ProcessKill] -> ShowS
show :: ProcessKill -> String
$cshow :: ProcessKill -> String
showsPrec :: Int -> ProcessKill -> ShowS
$cshowsPrec :: Int -> ProcessKill -> ShowS
Show)