further work on external async relay

This commit is contained in:
Joey Hess 2020-08-12 16:25:53 -04:00
parent 15706e6991
commit c9e8cafb98
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 44 additions and 50 deletions

View file

@ -615,9 +615,9 @@ startExternal external =
(st, extensions) <- startExternal' external
if asyncExtensionEnabled extensions
then do
v <- liftIO $ runRelayToExternalAsync external st
st' <- liftIO $ relayToExternalAsync v
store (ExternalAsync v)
relay <- liftIO $ runRelayToExternalAsync external st
st' <- liftIO $ asyncRelayExternalState relay
store (ExternalAsync relay)
return st'
else do
store NoExternalAsync
@ -627,7 +627,7 @@ startExternal external =
fst <$> startExternal' external
v@(ExternalAsync relay) -> do
store v
liftIO $ relayToExternalAsync relay
liftIO $ asyncRelayExternalState relay
where
store = liftIO . atomically . putTMVar (externalAsync external)