Skip to content

Commit

Permalink
chore(master): release 0.4.21 (#60)
Browse files Browse the repository at this point in the history
* chore(master): release 0.4.21

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
jerome-benoit and autofix-ci[bot] authored Aug 25, 2024
1 parent e49f64a commit 595b8ed
Show file tree
Hide file tree
Showing 28 changed files with 99 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .github/release-please/manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.4.20"
".": "0.4.21"
}
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,31 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.4.21](https://github.com/poolifier/poolifier-web-worker/compare/v0.4.20...v0.4.21) (2024-08-24)

### 🐞 Bug Fixes

- fix pool ready status with zero min size dynamic pool
([cebb8d8](https://github.com/poolifier/poolifier-web-worker/commit/cebb8d85701be4376b92ea97f71e6cabd39f9592))

### 🧪 Tests

- add pool empty event test
([e353778](https://github.com/poolifier/poolifier-web-worker/commit/e353778b3657122d216ea08bd5f9528d9bbcd6f4))
- optimize pool empty event test
([e49f64a](https://github.com/poolifier/poolifier-web-worker/commit/e49f64a279e58c4e74f083b572b2555b2111d05c))

### 📚 Documentation

- refine a code comment
([1dc8bf2](https://github.com/poolifier/poolifier-web-worker/commit/1dc8bf2a39f9876a96b43730d6722e64fc5b5613))

### 🤖 Automation

- **deps:** Bump sonarsource/sonarcloud-github-action
([#59](https://github.com/poolifier/poolifier-web-worker/issues/59))
([d35a85f](https://github.com/poolifier/poolifier-web-worker/commit/d35a85fb3108222f358aa516d24124f15a3430b9))

## [0.4.20](https://github.com/poolifier/poolifier-web-worker/compare/v0.4.19...v0.4.20) (2024-08-19)

### 🐞 Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ for more details**:
<!-- deno-fmt-ignore -->

```js
<script type="module">import { ThreadWorker } from 'https://cdn.jsdelivr.net/npm/[email protected].20/browser/mod.js'</script>
<script type="module">import { ThreadWorker } from 'https://cdn.jsdelivr.net/npm/[email protected].21/browser/mod.js'</script>
```

```js
Expand All @@ -158,7 +158,7 @@ import {
DynamicThreadPool,
FixedThreadPool,
PoolEvents,
} from 'https://cdn.jsdelivr.net/npm/[email protected].20/browser/mod.js'
} from 'https://cdn.jsdelivr.net/npm/[email protected].21/browser/mod.js'
</script>
```

Expand Down
24 changes: 19 additions & 5 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"name": "@poolifier/poolifier-web-worker",
"version": "0.4.20",
"version": "0.4.21",
"exports": "./src/mod.ts",
"compilerOptions": {
"lib": ["deno.worker"],
"lib": [
"deno.worker"
],
"strict": true
},
"tasks": {
Expand All @@ -24,7 +26,9 @@
"documentation": "deno doc ./src/mod.ts"
},
"test": {
"include": ["./tests/**/*.test.mjs"]
"include": [
"./tests/**/*.test.mjs"
]
},
"fmt": {
"semiColons": false,
Expand All @@ -38,8 +42,18 @@
"expect": "npm:expect@^29.7.0"
},
"publish": {
"include": ["LICENSE", "README.md", "deno.json", "src/**/*.ts"]
"include": [
"LICENSE",
"README.md",
"deno.json",
"src/**/*.ts"
]
},
"lock": false,
"exclude": ["./coverage", "./dist/browser", "./dist/esm", "./npm"]
"exclude": [
"./coverage",
"./dist/browser",
"./dist/esm",
"./npm"
]
}
2 changes: 1 addition & 1 deletion dist/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "poolifier-web-worker",
"version": "0.4.20",
"version": "0.4.21",
"description": "poolifier-web-worker",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion examples/deno/javascript/dynamicExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
availableParallelism,
DynamicThreadPool,
PoolEvents,
} from 'jsr:@poolifier/poolifier-web-worker@^0.4.20' // x-release-please-version
} from 'jsr:@poolifier/poolifier-web-worker@^0.4.21' // x-release-please-version

const pool = new DynamicThreadPool(
Math.floor(availableParallelism() / 2),
Expand Down
2 changes: 1 addition & 1 deletion examples/deno/javascript/fixedExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
availableParallelism,
FixedThreadPool,
PoolEvents,
} from 'jsr:@poolifier/poolifier-web-worker@^0.4.20' // x-release-please-version
} from 'jsr:@poolifier/poolifier-web-worker@^0.4.21' // x-release-please-version

const pool = new FixedThreadPool(
availableParallelism(),
Expand Down
2 changes: 1 addition & 1 deletion examples/deno/javascript/multiFunctionExample.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
availableParallelism,
FixedThreadPool,
} from 'jsr:@poolifier/poolifier-web-worker@^0.4.20' // x-release-please-version
} from 'jsr:@poolifier/poolifier-web-worker@^0.4.21' // x-release-please-version

const pool = new FixedThreadPool(
availableParallelism(),
Expand Down
2 changes: 1 addition & 1 deletion examples/deno/javascript/multiFunctionWorker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ThreadWorker } from 'jsr:@poolifier/poolifier-web-worker@^0.4.20' // x-release-please-version
import { ThreadWorker } from 'jsr:@poolifier/poolifier-web-worker@^0.4.21' // x-release-please-version

function fn0(data) {
console.info('Executing fn0')
Expand Down
2 changes: 1 addition & 1 deletion examples/deno/javascript/yourWorker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ThreadWorker } from 'jsr:@poolifier/poolifier-web-worker@^0.4.20' // x-release-please-version
import { ThreadWorker } from 'jsr:@poolifier/poolifier-web-worker@^0.4.21' // x-release-please-version

function yourFunction() {
for (let i = 0; i <= 1000; i++) {
Expand Down
2 changes: 1 addition & 1 deletion examples/deno/typescript/pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
availableParallelism,
DynamicThreadPool,
FixedThreadPool,
} from 'jsr:@poolifier/poolifier-web-worker@^0.4.20' // x-release-please-version
} from 'jsr:@poolifier/poolifier-web-worker@^0.4.21' // x-release-please-version
import type { MyData, MyResponse } from './worker.ts'

const workerFileURL = new URL('./worker.ts', import.meta.url)
Expand Down
2 changes: 1 addition & 1 deletion examples/deno/typescript/worker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ThreadWorker } from 'jsr:@poolifier/poolifier-web-worker@^0.4.20' // x-release-please-version
import { ThreadWorker } from 'jsr:@poolifier/poolifier-web-worker@^0.4.21' // x-release-please-version

export interface MyData {
ok: 0 | 1
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sonar.organization=poolifier
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.projectName=poolifier-web-worker
# x-release-please-start-version
sonar.projectVersion=0.4.20
sonar.projectVersion=0.4.21
# x-release-please-end
sonar.host.url=https://sonarcloud.io
sonar.sources=src
Expand Down
4 changes: 2 additions & 2 deletions src/circular-buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class CircularBuffer {
this.items[this.writeIdx] = number
this.writeIdx = this.writeIdx === this.maxArrayIdx ? 0 : this.writeIdx + 1
if (this.size < this.items.length) {
;++this.size
++this.size
}
}

Expand All @@ -71,7 +71,7 @@ export class CircularBuffer {
}
this.items[this.readIdx] = -1
this.readIdx = this.readIdx === this.maxArrayIdx ? 0 : this.readIdx + 1
;--this.size
--this.size
return number
}

Expand Down
14 changes: 7 additions & 7 deletions src/pools/abstract-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ export abstract class AbstractPool<
): void {
if (this.workerNodes[workerNodeKey]?.usage != null) {
const workerUsage = this.workerNodes[workerNodeKey].usage
;++workerUsage.tasks.executing
++workerUsage.tasks.executing
updateWaitTimeWorkerUsage(
this.workerChoiceStrategiesContext,
workerUsage,
Expand All @@ -1319,7 +1319,7 @@ export abstract class AbstractPool<
const taskFunctionWorkerUsage = this.workerNodes[
workerNodeKey
].getTaskFunctionWorkerUsage(task.name!)!
;++taskFunctionWorkerUsage.tasks.executing
++taskFunctionWorkerUsage.tasks.executing
updateWaitTimeWorkerUsage(
this.workerChoiceStrategiesContext,
taskFunctionWorkerUsage,
Expand Down Expand Up @@ -1753,13 +1753,13 @@ export abstract class AbstractPool<
): void {
const workerNode = this.workerNodes[workerNodeKey]
if (workerNode?.usage != null) {
;++workerNode.usage.tasks.stolen
++workerNode.usage.tasks.stolen
}
if (
this.shallUpdateTaskFunctionWorkerUsage(workerNodeKey) &&
workerNode.getTaskFunctionWorkerUsage(taskName) != null
) {
;++workerNode.getTaskFunctionWorkerUsage(taskName)!.tasks.stolen
++workerNode.getTaskFunctionWorkerUsage(taskName)!.tasks.stolen
}
}

Expand All @@ -1770,7 +1770,7 @@ export abstract class AbstractPool<
): void {
const workerNode = this.workerNodes[workerNodeKey]
if (workerNode?.usage != null && taskName != null) {
;++workerNode.usage.tasks.sequentiallyStolen
++workerNode.usage.tasks.sequentiallyStolen
}
if (
taskName != null &&
Expand All @@ -1786,7 +1786,7 @@ export abstract class AbstractPool<
previousTaskName === taskName &&
taskFunctionWorkerUsage.tasks.sequentiallyStolen > 0)
) {
;++taskFunctionWorkerUsage.tasks.sequentiallyStolen
++taskFunctionWorkerUsage.tasks.sequentiallyStolen
} else if (taskFunctionWorkerUsage.tasks.sequentiallyStolen > 0) {
taskFunctionWorkerUsage.tasks.sequentiallyStolen = 0
}
Expand Down Expand Up @@ -2215,7 +2215,7 @@ export abstract class AbstractPool<
workerNodeKey,
this.dequeueTask(workerNodeKey) as Task<Data>,
)
;++flushedTasks
++flushedTasks
}
this.workerNodes[workerNodeKey].clearTasksQueue()
return flushedTasks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ export class WorkerChoiceStrategiesContext<
do {
workerNodeKey = workerChoiceStrategy.choose()
if (workerNodeKey == null && chooseCount > 0) {
;++retriesCount
;++this.retriesCount
++retriesCount
++this.retriesCount
}
;++chooseCount
++chooseCount
} while (workerNodeKey == null && retriesCount < this.retries)
if (workerNodeKey == null) {
throw new Error(
Expand Down
8 changes: 4 additions & 4 deletions src/pools/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,12 @@ export const updateTaskStatisticsWorkerUsage = <Response = unknown>(
workerTaskStatistics.executing != null &&
workerTaskStatistics.executing > 0
) {
;--workerTaskStatistics.executing
--workerTaskStatistics.executing
}
if (message.workerError == null) {
;++workerTaskStatistics.executed
++workerTaskStatistics.executed
} else {
;++workerTaskStatistics.failed
++workerTaskStatistics.failed
}
}

Expand Down Expand Up @@ -458,7 +458,7 @@ export const waitWorkerNodeEvents = async <
case 'idle':
case 'exit':
workerNode.addEventListener(workerNodeEvent, () => {
;++events
++events
if (events === numberOfEventsToWait) {
resolve(events)
}
Expand Down
2 changes: 1 addition & 1 deletion src/pools/version.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// x-release-please-start-version
export const version = '0.4.20'
export const version = '0.4.21'
// x-release-please-end
2 changes: 1 addition & 1 deletion src/pools/worker-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export class WorkerNode<Worker extends IWorker, Data = unknown>
name === this.info.taskFunctionsProperties![1].name) ||
(task.name !== DEFAULT_TASK_NAME && name === task.name)
) {
;++taskFunctionQueueSize
++taskFunctionQueueSize
}
}
return taskFunctionQueueSize
Expand Down
8 changes: 4 additions & 4 deletions src/queues/abstract-fixed-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ export abstract class AbstractFixedQueue<T> implements IFixedQueue<T> {
return undefined
}
const index = this.start
;--this.size
;++this.start
--this.size
++this.start
if (this.start === this.capacity) {
this.start = 0
}
Expand All @@ -90,8 +90,8 @@ export abstract class AbstractFixedQueue<T> implements IFixedQueue<T> {
}
}
const value = this.nodeArray[index].data
;++index
;++i
++index
++i
if (index === this.capacity) {
index = 0
}
Expand Down
2 changes: 1 addition & 1 deletion src/queues/fixed-priority-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class FixedPriorityQueue<T> extends AbstractFixedQueue<T>
inserted = true
break
}
;++index
++index
if (index === this.capacity) {
index = 0
}
Expand Down
6 changes: 3 additions & 3 deletions src/queues/priority-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class PriorityQueue<T> {
if (node.next == null) {
head = currentNode
}
;++buckets
++buckets
node = node.next
}
this.head = head!
Expand Down Expand Up @@ -148,7 +148,7 @@ export class PriorityQueue<T> {
if (currentBucket === bucket) {
break
}
;++currentBucket
++currentBucket
tail = tail.next
}
tailChanged = tail !== this.tail
Expand Down Expand Up @@ -203,7 +203,7 @@ export class PriorityQueue<T> {
done: true,
}
}
;++index
++index
if (index === node.capacity && node.next != null) {
node = node.next
index = 0
Expand Down
Loading

0 comments on commit 595b8ed

Please sign in to comment.