Repository navigation
Add optional acquisition APIs to RcMap and LayerMap - #7411
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: e6b74b2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
tim-smart
requested changes
Aug 24, 2026
| <K, A, E>(self: RcMap<K, A, E>, key: K): Effect.Effect<Option.Option<A>, E, Scope.Scope> => | ||
| Effect.uninterruptibleMask((restore) => { | ||
| if (self.state._tag === "Closed") { | ||
| return Effect.interrupt |
Contributor
There was a problem hiding this comment.
I think for this case we return None, as no acquisition can happen with this api.
Contributor
Author
There was a problem hiding this comment.
updated. thanks for taking a look and catching this. i appreciate it.
Return Option.none from RcMap.getOption after closure and align its test and the RcMap and LayerMap documentation with non-acquiring semantics. Effect-TS#7411 (comment)
tim-smart
approved these changes
Aug 24, 2026
This was referenced Aug 28, 2026
Merged
This branch had an error being deployed
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.
Type
Feature
Description
Adds
RcMap.getOptionwith data-first and data-last overloads for atomically retaining an entry only when it is already cached. A missing key returnsOption.nonewithout invoking lookup or performing capacity acquisition. Existing ready or in-flight entries use the normal reference count and caller-scope finalizer, cached failures propagate unchanged, and closed maps interrupt.This avoids the race inherent in composing
hasandget, where the entry can disappear between operations andgetcan start a new lookup.Adds
LayerMap.contextEffectOptionas the direct optional counterpart tocontextEffecton bothLayerMapinstances and generatedLayerMap.Serviceclasses.Option.nonemeans the context is not currently cached on an open map, and missing entries do not build a layer.The change does not modify existing release, TTL, invalidation, or capacity behavior. It includes API lifecycle coverage for missing entries, ready retention and release, in-flight sharing, cached failures, TTL retention and expiry, invalidation linearization, closed-map interruption, and direct and Service
LayerMapaccessors. It also includes aneffectpatch changeset.Validation:
pnpm lint-fixRcMapandLayerMaptests passedRcMapandLayerMapdoctests passedpnpm checkgit diff --checkpnpm jsdocs --checkreports only pre-existing unrelated repository diagnostics; neither changed source module is reportedRelated
No related issue.