Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hazae41/mutex

Package Overview
Dependencies
Maintainers
0
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hazae41/mutex - npm Package Compare versions

Comparing version 2.0.3 to 2.1.0

34

dist/types/mods/mutex/mutex.d.ts

@@ -29,22 +29,23 @@ import { Awaitable } from '../../libs/promises/promises.js';

get count(): number;
get(): T;
/**
* Lock or throw an error
* @param callback
* Get and lock or throw
* @returns
*/
lockOrThrow<R>(callback: (inner: T) => Awaitable<R>): Promise<R>;
getOrThrow(): Promise<Lock<T>>;
/**
* Lock or wait
* @param callback
* Get and lock or wait
* @returns
*/
lockOrWait<R>(callback: (inner: T) => Awaitable<R>): Promise<R>;
getOrWait(): Promise<Lock<T>>;
/**
* Just wait
* @returns
* Run and lock or throw
* @param callback
*/
wait(): Promise<void>;
runOrThrow<R>(callback: (inner: T) => Awaitable<R>): Promise<R>;
/**
* Lock and return a disposable object
* @returns
* Run and lock or wait
* @param callback
*/
acquire(): Promise<Lock<T>>;
runOrWait<R>(callback: (inner: T) => Awaitable<R>): Promise<R>;
}

@@ -60,8 +61,9 @@ /**

get locked(): boolean;
lockOrThrow<R>(callback: (inner: T) => Awaitable<R>): Promise<R>;
lockOrWait<R>(callback: (inner: T) => Awaitable<R>): Promise<R>;
wait(): Promise<void>;
acquire(): Promise<Lock<T>>;
get(): T;
getOrThrow(): Promise<Lock<T>>;
getOrWait(): Promise<Lock<T>>;
runOrThrow<R>(callback: (inner: T) => Awaitable<R>): Promise<R>;
runOrWait<R>(callback: (inner: T) => Awaitable<R>): Promise<R>;
}
export { Lock, LockedError, Mutex, Semaphore };
{
"type": "module",
"name": "@hazae41/mutex",
"version": "2.0.3",
"version": "2.1.0",
"description": "Rust-like Mutex for TypeScript",

@@ -6,0 +6,0 @@ "homepage": "https://github.com/hazae41/mutex",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc