Skip to content

Commit fc1a41a

Browse files
committed
Created a first set of concurrency steps
1 parent 95adc49 commit fc1a41a

6 files changed

Lines changed: 406 additions & 63 deletions

File tree

jest.config.js

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -138,40 +138,7 @@ module.exports = {
138138

139139
// The test environment that will be used for testing
140140
testEnvironment: "node",
141-
142-
// Options that will be passed to the testEnvironment
143-
// testEnvironmentOptions: {},
144-
145-
// Adds a location field to test results
146-
// testLocationInResults: false,
147-
148-
// The glob patterns Jest uses to detect test files
149-
// testMatch: [
150-
// "**/__tests__/**/*.[jt]s?(x)",
151-
// "**/?(*.)+(spec|test).[tj]s?(x)"
152-
// ],
153-
154-
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
155-
// testPathIgnorePatterns: [
156-
// "/node_modules/"
157-
// ],
158-
159-
// The regexp pattern or array of patterns that Jest uses to detect test files
160-
// testRegex: [],
161-
162-
// This option allows the use of a custom results processor
163-
// testResultsProcessor: undefined,
164-
165-
// This option allows use of a custom test runner
166-
// testRunner: "jasmine2",
167-
168-
// This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
169-
// testURL: "http://localhost",
170-
171-
// Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
172-
// timers: "real",
173-
174-
// A map from regular expressions to paths to transformers
141+
testPathIgnorePatterns: ["/node_modules/", "/dist/", "shareableMapMixedWorker.js"],
175142
transform: {
176143
"^.+\\.tsx?$": "ts-jest"
177144
},

package-lock.json

Lines changed: 155 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"ts-jest": "^29.3.2",
3535
"typescript": "^5.8.3",
3636
"vite": "^6.3.5",
37-
"vite-plugin-dts": "^4.5.3"
37+
"vite-plugin-dts": "^4.5.3",
38+
"ts-node": "^10.9.2"
3839
}
3940
}

src/map/ShareableMap.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { fast1a32 } from "fnv-plus";
2-
import Serializable from "./../encoding/Serializable";
3-
import StringEncoder from "./../encoding/StringEncoder";
4-
import NumberEncoder from "./../encoding/NumberEncoder";
5-
import GeneralPurposeEncoder from "./../encoding/GeneralPurposeEncoder";
6-
import ShareableMapOptions from "./ShareableMapOptions";
7-
import {TransferableState} from "../TransferableState";
8-
import TransferableDataStructure from "../TransferableDataStructure";
2+
import Serializable from "./../encoding/Serializable.ts";
3+
import StringEncoder from "./../encoding/StringEncoder.ts";
4+
import NumberEncoder from "./../encoding/NumberEncoder.ts";
5+
import GeneralPurposeEncoder from "./../encoding/GeneralPurposeEncoder.ts";
6+
import ShareableMapOptions from "./ShareableMapOptions.ts";
7+
import {TransferableState} from "../TransferableState.ts";
8+
import TransferableDataStructure from "../TransferableDataStructure.ts";
99

1010
export class ShareableMap<K, V> extends TransferableDataStructure {
1111
// The default load factor to which this map should adhere
@@ -123,6 +123,8 @@ export class ShareableMap<K, V> extends TransferableDataStructure {
123123

124124
const map = new ShareableMap<K, V>({...defaultOptions, ...options});
125125
map.setBuffers(indexBuffer, dataBuffer);
126+
// Reinitialize lock state on revived map (constructor's initializeLockState did not run for replaced buffers)
127+
(map as any).initializeLockState?.();
126128
return map;
127129
}
128130

0 commit comments

Comments
 (0)