Skip to main content
Module

x/async/mod.ts>RwLock#rlock

🦕 Asynchronous primitive modules for Deno.
Latest
method RwLock.prototype.rlock
import { RwLock } from "https://deno.land/x/async@v2.1.0/mod.ts";

Acquires the lock for reading, and invokes the specified function with the current value of the lock. Other readers can acquire the lock simultaneously, but any writers will be blocked until the function completes.

Parameters

f: (value: T) => R | PromiseLike<R>
  • The function to invoke.

Returns

Promise<R>

A promise that resolves to the return value of the specified function.