Add prompt resource cleanup functionality#3038
Merged
harendra-kumar merged 6 commits intomasterfrom Jun 24, 2025
Merged
Conversation
6aee151 to
d8358ea
Compare
adithyaov
reviewed
Jun 16, 2025
| -- actions that are automatically invoked on exception or after the effect | ||
| -- function is done. | ||
| {-# INLINE cleanupEffectIO #-} | ||
| cleanupEffectIO :: (MonadIO m, MonadCatch m) => |
Member
There was a problem hiding this comment.
Why store the cleanup in an IORef and invoke it later? Why not just run the action directly?
Member
Author
There was a problem hiding this comment.
The ref is passed to the action which stores the cleanup. We use the ref to cleanup anything registered by the action. Therefore, ref is a way to communicate between the action and the exception handler.
d8358ea to
b6fd22f
Compare
adithyaov
approved these changes
Jun 24, 2025
b6fd22f to
5adac65
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See also: #3039 for a small enhancement.