Skip to content

Async safe API borrows#490

Merged
andreaphylum merged 11 commits intomainfrom
andrea/async-safe-borrows
Jun 21, 2022
Merged

Async safe API borrows#490
andreaphylum merged 11 commits intomainfrom
andrea/async-safe-borrows

Conversation

@andreaphylum
Copy link
Contributor

In this PR, Deno's OpState is borrowed immutably and access to the underlying OnceFuture is synchronized via a tokio::sync::Mutex.

This may introduce contention on first access and a very minor overhead on subsequent accesses, when retrieving a reference to the PhylumApi object. API calls themselves can be executed entirely concurrently.

Closes #444.

Checklist

  • Does this PR have an associated issue (i.e., closes #<issueNum> in description above)?
  • Have you ensured that you have met the expected acceptance criteria?
  • Have you created sufficient tests?
  • Have you updated all affected documentation?

@andreaphylum andreaphylum requested a review from a team as a code owner June 21, 2022 15:48
cd-work
cd-work previously approved these changes Jun 21, 2022
@andreaphylum andreaphylum mentioned this pull request Jun 21, 2022
4 tasks
@andreaphylum andreaphylum merged commit f5f00fa into main Jun 21, 2022
@andreaphylum andreaphylum deleted the andrea/async-safe-borrows branch June 21, 2022 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report errors on, or circumvent, multiple RefCell borrows in Deno ops

2 participants