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

Otherwise doesn't forward 'end' event #142

Open
brian-gates opened this issue Nov 1, 2014 · 2 comments
Open

Otherwise doesn't forward 'end' event #142

brian-gates opened this issue Nov 1, 2014 · 2 comments
Labels

Comments

@brian-gates
Copy link

In the below snippet, I expect both the generator and otherwise 'end' events to fire, but only the generator's ever does.

var generator = $(function (push, next) {
  push(null, $.nil);
});

generator.on('end', function () {
  console.log('generator end');
})

var otherwise = $([]).otherwise(generator).on('end', function() {
  console.log('otherwise end')
});
generator.resume();
otherwise.resume();
@apaleslimghost
Copy link
Collaborator

Sounds a bit like #104.

@vqvu
Copy link
Collaborator

vqvu commented Nov 29, 2014

One note, this is a bug, but not in the way that you have specified.

The proper test case shouldn't have generator.resume() in it, since calling resume on a stream with no consumers will completely drain it, which leaves nothing to redirect to in otherwise.

vqvu added a commit to vqvu/highland that referenced this issue Nov 29, 2014
This involves:
  - Totally reimplementing stream redirection.
  - Reimplementing `consume`, `pull`, `fork`, and `resume`.

Backward incompatible;
  - The stream no longer pauses if `next` isn't synchronously called
    in
    `consume`, since this is no longer necessary to signal (lack of)
    demand to the source.
  - Lots of methods and properties that start with `_` changed
    (these
    were private anyway).
  - The callback for the stream generator and `consume` is
    guaranteed
    not to be called a second time until `next` is called.

Fixes:
  - caolan#41
  - caolan#141
  - caolan#142
  - caolan#173
vqvu added a commit to vqvu/highland that referenced this issue Nov 29, 2014
This involves:
  - Totally reimplementing stream redirection.
  - Reimplementing `consume`, `pull`, `fork`, and `resume`.

Backward incompatible;
  - The stream no longer pauses if `next` isn't synchronously called
    in
    `consume`, since this is no longer necessary to signal (lack of)
    demand to the source.
  - Lots of methods and properties that start with `_` changed
    (these
    were private anyway).
  - The callback for the stream generator and `consume` is
    guaranteed
    not to be called a second time until `next` is called.

Fixes:
  - caolan#41
  - caolan#141
  - caolan#142
  - caolan#173
vqvu added a commit to vqvu/highland that referenced this issue Nov 29, 2014
This involves:
  - Totally reimplementing stream redirection.
  - Reimplementing `consume`, `pull`, `fork`, and `resume`.

Backward incompatible;
  - The stream no longer pauses if `next` isn't synchronously called
    in
    `consume`, since this is no longer necessary to signal (lack of)
    demand to the source.
  - Lots of methods and properties that start with `_` changed
    (these
    were private anyway).
  - The callback for the stream generator and `consume` is
    guaranteed
    not to be called a second time until `next` is called.

Fixes:
  - caolan#41
  - caolan#141
  - caolan#142
  - caolan#173
vqvu added a commit to vqvu/highland that referenced this issue Nov 29, 2014
This involves:
  - Totally reimplementing stream redirection.
  - Reimplementing `consume`, `pull`, `fork`, and `resume`.

Backward incompatible;
  - The stream no longer pauses if `next` isn't synchronously called
    in
    `consume`, since this is no longer necessary to signal (lack of)
    demand to the source.
  - Lots of methods and properties that start with `_` changed
    (these
    were private anyway).
  - The callback for the stream generator and `consume` is
    guaranteed
    not to be called a second time until `next` is called.

Fixes:
  - caolan#41
  - caolan#141
  - caolan#142
  - caolan#173
vqvu added a commit to vqvu/highland that referenced this issue Nov 29, 2014
This involves:
  - Totally reimplementing stream redirection.
  - Reimplementing `consume`, `pull`, `fork`, and `resume`.

Backward incompatible;
  - The stream no longer pauses if `next` isn't synchronously called
    in
    `consume`, since this is no longer necessary to signal (lack of)
    demand to the source.
  - Lots of methods and properties that start with `_` changed
    (these
    were private anyway).
  - The callback for the stream generator and `consume` is
    guaranteed
    not to be called a second time until `next` is called.

Fixes:
  - caolan#41
  - caolan#141
  - caolan#142
  - caolan#173
vqvu added a commit that referenced this issue Dec 13, 2014
This involves:
  - Totally reimplementing stream redirection.
  - Reimplementing `consume`, `pull`, `fork`, and `resume`.

Backward incompatible;
  - The stream no longer pauses if `next` isn't synchronously called
    in
    `consume`, since this is no longer necessary to signal (lack of)
    demand to the source.
  - Lots of methods and properties that start with `_` changed
    (these
    were private anyway).
  - The callback for the stream generator and `consume` is
    guaranteed
    not to be called a second time until `next` is called.

Fixes:
  - #41
  - #141
  - #142
  - #173
vqvu added a commit that referenced this issue Jan 25, 2015
This involves:
  - Totally reimplementing stream redirection.
  - Reimplementing `consume`, `pull`, `fork`, and `resume`.

Backward incompatible;
  - The stream no longer pauses if `next` isn't synchronously called
    in
    `consume`, since this is no longer necessary to signal (lack of)
    demand to the source.
  - Lots of methods and properties that start with `_` changed
    (these
    were private anyway).
  - The callback for the stream generator and `consume` is
    guaranteed
    not to be called a second time until `next` is called.

Fixes:
  - #41
  - #141
  - #142
  - #173
vqvu added a commit that referenced this issue Jan 25, 2015
This involves:
  - Totally reimplementing stream redirection.
  - Reimplementing `consume`, `pull`, `fork`, and `resume`.

Backward incompatible;
  - The stream no longer pauses if `next` isn't synchronously called
    in
    `consume`, since this is no longer necessary to signal (lack of)
    demand to the source.
  - Lots of methods and properties that start with `_` changed
    (these
    were private anyway).
  - The callback for the stream generator and `consume` is
    guaranteed
    not to be called a second time until `next` is called.

Fixes:
  - #41
  - #141
  - #142
  - #173
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants