effection
Advanced tools
Comparing version 0.3.1 to 0.3.2-09d9bab
@@ -9,2 +9,11 @@ # Changelog | ||
## [0.3.2] - 2019-10-30 | ||
- (fix) in certain cases, execution forks were being marked as | ||
completed when they actually were not. | ||
https://github.com/thefrontside/effection.js/pull/21 | ||
- (fix) sometimes halted children were being kept around unecessarily, | ||
and while not running will cause memory leaks long-term | ||
https://github.com/thefrontside/effection.js/pull/22 | ||
## [0.3.1] - 2019-10-23 | ||
@@ -11,0 +20,0 @@ |
@@ -315,22 +315,28 @@ 'use strict'; | ||
if (child.isBlocking) { | ||
throw new Error(` | ||
Tried to call Fork#join() with a child that has not been | ||
finalized. This should never happen and so probably indicates a bug | ||
in effection. All of its users would be in your eternal debt were you | ||
to please take the time to report this issue here: | ||
https://github.com/thefrontside/effection.js/issues/new | ||
`); | ||
} | ||
this.children.delete(child); | ||
if (child.isCompleted) { | ||
if (this.isWaiting && !this.hasBlockingChildren) { | ||
this.finalize('completed'); | ||
} else if (this.isRunning) { | ||
this.children.delete(child); | ||
if (child.sync) { | ||
this.resume(child.result); | ||
} | ||
} else if (this.isRunning && child.sync) { | ||
this.resume(child.result); | ||
} | ||
} else if (child.isErrored) { | ||
this.throw(child.result); | ||
} else if (child.isHalted) { | ||
if (child.sync) { | ||
if (this.isWaiting && !this.hasBlockingChildren) { | ||
this.finalize('completed'); | ||
} else if (this.isRunning && child.sync) { | ||
this.throw(new Error(`Interupted: ${child.result}`)); | ||
} else { | ||
if (!this.hasBlockingChildren) { | ||
this.finalize('completed'); | ||
} | ||
} | ||
} else if (child.isErrored) { | ||
this.throw(child.result); | ||
} | ||
@@ -337,0 +343,0 @@ } |
@@ -152,22 +152,28 @@ import { noop } from "./noop.js"; | ||
if (child.isBlocking) { | ||
throw new Error(` | ||
Tried to call Fork#join() with a child that has not been | ||
finalized. This should never happen and so probably indicates a bug | ||
in effection. All of its users would be in your eternal debt were you | ||
to please take the time to report this issue here: | ||
https://github.com/thefrontside/effection.js/issues/new | ||
`); | ||
} | ||
this.children.delete(child); | ||
if (child.isCompleted) { | ||
if (this.isWaiting && !this.hasBlockingChildren) { | ||
this.finalize('completed'); | ||
} else if (this.isRunning) { | ||
this.children.delete(child); | ||
if (child.sync) { | ||
this.resume(child.result); | ||
} | ||
} else if (this.isRunning && child.sync) { | ||
this.resume(child.result); | ||
} | ||
} else if (child.isErrored) { | ||
this.throw(child.result); | ||
} else if (child.isHalted) { | ||
if (child.sync) { | ||
if (this.isWaiting && !this.hasBlockingChildren) { | ||
this.finalize('completed'); | ||
} else if (this.isRunning && child.sync) { | ||
this.throw(new Error(`Interupted: ${child.result}`)); | ||
} else { | ||
if (!this.hasBlockingChildren) { | ||
this.finalize('completed'); | ||
} | ||
} | ||
} else if (child.isErrored) { | ||
this.throw(child.result); | ||
} | ||
@@ -174,0 +180,0 @@ } |
@@ -274,22 +274,22 @@ /** | ||
if (child.isBlocking) { | ||
throw new Error("\nTried to call Fork#join() with a child that has not been\nfinalized. This should never happen and so probably indicates a bug\nin effection. All of its users would be in your eternal debt were you\nto please take the time to report this issue here:\nhttps://github.com/thefrontside/effection.js/issues/new\n"); | ||
} | ||
this.children.delete(child); | ||
if (child.isCompleted) { | ||
if (this.isWaiting && !this.hasBlockingChildren) { | ||
this.finalize('completed'); | ||
} else if (this.isRunning) { | ||
this.children.delete(child); | ||
if (child.sync) { | ||
this.resume(child.result); | ||
} | ||
} else if (this.isRunning && child.sync) { | ||
this.resume(child.result); | ||
} | ||
} else if (child.isErrored) { | ||
this.throw(child.result); | ||
} else if (child.isHalted) { | ||
if (child.sync) { | ||
if (this.isWaiting && !this.hasBlockingChildren) { | ||
this.finalize('completed'); | ||
} else if (this.isRunning && child.sync) { | ||
this.throw(new Error("Interupted: ".concat(child.result))); | ||
} else { | ||
if (!this.hasBlockingChildren) { | ||
this.finalize('completed'); | ||
} | ||
} | ||
} else if (child.isErrored) { | ||
this.throw(child.result); | ||
} | ||
@@ -296,0 +296,0 @@ } |
{ | ||
"name": "effection", | ||
"description": "Effortlessly composable structured concurrency primitive for JavaScript", | ||
"version": "0.3.1", | ||
"version": "0.3.2-09d9bab", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "files": [ |
38675
1006