Skip to content
Snippets Groups Projects
Commit 80b9c54e authored by Jens Nolte's avatar Jens Nolte
Browse files

Change the generic variant of withScopedResourceManager to be the default variant

parent c606b92c
No related branches found
No related tags found
No related merge requests found
......@@ -106,7 +106,7 @@ class IsRetrievable v o => IsObservable v o | o -> v where
observeBlocking :: (IsObservable v o, MonadResourceManager m) => o -> (ObservableMessage v -> m ()) -> m a
observeBlocking observable handler = do
-- `withScopedResourceManager` removes the `observe` callback when the `handler` fails.
genericWithScopedResourceManager do
withScopedResourceManager do
var <- liftIO newEmptyTMVarIO
observe observable \msg -> liftIO $ atomically do
void $ tryTakeTMVar var
......
......@@ -9,7 +9,6 @@ module Quasar.ResourceManager (
registerDisposable,
registerDisposeAction,
withScopedResourceManager,
genericWithScopedResourceManager,
onResourceManager,
captureDisposable,
captureDisposable_,
......@@ -156,12 +155,8 @@ registerNewResource action = mask_ $ lockResourceManager do
registerNewResource_ :: (IsDisposable a, MonadResourceManager m) => m a -> m ()
registerNewResource_ action = void $ registerNewResource action
withScopedResourceManager :: MonadResourceManager m => ResourceManagerIO a -> m a
withScopedResourceManager :: MonadResourceManager m => m a -> m a
withScopedResourceManager action =
bracket newResourceManager dispose \scope -> onResourceManager scope action
genericWithScopedResourceManager :: MonadResourceManager m => m a -> m a
genericWithScopedResourceManager action =
bracket newResourceManager dispose \scope -> localResourceManager scope action
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment