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

Future called twice with both #118

Closed
anthonyshull opened this issue Jun 27, 2017 · 3 comments
Closed

Future called twice with both #118

anthonyshull opened this issue Jun 27, 2017 · 3 comments

Comments

@anthonyshull
Copy link

Using fluture 6.2.6

import { both, node } from 'fluture';

const f1 = node((done) => {
  api({}, (err, msg) => done(err, msg));
});

const f2 = node((done) => {
  api({}, (err, msg) => done(err, msg));
});

both(f1, f2)
  .fork(err => console.error, res => console.log);

This was calling the api in f2 twice. Not sure if it was calling f1 more than once. Switched to:

parallel(2, new Array(f1, f2))
  .fork(err => console.error, res => console.log);

And then it is working properly calling f1 and f2 once each.

@Avaq
Copy link
Member

Avaq commented Jun 28, 2017

Thanks for reporting this. I was able to reproduce it in a unit test and will fix it immediately.

@Avaq
Copy link
Member

Avaq commented Jun 28, 2017

The bug was introduced in f434193

Avaq added a commit that referenced this issue Jun 28, 2017
It turns out we need this to build parallel actions
that make use of transformations.

Fixes #118
Avaq added a commit that referenced this issue Jun 28, 2017
It turns out we need this to build parallel actions
that make use of transformations.

Fixes #118
@Avaq Avaq closed this as completed in #119 Jun 28, 2017
@Avaq
Copy link
Member

Avaq commented Jun 29, 2017

@anthonyshull I've published a fix under 6.2.7. If you get the chance, I'd be interested to hear whether this version resolves the issue within the context where you first encountered it.

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