Latest 0.1.0
Homepage https://github.com/wacumov/Qwolm
License MIT
Platforms ios 9.3
Authors

Swift Version
Platform
Version
CI Status
codebeat badge

A simple utility for handling cases when:

  • new calls of a long-running task may arrive before it is completed;
  • only the result of the last call matters.

Usage

class SomeClass {

    // Define input and output types
    private var qwolm: Qwolm<Int, Int>!

    init() {
        // Initialize with a task and a completion handler
        qwolm = Qwolm(task: complexTask) { output in
            print(output)
        }
    }

    // This function gets called very often
    func execute(input: Int) {
        qwolm.execute(input: input)
    }

    // A difficult task that takes a long time
    private func complexTask(input: Int, completion: @escaping (Int) -> Void) {
        let output = input + 1
        completion(output)
    }

}

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

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

pod 'Qwolm'

Then run pod install.

Author

Mikhail Akopov, [email protected]

License

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

Latest podspec

{
    "name": "Qwolm",
    "version": "0.1.0",
    "summary": "Queue where only last matters.",
    "description": "A simple utility for handling cases when:n- new calls of a long-running task may arrive before it is completed;n- only the result of the last call matters.",
    "homepage": "https://github.com/wacumov/Qwolm",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Mikhail Akopov": "[email protected]"
    },
    "source": {
        "git": "https://github.com/wacumov/Qwolm.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "9.3"
    },
    "source_files": "Qwolm/Classes/**/*",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This