-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
777bc65
commit 2a7399f
Showing
5 changed files
with
47 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module Control.Reaper.Internal (Reaper (..)) where | ||
|
||
-- | A data structure to hold reaper APIs. | ||
data Reaper workload item = Reaper | ||
{ reaperAdd :: item -> IO () | ||
-- ^ Adding an item to the workload | ||
, reaperRead :: IO workload | ||
-- ^ Reading workload. | ||
, reaperModify :: (workload -> workload) -> IO workload | ||
-- ^ Modify the workload. The resulting workload is returned. | ||
-- | ||
-- If there is no reaper thread, the modifier will not be applied and | ||
-- 'reaperEmpty' will be returned. | ||
-- | ||
-- If the reaper is currently executing jobs, those jobs will not be in | ||
-- the given workload and the workload might appear empty. | ||
-- | ||
-- If all jobs are removed by the modifier, the reaper thread will not be | ||
-- killed. The reaper thread will only terminate if 'reaperKill' is called | ||
-- or the result of 'reaperAction' satisfies 'reaperNull'. | ||
-- | ||
-- @since 0.2.0 | ||
, reaperStop :: IO workload | ||
-- ^ Stopping the reaper thread if exists. | ||
-- The current workload is returned. | ||
, reaperKill :: IO () | ||
-- ^ Killing the reaper thread immediately if exists. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters