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

Construct flow #53

Open
Fishrock123 opened this issue Sep 23, 2019 · 1 comment
Open

Construct flow #53

Fishrock123 opened this issue Sep 23, 2019 · 1 comment

Comments

@Fishrock123
Copy link
Owner

Fishrock123 commented Sep 23, 2019

Some kind of construct flow would be very useful for a couple of significant reasons:

  • Presently resources must either be opened upon constructor call, or upon "first pull".
    • The former presents async timing issues
    • The latter is complicated and messy
  • It would be useful to pass buffer allocation hits out-of-flow (Buffer allocation hints #52)

Arguments for doing it all inline could be getting pretty long (and very variable), not even counting the first point:

pull(status_type, error, buffer, size, offset)

Maybe?

Idk, maybe separating this all out into multiple flows would be better, similar to Streams3 but just sans the dreaded EventEmitter.

  • (sink calls) -> (source calls)
  • construct(...) -> ready(...)
  • pull(...) -> give(...)
  • destroy(error) -> destroy(error)

Very related to nodejs/node#29314

@ronag
Copy link

ronag commented Oct 6, 2019

I'll chime in a link to related PR in Node nodejs/node#29656.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants