New features
- Added support for Swift Package Manager
- Updated to Xcode 11.5
Breaking changes
PiedPiper
is now compiled with Swift 2.3merge
has been deprecated, please usemergeAll
instead
New features
- Added
mergeSome
to aSequenceType
ofFuture
s to collapse a list ofFuture
s into a single one that succeeds even if some of theFuture
s fail (contrast tomerge
) - Added
all
to aSequenceType
ofFuture
s to collapse a list ofFuture
s into a single one that succeeds when all of the elements of the sequence succeed, and fails when one of the element fails (it's similar tomerge
but it doesn't bring the results with it). - Added
snooze
toFuture
in order to delay the result of aFuture
(either success or failure) by a given time - Added
timeout
toFuture
in order to set a deadline for the result of aFuture
after which it will automatically fail - Added
firstCompleted
to aSequenceType
ofFuture
s to get the result of the firstFuture
that completes and ignore the others. - Added a
retry
global function to retry a givenFuture
(generated through a provided closure) a certain number of times every given interval
Breaking changes
- The codebase has been migrated to Swift 2.2
Promise
now has only an emptyinit
. If you used one of the convenienceinit
(withvalue:
, witherror:
or withvalue:error:
), they now moved toFuture
.
New features
- Adds
value
anderror
properties toResult
- Added a way to initialize
Future
s through closures - It's now possible to
map
Future
s through:- a simple transformation closure
- a closure that
throws
- It's now possible to
flatMap
Future
s through:- a closure that returns an
Optional
- a closure that returns another
Future
- a closure that returns a
Result
- a closure that returns an
- It's now possible to
filter
Future
s through:- a simple condition closure
- a closure that returns a
Future<Bool>
- It's now possible to
reduce
aSequenceType
ofFuture
s into a newFuture
through acombine
closure - It's now possible to
zip
aFuture
with either anotherFuture
or with aResult
- Added
merge
to aSequenceType
ofFuture
s to collapse a list ofFuture
s into a single one - Added
traverse
toSequenceType
to generate a list ofFuture
s through a given closure andmerge
them together - Added
recover
toFuture
so that it's possible to provide a default value theFuture
can use instead of failing - It's now possible to
map
Result
s through:- a simple transformation closure
- a closure that
throws
- It's now possible to
flatMap
Result
s through:- a closure that returns an
Optional
- a closure that returns a
Future
- a closure that returns another
Result
- a closure that returns an
- It's now possible to
filter
Result
s through a simple condition closure - Added
mimic
toResult
First release of Pied Piper
as a separate framework.
Breaking changes
- As documented in the
MIGRATING.md
file, you will have to add aimport PiedPiper
line everywhere you make use of Carlos'Future
s orPromise
s.
New features
- It's now possible to compose async functions and
Future
s through the>>>
operator. - The implementation of
ReadWriteLock
taken from Deferred is now exposed aspublic
. - It's now possible to take advantage of the
GCD
struct to execute asynchronous computation through the functionsmain
andbackground
for GCD built-in queues andasync
for GCD serial or custom queues.
Improvements
Promise
s are now safer to use with GCD and in multi-thread scenarios.
Fixes
- Fixes a bug where calling
succeed
,fail
orcancel
on aPromise
or aFuture
didn't correctly release all the attached listeners. - Fixes a retain cycle between
Promise
andFuture
objects.