Add a warning about concurrent runHaxl calls

Reviewed By: malmerey

Differential Revision: D13067528

fbshipit-source-id: 08ba93fda2f6518eaedea0956d198a59255b16d9
This commit is contained in:
Simon Marlow 2018-11-15 01:38:59 -08:00 committed by Facebook Github Bot
parent 24494b5e31
commit 4638736ac6

View File

@ -36,6 +36,14 @@ import Haxl.Core.Stats
-- runHaxl
-- | Runs a 'Haxl' computation in the given 'Env'.
--
-- Note: to make multiple concurrent calls to 'runHaxl', each one must
-- have a separate 'Env'. A single 'Env' must /not/ be shared between
-- multiple concurrent calls to 'runHaxl', otherwise deadlocks or worse
-- will likely ensue.
--
-- However, multiple 'Env's may share a single 'StateStore', and thereby
-- use the same set of datasources.
runHaxl :: forall u a. Env u -> GenHaxl u a -> IO a
runHaxl env@Env{..} haxl = do