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

add failing async test #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add failing async test #1

wants to merge 1 commit into from

Conversation

dignifiedquire
Copy link
Member

I've been trying to use this module with async work, but if all emits are async this breaks down. Added a failing test to show the behaviour I mean.

This fails with

# through async
not ok 3 should be equivalent
  ---
    operator: deepEqual
    expected: [ 10, 20, 30 ]
    actual:   []
    at: pull (/Users/dignifiedquire/opensource/pull-through/index.js:46:22)
  ...

@dignifiedquire
Copy link
Member Author

I'm not sure how far this is related with the Don't keep a reference to this, but I'm not seeing another way except for keeping a reference inside the writer when doing async work.

@dominictarr
Copy link
Member

I mainly wrote this module to make porting a few other through node-stream modules easy.
one solution might be to make a pull-through2 which takes a callback?

can you describe the stream you are trying to implement?
you could prehaps also use asyncMap, and then flatten?

@dignifiedquire
Copy link
Member Author

one solution might be to make a pull-through2 which takes a callback?

Yes that might be a possible solution. Maybe for now we just add note to the readme that this case is not working and asyncMap can be an alternative in those cases?

you could prehaps also use asyncMap, and then flatten?

Yes this is exactly what I ended up doing, switching to use asyncMap, as in my case I actually had a 1-1 mapping between in and out data.

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

Successfully merging this pull request may close these issues.

2 participants