Latest 1.0.0
Homepage https://github.com/jvk75/ParallelSwift
License MIT
Platforms ios 9.0
Authors

Wrapper to simplify parallel execution of methods. With three different excution modes.
Plus optional timeout to prevent locking app, and possibility to shuffle queue order.
Made purely in Swift. See Test folder for usege examples.

Install

UIImageCropper is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'ParallelSwift'

(or add ParallelSwift folder to your project)

Modes

All

Execution closure is executed after all phase closures are finnished.

all

Any

Execution closure is executed after first phase closure is finnished.

any

None

Execution closure is executed immediately after phases are started.

none

Usage

Add methods to be executed as closure with addPhases
Once excute is called all phases are launch simultaneusly (in parallel).

Methods will mark themself finnished a by calling done .

Execution completion closure is always executed in main thread. See modes.

    let p = ParallelSwift()

    p.addPhase { done in
       print("1")
       done()
    }
    p.addPhase { done in
       print("2")
       done()
    }
    p.addPhase { done in
        print("3")
        done()
    }
    p.execute(.all) {
        print("all done")
    }

Parameters

timeout : Time in seconds after which execute completion is called even if phases are still running. Default: 0 (no timeout)

shufflePhases: If true the order which phases are put to operation queue is randomized. Default: false

Issues and contribution

If you find any issues please open an issue to this repository.

Improvements and/or fixes as pull requests are more than welcome.

Author

Jari Kalinainen, jari(a)klubitii.com

License

ParallelSwift is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ParallelSwift",
    "version": "1.0.0",
    "summary": "Execute multiple methods in parallel with simple API.",
    "description": "Wrapper to simplify parallel execution of methods. With three different excution modes. Plus optional timeout to prevent locking app, and possibility to shuffle queue order.nMade purely in Swift. See Test folder for usege examples.",
    "homepage": "https://github.com/jvk75/ParallelSwift",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Jari Kalinainen": "[email protected]"
    },
    "source": {
        "git": "https://github.com/jvk75/ParallelSwift.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "swift_version": "4.0",
    "source_files": "ParallelSwift/*"
}

Pin It on Pinterest

Share This