Skip to content

Commit 1178d2f

Browse files
committed
Advanced version to 1.0.0
1 parent 263554a commit 1178d2f

File tree

3 files changed

+14
-21
lines changed

3 files changed

+14
-21
lines changed

Diff for: README.md

+11-18
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,25 @@ This is a library implementing [futures](https://en.wikipedia.org/wiki/Future_%2
1212

1313
**Recent Changes**
1414

15-
- Bit the breaking change bullet and changed some names so they're not stuck once v1 hits.
16-
- Fixed lack of "toc" prefixes on array category methods like `asyncThenAll` (now `toc_thenAll`).
17-
- Shortened excessively long names, such as `futureWithResultFromAsyncOperationWithResultLastingUntilCancelled` becoming `futureFromUntilOperation`.
18-
- Added `matchLastToCancelBetween:and:` and `matchFirstToCancelBetween:and:` constructors to `TOCCancelToken`, to allow combining lifetimes a bit more flexibly.
19-
- Added check of cancel token *after* returning to main thread, to allow UI code to assume that observing a token as cancelled implies no more returning-to-main-thread on-cancel callbacks will occur.
20-
21-
**Incoming Changes**
22-
- Version 1
23-
- Shortening #import "TwistedOakCollapsingFutures.h" to #import "CollapsingFutures.h"
15+
- Version 1.
16+
- Deprecated "TwistedOakCollapsingFutures.h" for "CollapsingFutures.h".
17+
- Futures are now equatable (by current state then by will-end-up-in-same-state-with-same-value).
2418

2519
Installation
2620
============
2721

2822
**Method #1: [CocoaPods](http://cocoapods.org/)**
2923

30-
1. In your [Podfile](http://docs.cocoapods.org/podfile.html), add `pod 'TwistedOakCollapsingFutures'`
31-
2. Consider [versioning](http://docs.cocoapods.org/guides/dependency_versioning.html), like: `pod 'TwistedOakCollapsingFutures', '~> 0.7'`
32-
3. Run `pod install`
33-
4. `#import "TwistedOakCollapsingFutures.h"` wherever you want to access the library's types or methods
24+
1. In your [Podfile](http://guides.cocoapods.org/using/the-podfile.html), add `pod 'TwistedOakCollapsingFutures', '~> 1.0'`
25+
2. Run `pod install` from the project directory
26+
3. `#import "CollapsingFutures.h"` wherever you want to use futures, cancel tokens, or their category methods
3427

3528
**Method #2: Manual**
3629

3730
1. Download one of the [releases](https://github.com/Strilanc/ObjC-CollapsingFutures/releases), or clone the repo
3831
2. Copy the source files from the src/ folder into your project
3932
3. Have ARC enabled
40-
4. `#import "TwistedOakCollapsingFutures.h"` wherever you want to access the library's types or methods
33+
4. `#import "CollapsingFutures.h"` wherever you want to use futures, cancel tokens, or their category methods
4134

4235

4336
Usage
@@ -48,14 +41,14 @@ Usage
4841
- [Usage and benefits of collapsing futures](http://twistedoakstudios.com/blog/Post7149_collapsing-futures-in-objective-c)
4942
- [Usage and benefits of cancellation tokens](http://twistedoakstudios.com/blog/Post7391_cancellation-tokens-and-collapsing-futures-for-objective-c)
5043
- [How immortality detection works](http://twistedoakstudios.com/blog/Post7525_using-immortality-to-kill-accidental-callback-cycles)
51-
- [An excellent explanation and motivation for the 'monadic' design of futures (C++)](http://bartoszmilewski.com/2014/02/26/c17-i-see-a-monad-in-your-future/)
44+
- [Explanation and motivation for the 'monadic' design of futures (in C++)](http://bartoszmilewski.com/2014/02/26/c17-i-see-a-monad-in-your-future/)
5245

5346
**Using a Future**
5447

5548
The following code is an example of how to make a `TOCFuture` *do* something. Use `thenDo` to make things happen when the future succeeds, and `catchDo` to make things happen when it fails (there's also `finallyDo` for cleanup):
5649

5750
```objective-c
58-
#import "TwistedOakCollapsingFutures.h"
51+
#import "CollapsingFutures.h"
5952

6053
// ask for the address book, which is asynchronous because IOS may ask the user to allow it
6154
TOCFuture *futureAddressBook = SomeUtilityClass.asyncGetAddressBook;
@@ -84,7 +77,7 @@ When the result is not known right away, the class `TOCFutureSource` is used. It
8477
Here's how `asyncGetAddressBook` is implemented:
8578
8679
```objective-c
87-
#import "TwistedOakCollapsingFutures.h"
80+
#import "CollapsingFutures.h"
8881
8982
+(TOCFuture *) asyncGetAddressBook {
9083
CFErrorRef creationError = nil;
@@ -118,7 +111,7 @@ Here's how `asyncGetAddressBook` is implemented:
118111
Just creating and using futures is useful, but not what makes them powerful. The true power is in transformative methods like `then:` and `toc_thenAll` that both consume and produce futures. They make wiring up complicated asynchronous sequences look easy:
119112

120113
```objective-c
121-
#import "TwistedOakCollapsingFutures.h"
114+
#import "CollapsingFutures.h"
122115

123116
+(TOCFuture *) sumOfFutures:(NSArray*)arrayOfFuturesOfNumbers {
124117
// we want all of the values to be ready before we bother summing

Diff for: TwistedOakCollapsingFutures.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "TwistedOakCollapsingFutures"
3-
s.version = "0.9.3"
3+
s.version = "1.0.0"
44
s.summary = "Futures without nesting issues."
55
s.description = <<-DESC
66
Makes representing and consuming asynchronous results simpler.
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
s.homepage = "https://github.com/Strilanc/ObjC-CollapsingFutures"
1717
s.license = { :type => 'BSD', :file => 'License.txt' }
1818
s.author = { "Craig Gidney" => "[email protected]" }
19-
s.source = { :git => "https://github.com/Strilanc/ObjC-CollapsingFutures.git", :tag => "v0.9.3" }
19+
s.source = { :git => "https://github.com/Strilanc/ObjC-CollapsingFutures.git", :tag => "v1.0.0" }
2020
s.source_files = 'src', 'src/**/*.{h,m}'
2121
s.requires_arc = true
2222
s.dependency 'UnionFind', '~> 1.0'

Diff for: src/TwistedOakCollapsingFutures.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#warning Use "CollapsingFutures.h" instead of deprecated "TwistedOakCollapsingFutures.h"
1+
#warning Use #import "CollapsingFutures.h" instead of deprecated #import "TwistedOakCollapsingFutures.h"
22

33
#import "CollapsingFutures.h"

0 commit comments

Comments
 (0)