Skip to content
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

Make Deno.readDir actually streaming #4218

Open
ry opened this issue Mar 2, 2020 · 5 comments
Open

Make Deno.readDir actually streaming #4218

ry opened this issue Mar 2, 2020 · 5 comments
Labels
cli related to cli/ dir feat new feature (which has been agreed to/accepted)

Comments

@ry
Copy link
Member

ry commented Mar 2, 2020

probably with async iterator

@lucacasonato
Copy link
Member

This is implemented: https://doc.deno.land/builtin/stable#Deno.readDir

@lucacasonato
Copy link
Member

lucacasonato commented Aug 14, 2020

Actually while the public interface is async streaming, it is internally still non-streaming. Reopening

@lucacasonato lucacasonato reopened this Aug 14, 2020
@lucacasonato lucacasonato added the cli related to cli/ dir label Aug 14, 2020
@caspervonb
Copy link
Contributor

For context, in the implementation we are collecting the iterator into an array and dispatching it via JSON to the JS call site. Works but semantically not very sound.

@stale
Copy link

stale bot commented Jan 6, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 6, 2021
@lucacasonato lucacasonato added the feat new feature (which has been agreed to/accepted) label Jan 6, 2021
@stale stale bot removed the stale label Jan 6, 2021
@cjihrig
Copy link
Contributor

cjihrig commented Jun 24, 2022

For reference, here is how this is implemented in Node:

  • uv_fs_opendir() in libuv calls either opendir() or FindFirstFileW(), depending on the operating system. There are similar functions in those files for iterating over the directory and closing the iterator.
  • Node's bindings to these functions are in this file.
  • Those bindings are exposed in JS in this file.

@lucacasonato lucacasonato changed the title provide streaming opendir/readdir support Make Deno.readDir actually streaming Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli related to cli/ dir feat new feature (which has been agreed to/accepted)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants