
Security News
/Company News
Securing the Financial Frontier: How Capital One Uses Socket for Open Source Security
Capital One is partnering with Socket to proactively secure its open source supply chain.
@prisma/compute
Advanced tools
@prisma/compute provides runtime utilities for applications deployed to Prisma
Compute.
Applications deployed to Prisma Compute can sleep after short periods of inactivity. When an application sleeps, Prisma Compute snapshots its memory and resumes from that snapshot when the next request arrives.
This works well for request-driven code, but background work outside the request lifecycle can be interrupted when the application sleeps. Examples include setTimeout, setInterval, and background Promise work.
@prisma/compute provides two utilities that signal to Prisma Compute that work is still active and the application should stay awake.
waitUntil keeps the application awake until a Promise settles. It returns void, so callers should keep using the original promise for result and error handling. Pass an AbortSignal, usually from AbortSignal.timeout(ms), as a safety bound if the promise does not settle. The signal only releases the keep-awake guard; it does not cancel the promise. Use a timeout longer than the expected promise duration so the signal acts as a cost safety net. waitUntil can be called multiple times during a single request.
import { waitUntil } from "@prisma/compute";
waitUntil(doCriticalWork(), { signal: AbortSignal.timeout(30_000) });
KeepAwakeGuard is a disposable object that keeps the application awake until the guard is released. Use it for a scoped function or block of background work. KeepAwakeGuard can be created multiple times during a single request and is safe to nest. Pass an AbortSignal, usually from AbortSignal.timeout(ms), as a safety bound if release is not reached. The signal releases the guard only; it does not cancel the guarded work.
Read more about disposables and the using keyword in the MDN resource management guide.
import { KeepAwakeGuard } from "@prisma/compute";
async function runsInBackground() {
// guard is acquired here
using guard = new KeepAwakeGuard({ signal: AbortSignal.timeout(30_000) });
await doCriticalWork();
} // guard is released here
If using is not available, call .release() manually. Always release the guard in a finally block so it is released even if the guarded code throws.
import { KeepAwakeGuard } from "@prisma/compute";
async function runsInBackground() {
const guard = new KeepAwakeGuard({ signal: AbortSignal.timeout(30_000) });
try {
await doCriticalWork();
} finally {
guard.release();
}
}
FAQs
Utilities for applications running on the Prisma compute runtime.
The npm package @prisma/compute receives a total of 3,161 weekly downloads. As such, @prisma/compute popularity was classified as popular.
We found that @prisma/compute demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.

Security News
/Company News
Capital One is partnering with Socket to proactively secure its open source supply chain.

Security News
Socket CTO Ahmad Nassri discusses how to keep AI agents from bypassing package blocks, limit credential access, and monitor their actions.

Security News
GPT-6 Astra tried to plant malicious code in simulated open source projects using fake GitHub accounts and deceptive PRs during an assigned CTF challenge.