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 ConcurrentFuture based on concurrify #70

Merged
merged 1 commit into from
Feb 14, 2017
Merged

Add ConcurrentFuture based on concurrify #70

merged 1 commit into from
Feb 14, 2017

Conversation

Avaq
Copy link
Member

@Avaq Avaq commented Feb 13, 2017

Adds the following functions:

  • Future.Par :: Future a b -> ConcurrentFuture a b
  • Future.seq :: ConcurrentFuture a b -> Future a b
  • Future.never :: () -> Future a a

@Avaq
Copy link
Member Author

Avaq commented Feb 13, 2017

Oh. Forgot documentation again. On its way.

@codecov-io
Copy link

codecov-io commented Feb 13, 2017

Codecov Report

Merging #70 into master will not change coverage.
The diff coverage is 100%.

@@          Coverage Diff          @@
##           master    #70   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines         889    929   +40     
  Branches      214    219    +5     
=====================================
+ Hits          889    929   +40
Impacted Files Coverage Δ
fluture.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b63433...250180e. Read the comment docs.

@Avaq Avaq force-pushed the av-parallel branch 5 times, most recently from 1c50bc2 to ba21ad0 Compare February 14, 2017 11:59
@Avaq
Copy link
Member Author

Avaq commented Feb 14, 2017

I think that's it. Would you mind taking a look @safareli?

@Avaq Avaq force-pushed the av-parallel branch 2 times, most recently from 6d2281a to 2967549 Compare February 14, 2017 12:11
README.md Outdated
@@ -172,6 +174,12 @@ eventualThing.fork(
//> "Hello world!"
```

#### never
##### `.never :: () -> Future a a`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change this to never :: Future a a.

@Avaq Avaq force-pushed the av-parallel branch 2 times, most recently from 1ac47e2 to 61acbad Compare February 14, 2017 12:30
@Avaq Avaq changed the title Add ParallelFuture based on concurrify Add ConcurrentFuture based on concurrify Feb 14, 2017
fluture.js Outdated
return `Future.never`;
};

Future.never = new FutureNever;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw is there some reason of having separate class FutureNever when it could be implemented like this (as there is only one instance):

Future.never = object.assign(Object.create(Future.prototype),{
  _f: function FutureNever$fork(){
    return noop;
  },
  toString: function FutureNever$toString(){
    return `Future.never`;
  },
})

Copy link
Member Author

@Avaq Avaq Feb 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no reason for it. I think it's fine like this: I like the consistent looking code. I guess it's not really important.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's fine

Copy link

@safareli safareli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool stuff! LGTM

Adds the following exports:

* Future.Par :: Future a b -> ConcurrentFuture a b
* Future.seq :: ConcurrentFuture a b -> Future a b
* Future.never :: Future a a

Closes #44
@Avaq Avaq merged commit 6af85fd into master Feb 14, 2017
@Avaq Avaq deleted the av-parallel branch February 14, 2017 14:05
Avaq added a commit that referenced this pull request Feb 23, 2017
Breaking changes

- #74 The argument order of `Future.or()` has been flipped
- #75 `Future.isForkable()` has been removed
- #75 `Future.fromForkable()` has been removed
- #75 `Future.cast()` has been removed

New features

- #70 Add a new ConcurrentFuture type

Bug fixes and improvements

- #4 #69 All curried functions now fail fast
- #59 Update Sanctuary interoperability
- #73 `Future.finally()` now runs `finally` computation when cancelled
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.

None yet

3 participants