Skip to content

Make disk- blob transferable #47666

Description

@jimmywarting

What is the problem this feature will solve?

I notice that Blob's transfered over workers aren't readable at all.

  • it only applies to blobs coming from fs.openAsBlob
  • in-memory constructed blobs works fine.

Right now they throw an error when trying to send them over.

mini repro:

import { Worker } from 'worker_threads'
const worker = new Worker('./worker.js')
worker.once('message', blob => {
  // Should be fine to do this as well
  blob.text()
})
// worker.js
import { parentPort } from 'node:worker_threads'
import { openAsBlob } from 'node:fs'

const blob = await openAsBlob(new URL(import.meta.url))
parentPort.postMessage(blob)

If a blob originates from a worker thread and is being sent to the main thread over postMessage, then it should still work OK to read the blob even if the worker is terminated.

originally posted by @jimmywarting in #45258 (comment)

What is the feature you are proposing to solve the problem?

Spec issue

What alternatives have you considered?

No response

Activity

  1. aduh95 commented on Apr 22, 2023

    @aduh95
  2. jimmywarting commented on Apr 22, 2023

    @jimmywarting
    Author
  3. github-actions commented on Jan 31, 2024

    @github-actions
    Contributor

    There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

    For more information on how the project manages feature requests, please consult the feature request management document.

  4. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Jan 31, 2024
  5. jimmywarting commented on Jan 31, 2024

    @jimmywarting
    Author

    still an issue...

  6. removed
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Feb 1, 2024
  7. github-actions commented on Jul 30, 2024

    @github-actions
    Contributor

    There has been no activity on this feature request for 5 months. To help maintain relevant open issues, please add the never-stale Issues and PRs exempt from automated stale handling. label or close this issue if it should be closed. If not, the issue will be automatically closed 6 months after the last non-automated comment.
    For more information on how the project manages feature requests, please consult the feature request management document.

  8. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Jul 30, 2024
  9. github-actions commented on Aug 29, 2024

    @github-actions
    Contributor

    There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.

    For more information on how the project manages feature requests, please consult the feature request management document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions