🍴 Parallelize two or more async functions

Overview

Fork

Parallelize two or more async functions

What is Fork?

Fork allows for a single input to create two separate async functions that return potentially different outputs. Forks can also merge their two functions into one which returns a single output.

The word "fork" has been used to mean "to divide in branches, go separate ways" as early as the 14th century. In the software environment, the word evokes the fork system call, which causes a running process to split itself into two (almost) identical copies that (typically) diverge to perform different tasks. Source

Why use Fork?

Swift async-await makes it easy to write more complicated asynchronous code, but it can be difficult to parallelize multiple functions.

The Swift Book has the following example for downloading multiple images.

let firstPhoto = await downloadPhoto(named: photoNames[0])
let secondPhoto = await downloadPhoto(named: photoNames[1])
let thirdPhoto = await downloadPhoto(named: photoNames[2])

let photos = [firstPhoto, secondPhoto, thirdPhoto]
show(photos)

Now the code above is still asynchronous, but will only run one function at a time. In the example above, firstPhoto will be set first, then secondPhoto, and finally thirdPhoto.

To run these three async functions in parallel we need to change the code to this following example.

async let firstPhoto = downloadPhoto(named: photoNames[0])
async let secondPhoto = downloadPhoto(named: photoNames[1])
async let thirdPhoto = downloadPhoto(named: photoNames[2])

let photos = await [firstPhoto, secondPhoto, thirdPhoto]
show(photos)

The above code will now download all three photos at the same time. When all the photos have been downloaded it will show the photos.

This is a simple async-await example of running code in parallel in which you might not need to use Fork. More complicated examples though might require async dependencies. For example what if we needed to authenticate with a server; then use the auth token to download the photos while also fetching some data from the database. This is where Fork is useful!

When using Fork, functions will be ran in parallel and higher order forks will also be ran in parallel.

Objects

  • Fork: Using a single input create two separate async functions that return LeftOutput and RightOutput.
  • ForkedActor: Using a single actor create two separate async functions that are passed the actor.
    • KeyPathActor: A generic Actor that uses KeyPaths to update and set values.
  • ForkedArray: Using a single array and a single async function, parallelize the work for each value of the array.

Basic usage

import Fork

Fork Example

let fork = Fork(
    value: 10,
    leftOutput: { $0.isMultiple(of: 2) },
    rightOutput: { "\($0)" }
)
        
let leftOutput = try await fork.left()
let rightOutput = try await fork.right()

XCTAssertEqual(leftOutput, true)
XCTAssertEqual(rightOutput, "10")
        
let mergedFork: () async throws -> String = fork.merge(
    using: { bool, string in
        if bool {
            return string + string
        }
            
        return string
    }
)
        
let output = await mergedFork()

XCTAssertEqual(output, "1010")

ForkedActor Example

actor TestActor {
    var value: Int = 0
    
    func increment() {
        value += 1
    }
}

let forkedActor = ForkedActor(
    actor: TestActor(),
    leftOutput: { actor in
        await actor.increment()
    },
    rightOutput: { actor in
        try await actor.fork(
            leftOutput: { await $0.increment() },
            rightOutput: { await $0.increment() }
        )
        .act()
    }
)

let actorValue = await forkedActor.act().value

XCTAssertEqual(actorValue, 3)

ForkedActor KeyPathActor Example

let forkedActor = ForkedActor(
    value: 0,
    leftOutput: { actor in
        await actor.update(to: { $0 + 1 })
    },
    rightOutput: { actor in
        try await actor.fork(
            leftOutput: { actor in
                await actor.update(to: { $0 + 1 })
            },
            rightOutput: { actor in
                await actor.update(\.self, to: { $0 + 1 })
            }
        )
        .act()
    }
)

let actorValue = try await forkedActor.act().value

XCTAssertEqual(actorValue, 3)

ForkedArray Example

A ForkedArray makes it easy to perform an asynchronous function on all of the elements in an Array. ForkedArray helps with the example above.

let forkedArray = ForkedArray(photoNames, output: downloadPhoto(named:))
let photos = try await forkedArray.output()

Extra Examples

Vapor ForkedActor Example

ForkedArray Pictures Example

Service Example

let service = Fork(
    value: AppConfiguration(),
    leftOutput: { configuration in
        Fork(
            value: AuthService(configuration),
            leftOutput: { authService in ... },
            rightOutput: { authService in ... }
        )
    },
    rightOutput: { configuration in
        ...
    }
)

let mergedServiceFork: async throws () -> AppServices = service.merge(
    using: { authFork, configurationOutput in
        let services = try await authFork.merged(...)
            
        services.logger.log(configurationOutput)
            
        return services
    }
)
You might also like...
iOS 13-compatible backports of commonly used async/await-based system APIs that are only available from iOS 15 by default.

AsyncCompatibilityKit Welcome to AsyncCompatibilityKit, a lightweight Swift package that adds iOS 13-compatible backports of commonly used async/await

Hydra: Lightweight full-featured Promises, Async-Await Library in Swift

Async Functions for ECMAScript The introduction of Promises and Generators in EC

Swift TableView pagination with async API request.
Swift TableView pagination with async API request.

SwiftTableViewPagination Swift TableView pagination with async API request. Output UML Create puml file. $ cd SwiftTableViewPagination/scripts/swiftum

straightforward networking and error handling with async-await and URLSession

AsyncAwaitNetworkingPlayground How To Run Just clone the project, open it and run. Some notes about AsyncAwaitNetworkingPlayground It's a straightforw

PixabayImageSearchSample - SwiftUI + LazyVGrid + Pixabay API + Codable + sync/async Sample
PixabayImageSearchSample - SwiftUI + LazyVGrid + Pixabay API + Codable + sync/async Sample

PixabayImageSearchSample SwiftUI + LazyVGrid + Pixabay API + Codable + sync/asyn

AsyncTaskKit - contains some additions to async/await Task

AsyncTaskKit This repo contains some additions to async/await Task. In general i

AsyncLocationKit - Async/await CoreLocation With Swift

AsyncLocationKit Wrapper for Apple CoreLocation framework with new Concurency Mo

Edit images and video with async / await in Swift, powered by Metal.
Edit images and video with async / await in Swift, powered by Metal.

AsyncGraphics The core value type in AsyncGraphics is a Graphic. It's like an image, tho it can be used with various async methods. Documentation Swif

AsyncExtensions aims to mimic Swift Combine operators for async sequences.

AsyncExtensions AsyncExtensions provides a collection of operators, async sequences and async streams that mimics Combine behaviour. The purpose is to

Releases(1.2.0)
  • 1.2.0(Sep 22, 2022)

    What's Changed

    • Feature/fork merging by @0xLeif in https://github.com/0xLeif/Fork/pull/15
    • Promote Array extension to Sequence by @0xLeif in https://github.com/0xLeif/Fork/pull/16

    Full Changelog: https://github.com/0xLeif/Fork/compare/1.1.0...1.2.0

    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Sep 16, 2022)

    What's Changed

    • Add Array.asyncCompactMap by @0xLeif in https://github.com/0xLeif/Fork/pull/14

    Full Changelog: https://github.com/0xLeif/Fork/compare/1.0.1...1.1.0

    Source code(tar.gz)
    Source code(zip)
  • 1.0.1(Aug 23, 2022)

    What's Changed

    • Add async and throwing capability to value closure for Fork by @0xLeif in https://github.com/0xLeif/Fork/pull/12
    • Remove await and prefer parallel await using async let for ForkedArray by @0xLeif in https://github.com/0xLeif/Fork/pull/12

    Full Changelog: https://github.com/0xLeif/Fork/compare/1.0.0...1.0.1


    Fork

    Parallelize two or more async functions

    What is Fork?

    Fork allows for a single input to create two separate async functions that return potentially different outputs. Forks can also merge their two functions into one which returns a single output.

    The word "fork" has been used to mean "to divide in branches, go separate ways" as early as the 14th century. In the software environment, the word evokes the fork system call, which causes a running process to split itself into two (almost) identical copies that (typically) diverge to perform different tasks. Source

    Why use Fork?

    Swift async-await makes it easy to write more complicated asynchronous code, but it can be difficult to parallelize multiple functions.

    The Swift Book has the following example for downloading multiple images.

    let firstPhoto = await downloadPhoto(named: photoNames[0])
    let secondPhoto = await downloadPhoto(named: photoNames[1])
    let thirdPhoto = await downloadPhoto(named: photoNames[2])
    
    let photos = [firstPhoto, secondPhoto, thirdPhoto]
    show(photos)
    

    Now the code above is still asynchronous, but will only run one function at a time. In the example above, firstPhoto will be set first, then secondPhoto, and finally thirdPhoto.

    To run these three async functions in parallel we need to change the code to this following example.

    async let firstPhoto = downloadPhoto(named: photoNames[0])
    async let secondPhoto = downloadPhoto(named: photoNames[1])
    async let thirdPhoto = downloadPhoto(named: photoNames[2])
    
    let photos = await [firstPhoto, secondPhoto, thirdPhoto]
    show(photos)
    

    The above code will now download all three photos at the same time. When all the photos have been downloaded it will show the photos.

    This is a simple async-await example of running code in parallel in which you might not need to use Fork. More complicated examples though might require async dependencies. For example what if we needed to authenticate with a server; then use the auth token to download the photos while also fetching some data from the database. This is where Fork is useful!

    When using Fork, functions will be ran in parallel and higher order forks will also be ran in parallel.

    Objects

    • Fork: Using a single input create two separate async functions that return LeftOutput and RightOutput.
    • ForkedActor: Using a single actor create two separate async functions that are passed the actor.
      • KeyPathActor: A generic Actor that uses KeyPaths to update and set values.
    • ForkedArray: Using a single array and a single async function, parallelize the work for each value of the array.

    Basic usage

    import Fork
    

    Fork Example

    let fork = Fork(
        value: 10,
        leftOutput: { $0.isMultiple(of: 2) },
        rightOutput: { "\($0)" }
    )
            
    let leftOutput = try await fork.left()
    let rightOutput = try await fork.right()
    
    XCTAssertEqual(leftOutput, true)
    XCTAssertEqual(rightOutput, "10")
            
    let mergedFork: () async throws -> String = fork.merge(
        using: { bool, string in
            if bool {
                return string + string
            }
                
            return string
        }
    )
            
    let output = await mergedFork()
    
    XCTAssertEqual(output, "1010")
    

    ForkedActor Example

    actor TestActor {
        var value: Int = 0
        
        func increment() {
            value += 1
        }
    }
    
    let forkedActor = ForkedActor(
        actor: TestActor(),
        leftOutput: { actor in
            await actor.increment()
        },
        rightOutput: { actor in
            try await actor.fork(
                leftOutput: { await $0.increment() },
                rightOutput: { await $0.increment() }
            )
            .act()
        }
    )
    
    let actorValue = await forkedActor.act().value
    
    XCTAssertEqual(actorValue, 3)
    

    ForkedActor KeyPathActor Example

    let forkedActor = ForkedActor(
        value: 0,
        leftOutput: { actor in
            await actor.update(to: { $0 + 1 })
        },
        rightOutput: { actor in
            try await actor.fork(
                leftOutput: { actor in
                    await actor.update(to: { $0 + 1 })
                },
                rightOutput: { actor in
                    await actor.update(\.self, to: { $0 + 1 })
                }
            )
            .act()
        }
    )
    
    let actorValue = try await forkedActor.act().value
    
    XCTAssertEqual(actorValue, 3)
    

    ForkedArray Example

    A ForkedArray makes it easy to perform an asynchronous function on all of the elements in an Array. ForkedArray helps with the example above.

    let forkedArray = ForkedArray(photoNames, output: downloadPhoto(named:))
    let photos = try await forkedArray.output()
    

    Extra Examples

    Vapor ForkedActor Example

    Service Example

    let service = Fork(
        value: AppConfiguration(),
        leftOutput: { configuration in
            Fork(
                value: AuthService(configuration),
                leftOutput: { authService in ... },
                rightOutput: { authService in ... }
            )
        },
        rightOutput: { configuration in
            ...
        }
    )
    
    let mergedServiceFork: async throws () -> AppServices = service.merge(
        using: { authFork, configurationOutput in
            let services = try await authFork.merged(...)
                
            services.logger.log(configurationOutput)
                
            return services
        }
    )
    
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Aug 18, 2022)

    What's Changed

    • Added KeyPathActor and Release/1.0.0 by @0xLeif in https://github.com/0xLeif/Fork/pull/11

    Full Changelog: https://github.com/0xLeif/Fork/compare/0.7.0...1.0.0


    Fork

    Parallelize two or more async functions

    What is Fork?

    Fork allows for a single input to create two separate async functions that return potentially different outputs. Forks can also merge their two functions into one which returns a single output.

    The word "fork" has been used to mean "to divide in branches, go separate ways" as early as the 14th century. In the software environment, the word evokes the fork system call, which causes a running process to split itself into two (almost) identical copies that (typically) diverge to perform different tasks. Source

    Why use Fork?

    Swift async-await makes it easy to write more complicated asynchronous code, but it can be difficult to parallelize multiple functions.

    The Swift Book has the following example for downloading multiple images.

    let firstPhoto = await downloadPhoto(named: photoNames[0])
    let secondPhoto = await downloadPhoto(named: photoNames[1])
    let thirdPhoto = await downloadPhoto(named: photoNames[2])
    
    let photos = [firstPhoto, secondPhoto, thirdPhoto]
    show(photos)
    

    Now the code above is still asynchronous, but will only run one function at a time. In the example above, firstPhoto will be set first, then secondPhoto, and finally thirdPhoto.

    To run these three async functions in parallel we need to change the code to this following example.

    async let firstPhoto = downloadPhoto(named: photoNames[0])
    async let secondPhoto = downloadPhoto(named: photoNames[1])
    async let thirdPhoto = downloadPhoto(named: photoNames[2])
    
    let photos = await [firstPhoto, secondPhoto, thirdPhoto]
    show(photos)
    

    The above code will now download all three photos at the same time. When all the photos have been downloaded it will show the photos.

    This is a simple async-await example of running code in parallel in which you might not need to use Fork. More complicated examples though might require async dependencies. For example what if we needed to authenticate with a server; then use the auth token to download the photos while also fetching some data from the database. This is where Fork is useful!

    When using Fork or ForkedActor, both functions will be ran in parallel. Higher order forks will also be ran in parallel.

    Basic usage

    import Fork
    

    Fork Example

    let fork = Fork(
        value: 10,
        leftOutput: { $0.isMultiple(of: 2) },
        rightOutput: { "\($0)" }
    )
            
    let leftOutput = try await fork.left()
    let rightOutput = try await fork.right()
    
    XCTAssertEqual(leftOutput, true)
    XCTAssertEqual(rightOutput, "10")
            
    let mergedFork: () async throws -> String = fork.merge(
        using: { bool, string in
            if bool {
                return string + string
            }
                
            return string
        }
    )
            
    let output = await mergedFork()
    
    XCTAssertEqual(output, "1010")
    

    ForkedActor Example

    actor TestActor {
        var value: Int = 0
        
        func increment() {
            value += 1
        }
    }
    
    let forkedActor = ForkedActor(
        actor: TestActor(),
        leftOutput: { actor in
            await actor.increment()
        },
        rightOutput: { actor in
            try await actor.fork(
                leftOutput: { await $0.increment() },
                rightOutput: { await $0.increment() }
            )
            .act()
        }
    )
    
    let actorValue = await forkedActor.act().value
    
    XCTAssertEqual(actorValue, 3)
    

    ForkedActor KeyPathActor Example

    let forkedActor = ForkedActor(
        value: 0,
        leftOutput: { actor in
            await actor.update(to: { $0 + 1 })
        },
        rightOutput: { actor in
            try await actor.fork(
                leftOutput: { actor in
                    await actor.update(to: { $0 + 1 })
                },
                rightOutput: { actor in
                    await actor.update(\.self, to: { $0 + 1 })
                }
            )
            .act()
        }
    )
    
    let actorValue = try await forkedActor.act().value
    
    XCTAssertEqual(actorValue, 3)
    

    ForkedArray Example

    A ForkedArray makes it easy to perform an asynchronous function on all of the elements in an Array. ForkedArray helps with the example above.

    let forkedArray = ForkedArray(photoNames, output: downloadPhoto(named:))
    let photos = try await forkedArray.output()
    

    Extra Examples

    Vapor ForkedActor Example

    Service Example

    let service = Fork(
        value: AppConfiguration(),
        leftOutput: { configuration in
            Fork(
                value: AuthService(configuration),
                leftOutput: { authService in ... },
                rightOutput: { authService in ... }
            )
        },
        rightOutput: { configuration in
            ...
        }
    )
    
    let mergedServiceFork: async throws () -> AppServices = service.merge(
        using: { authFork, configurationOutput in
            let services = try await authFork.merged(...)
                
            services.logger.log(configurationOutput)
                
            return services
        }
    )
    
    Source code(tar.gz)
    Source code(zip)
  • 0.7.0(Aug 18, 2022)

    What's Changed

    • Add async map and filter to array by @0xLeif in https://github.com/0xLeif/Fork/pull/10

    Full Changelog: https://github.com/0xLeif/Fork/compare/0.6.3...0.7.0

    ForkedArray Examples

    let photoNames: [String] = ...
    func isValidPhoto(named: String) async -> Bool { ... }
    func downloadPhoto(named: String) async -> Photo { ... }
    

    ForkedArray init

    let forkedArray: ForkedArray<String, Photo> = ForkedArray(
        photoNames,
        filter: isValidPhoto(named:),
        map: downloadPhoto(named:)
    )
    let photos: [Photo] = try await forkedArray.output()
    

    Array ForkedArray init

    let forkedArray = photoNames.fork
        filter: isValidPhoto(named:),
        map: downloadPhoto(named:)
    )
    let photos: [Photo] = try await forkedArray.output()
    

    Array asyncFilter

    let photoNames: [String] = try await photoNames.asyncFilter(isValidPhoto(named:))
    

    Array asyncMap

    let photos: [Photo] = try await photoNames.asyncMap(downloadPhoto(named:))
    
    Source code(tar.gz)
    Source code(zip)
  • 0.6.3(Aug 18, 2022)

    What's Changed

    • Added better Task cancellation for ForkedArray in https://github.com/0xLeif/Fork/commit/6fe18c31103371e42f2a0e1c49f4b0da99d70c89

    Full Changelog: https://github.com/0xLeif/Fork/compare/0.6.2...0.6.3

    Source code(tar.gz)
    Source code(zip)
  • 0.6.2(Aug 18, 2022)

    What's Changed

    • Add Array extension by @0xLeif in https://github.com/0xLeif/Fork/pull/9

    Full Changelog: https://github.com/0xLeif/Fork/compare/0.6.1...0.6.2

    Source code(tar.gz)
    Source code(zip)
  • 0.6.1(Aug 18, 2022)

    What's Changed

    • Update README.md by @0xLeif in https://github.com/0xLeif/Fork/pull/7
    • Forked array cleanup by @0xLeif in https://github.com/0xLeif/Fork/pull/8

    Full Changelog: https://github.com/0xLeif/Fork/compare/0.6.0...0.6.1

    Source code(tar.gz)
    Source code(zip)
  • 0.6.0(Aug 17, 2022)

    What's Changed

    • Feature/void improvements by @0xLeif in https://github.com/0xLeif/Fork/pull/6

    Full Changelog: https://github.com/0xLeif/Fork/compare/0.5.0...0.6.0

    Source code(tar.gz)
    Source code(zip)
  • 0.5.0(Aug 17, 2022)

    What's Changed

    • Feature/void by @0xLeif in https://github.com/0xLeif/Fork/pull/5

    Full Changelog: https://github.com/0xLeif/Fork/compare/0.4.0...0.5.0

    Source code(tar.gz)
    Source code(zip)
  • 0.4.0(Aug 17, 2022)

    What's Changed

    • Feature/array by @0xLeif in https://github.com/0xLeif/Fork/pull/4

    Full Changelog: https://github.com/0xLeif/Fork/compare/0.3.0...0.4.0

    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(Aug 11, 2022)

    What's Changed

    • Feature/actors by @0xLeif in https://github.com/0xLeif/Fork/pull/2
    • Update README and Tests by @0xLeif in https://github.com/0xLeif/Fork/pull/3

    Full Changelog: https://github.com/0xLeif/Fork/compare/0.2.0...0.3.0

    ForkedActor Example

    actor TestActor {
        var value: Int = 0
        
        func increment() {
            value += 1
        }
    }
    
    let forkedActor = ForkedActor(
        actor: TestActor(),
        leftOutput: { actor in
            await actor.increment()
        },
        rightOutput: { actor in
            try await actor.fork(
                leftOutput: { await $0.increment() },
                rightOutput: { await $0.increment() }
            )
            .act()
        }
    )
    
    try await forkedActor.act()
    
    let actorValue = await forkedActor.actor.value
    
    XCTAssertEqual(actorValue, 3)
    
    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Aug 4, 2022)

    What's Changed

    • Update merge closure to be async throwing by @0xLeif in https://github.com/0xLeif/Fork/pull/1

    Full Changelog: https://github.com/0xLeif/Fork/compare/0.1.0...0.2.0


    Fork

    Using a single input create two separate async functions

    What is Fork?

    Fork allows for a single input to create two separate async functions that return potentially different outputs. Forks can also merge their two functions into one which returns a single output.

    The word "fork" has been used to mean "to divide in branches, go separate ways" as early as the 14th century. In the software environment, the word evokes the fork system call, which causes a running process to split itself into two (almost) identical copies that (typically) diverge to perform different tasks. Source

    Basic usage

    import Fork
    

    Basic Example

    let fork = Fork(
        value: 10,
        leftOutput: { $0.isMultiple(of: 2) },
        rightOutput: { "\($0)" }
    )
            
    let leftOutput = try await fork.left()
    let rightOutput = try await fork.right()
    
    XCTAssertEqual(leftOutput, true)
    XCTAssertEqual(rightOutput, "10")
            
    let mergedFork: () async throws -> String = fork.merge(
        using: { bool, string in
            if bool {
                return string + string
            }
                
            return string
        }
    )
            
    let output = await mergedFork()
    
    XCTAssertEqual(output, "1010")
    

    Service Example

    let service = Fork(
        value: AppConfiguration(),
        leftOutput: { configuration in
            Fork(
                value: AuthService(configuration),
                leftOutput: { authService in ... },
                rightOutput: { authService in ... }
            )
        },
        rightOutput: { configuration in
            ...
        }
    )
    
    let mergedServiceFork: async throws () -> AppServices = service.merge(
        using: { authFork, configurationOutput in
            guard let services = authFork.merged(...) else { return }
                
            services.logger.log(configurationOutput)
                
            return services
        }
    )
    
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Aug 3, 2022)

    Fork

    Using a single input create two separate async functions

    What is Fork?

    Fork allows for a single input to create two separate async functions that return potentially different outputs. Forks can also merge their two functions into one which returns a single output.

    The word "fork" has been used to mean "to divide in branches, go separate ways" as early as the 14th century. In the software environment, the word evokes the fork system call, which causes a running process to split itself into two (almost) identical copies that (typically) diverge to perform different tasks. Source

    Basic usage

    import Fork
    

    Basic Example

    let fork = Fork(
        value: 10,
        leftOutput: { $0.isMultiple(of: 2) },
        rightOutput: { "\($0)" }
    )
            
    let leftOutput = try await fork.left()
    let rightOutput = try await fork.right()
    
    XCTAssertEqual(leftOutput, true)
    XCTAssertEqual(rightOutput, "10")
            
    let mergedFork: () async throws -> String = fork.merge(
        using: { bool, string in
            if bool {
                return string + string
            }
                
            return string
        }
    )
            
    let output = await mergedFork()
    
    XCTAssertEqual(output, "1010")
    

    Service Example

    let service = Fork(
        value: AppConfiguration(),
        leftOutput: { configuration in
            Fork(
                value: AuthService(configuration),
                leftOutput: { authService in ... },
                rightOutput: { authService in ... }
            )
        },
        rightOutput: { configuration in
            ...
        }
    )
    
    let mergedServiceFork: async throws () -> AppServices = service.merge(
        using: { authFork, configurationOutput in
            guard let services = authFork.merged(...) else { return }
                
            services.logger.log(configurationOutput)
                
            return services
        }
    )
    
    Source code(tar.gz)
    Source code(zip)
Owner
Zach
 @ Nike; Proud member of oneleif; I 🧡 Swift; Husband; Supporter for all; Opinions are my own
Zach
⏳ Collection of Swift 5.5 async/await utility functions.

⏳ FunAsync Collection of Swift 5.5 async/await utility functions. Throw <-> Result conversion asyncThrowsToAsyncResult asyncResultToAsyncThrows More C

Yasuhiro Inami 23 Oct 14, 2022
GroupWork is an easy to use Swift framework that helps you orchestrate your concurrent, asynchronous functions in a clean and organized way

GroupWork is an easy to use Swift framework that helps you orchestrate your concurrent, asynchronous functions in a clean and organized way. This help

Quan Vo 42 Oct 5, 2022
Hydra ⚡️ Lightweight full-featured Promises, Async & Await Library in Swift

Lightweight full-featured Promises, Async & Await Library in Swift What's this? Hydra is full-featured lightweight library which allows you to write b

Daniele Margutti 2k Dec 24, 2022
🎭 Swift async/await & Actor-powered effectful state-management framework.

?? Actomaton ??‍?? Actor + ?? Automaton = ?? Actomaton Actomaton is Swift async/await & Actor-powered effectful state-management framework inspired by

Yasuhiro Inami 199 Dec 20, 2022
⚡️ Fast async task based Swift framework with focus on type safety, concurrency and multi threading

Our apps constantly do work. The faster you react to user input and produce an output, the more likely is that the user will continue to use your appl

Said Sikira 814 Oct 30, 2022
A lightweight swift network layer with Combine, Async-Await, and a traditional completion block.

CombineNetwork A simple light-weight network library to make network requesting simpler. It supports newer techonology such as async/await as well as

Dushant Singh 4 Jan 3, 2022
Async and concurrent versions of Swift’s forEach, map, flatMap, and compactMap APIs.

CollectionConcurrencyKit Welcome to CollectionConcurrencyKit, a lightweight Swift package that adds asynchronous and concurrent versions of the standa

John Sundell 684 Jan 9, 2023
A simple network layer for use in small iOS projects with async/await support

SimpleNetwork Intro SimpleNetwork is simple network layer for use in small projects. Swift Package Manager Note: Instructions below are for using Swif

Alexandre Garrefa 1 Nov 30, 2021
Example project showing how to use async/await with iOS 13

ios13AsyncAwait Example project showing how to use async/await with iOS 13 Article This source code is a part of an article published at This Dev Brai

Michał Tynior 7 Oct 2, 2022
Using async / await on iOS 13: everything you need to know

Using async / await on iOS 13: everything you need to know! ?? Content This repository contains the code sample I've used during December 14th's lives

Vincent Pradeilles 11 Feb 1, 2022