mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
Extract parBitraversable to the top level.
This commit is contained in:
parent
a3489be5f7
commit
6406620025
@ -196,9 +196,6 @@ runTaskWithOptions options task = do
|
||||
Distribute tasks -> liftIO (Async.mapConcurrently run tasks) >>= either throwError pure . sequenceA . withStrategy (parTraversable (parTraversable rseq))
|
||||
Bidistribute tasks -> liftIO (Async.runConcurrently (bitraverse (Async.Concurrently . run) (Async.Concurrently . run) tasks)) >>= either throwError pure . bisequenceA . withStrategy (parBitraversable (parTraversable rseq) (parTraversable rseq)))
|
||||
|
||||
parBitraversable :: Bitraversable t => Strategy a -> Strategy b -> Strategy (t a b)
|
||||
parBitraversable strat1 strat2 = bitraverse (rparWith strat1) (rparWith strat2)
|
||||
|
||||
logError :: Member Telemetry effs => Options -> Level -> Blob -> Error.Error String -> [(String, String)] -> Eff effs ()
|
||||
logError Options{..} level blob err = writeLog level (Error.formatError optionsPrintSource (optionsIsTerminal && optionsEnableColour) blob err)
|
||||
|
||||
@ -241,6 +238,10 @@ runParser blob@Blob{..} parser = case parser of
|
||||
_ -> fold syntax
|
||||
|
||||
|
||||
parBitraversable :: Bitraversable t => Strategy a -> Strategy b -> Strategy (t a b)
|
||||
parBitraversable strat1 strat2 = bitraverse (rparWith strat1) (rparWith strat2)
|
||||
|
||||
|
||||
runTaskF :: Members '[Reader Options, Telemetry, Reader LogQueue, Reader StatQueue, Exc SomeException, IO] effs => Eff (TaskF ': effs) a -> Eff effs a
|
||||
runTaskF = interpret (\ task -> case task of
|
||||
ReadBlobs (Left handle) -> rethrowing (IO.readBlobsFromHandle handle)
|
||||
|
Loading…
Reference in New Issue
Block a user