1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 04:51:57 +03:00

Add type synonyms for the logging & statting queues.

This commit is contained in:
Rob Rix 2018-04-03 18:17:36 -04:00
parent 5b5d5153a5
commit 7e5f448027

View File

@ -72,6 +72,9 @@ data TaskF output where
Distribute :: Traversable t => t (Task output) -> TaskF (t output)
Bidistribute :: Bitraversable t => t (Task output1) (Task output2) -> TaskF (t output1 output2)
type Logger = AsyncQueue Message Options
type Statter = AsyncQueue Stat StatsClient
-- | A high-level task producing some result, e.g. parsing, diffing, rendering. 'Task's can also specify explicit concurrency via 'distribute', 'distributeFor', and 'distributeFoldMap'
type Task = Eff '[TaskF, Exc SomeException, IO]
@ -174,8 +177,8 @@ runTaskWithOptions options task = do
either (die . displayException) pure result
where
run :: Options
-> AsyncQueue Message Options
-> AsyncQueue Stat StatsClient
-> Logger
-> Statter
-> Task a
-> IO (Either SomeException a)
run options logger statter = run'