-
-
Notifications
You must be signed in to change notification settings - Fork 45
fix: explicitly start MessagePort
#116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+6
−1
Merged
Changes from 19 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
b4e022f
Add bun types
nazarhussain 91104ac
Add bun implementation for process worker
nazarhussain 6865643
Add isBun helper
nazarhussain c7d9340
Make sure worker port only have one listener
nazarhussain f73acba
Fix the worker thread pool
nazarhussain 8b18276
Disable useAtomics for bun runtime
nazarhussain ce1470a
Update the check for resource limits
nazarhussain e6f31ec
Add bun test workflow
nazarhussain 6c1fcbe
Update the vitest configuration
nazarhussain ab317e3
Revert changes for entry/worker.ts
nazarhussain 276adb2
Fix tsconfig to point to js file instead decleration
nazarhussain cde9941
Fix lint issues
nazarhussain 75c0dc1
Fix tests
nazarhussain a30652c
Remove custom bun process implementation
nazarhussain 0b318a3
Remove bun types
nazarhussain 20e1983
Revert changes to pnpm-lock
nazarhussain efc0479
Fix tsconfig to avoid error during bun run and typecheck
nazarhussain 2c75bab
Update tear down tets
nazarhussain bdc159c
Update teardown test
nazarhussain 223fb5a
Update code as per feedback
nazarhussain 1281278
Use conditional execution for channel.unref
nazarhussain 968d529
Merge branch 'main' into nh/bun-support
nazarhussain 08e8143
fix: remove Bun specific exceptions from Node compatible code
AriPerkkio c42460e
test: exclude more tests from Bun
AriPerkkio bea6455
test: exclude more tests from Bun
AriPerkkio b413db0
ci: remove bun workflow
AriPerkkio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Test (Bun) | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||
| bun-version: [latest] | ||
|
|
||
| runs-on: ${{matrix.os}} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Use Bun ${{ matrix.bun-version }} | ||
| uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: ${{ matrix.bun-version }} | ||
|
|
||
| - uses: pnpm/action-setup@v2 | ||
|
|
||
| - name: Install Dependencies | ||
| run: pnpm install | ||
|
|
||
| - name: Build | ||
| run: pnpm build | ||
|
|
||
| - name: Test | ||
| run: bun run --bun test run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| import { dirname, resolve } from 'node:path' | ||
| import { Tinypool } from 'tinypool' | ||
| import { fileURLToPath } from 'node:url' | ||
| import { isBun } from './utils' | ||
|
|
||
| const __dirname = dirname(fileURLToPath(import.meta.url)) | ||
| const cleanups: (() => Promise<unknown>)[] = [] | ||
|
|
@@ -57,7 +58,12 @@ test('writing to terminating worker does not crash', async () => { | |
| await destroyed | ||
| }) | ||
|
|
||
| test('recycling workers while closing pool does not crash', async () => { | ||
| test('recycling workers while closing pool does not crash', async ({ | ||
| skip, | ||
| }) => { | ||
| // TODO: Need to debug the weird issue for this test | ||
| if (isBun) return skip() | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a weird error in Bun runtime which I yet can't figured out. Do you have any idea what it would be? |
||
|
|
||
| const pool = new Tinypool({ | ||
| runtime: 'child_process', | ||
| filename: resolve(__dirname, 'fixtures/nested-pool.mjs'), | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const isBun = 'bun' in process.versions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.