lightning-pool
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -192,3 +192,3 @@ /* lightning-pool | ||
const rinf = this._allResources.get(resource); | ||
if (rinf && rinf.isAcquired) | ||
if (rinf && !rinf.isIdle) | ||
rinf.setIdle(callback); | ||
@@ -195,0 +195,0 @@ } catch (e) { |
@@ -31,14 +31,13 @@ /* lightning-pool | ||
get isAcquired() { | ||
return this.state === ResourceState.ACQUIRED || this.state === | ||
ResourceState.VALIDATION; | ||
get isIdle() { | ||
return this.state === ResourceState.IDLE; | ||
} | ||
setAcquired() { | ||
if (this.isAcquired) | ||
return; | ||
this._detach(); | ||
this.state = ResourceState.ACQUIRED; | ||
this.pool._acquiredResources.push(this); | ||
this._acquiredNode = this.pool._acquiredResources.tail; | ||
if (this.state !== ResourceState.ACQUIRED) { | ||
this._detach(); | ||
this.state = ResourceState.ACQUIRED; | ||
this.pool._acquiredResources.push(this); | ||
this._acquiredNode = this.pool._acquiredResources.tail; | ||
} | ||
} | ||
@@ -45,0 +44,0 @@ |
{ | ||
"name": "lightning-pool", | ||
"description": "Fastest object pool implementation for JavaScript", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"author": "Panates Ltd.", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34887
753