Latest 0.1.0
Homepage https://github.com/onmyway133/Performer
License MIT
Platforms ios 8.0, requires ARC
Authors

Interacting with GCD

[![CI Status](http://img.shields.io/travis/Khoa Pham/Performer.svg?style=flat)](https://travis-ci.org/Khoa Pham/Performer)
Version
License
Platform

Usage

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

Features

Data types

Enum conforms to RawRepresentable

  • Queue: dispatch_queue_t
  • Priority: dispatch_queue_priority_t
  • Attribute: dispatch_queue_attr_t
  • QualityOfService: RawRepresentable
  • BlockFlag: dispatch_block_flags_t

Provided queue

Queue.main
Queue.background

Easy to create queue

let queue = Queue(name: "queue", attribute: Attribute.Serial, qualityOfService: QualityOfService.UserInteractive)

Dispatch

sync {
    print("action goes inside main queue using dispatch_sync")
}

async(Queue.background) {
    print("action goes inside background queue using dispatch_async")
}

after(5) {
    print("action goes inside main queue after 5 seconds using dispatch_after")
}

Chain

Every action is a Task, which can be chained. A Task is like a Pull Signal

let task = on {
    print("action on main queue")
}

task.run()
let background = Queue(name: "background", attribute: Attribute.Serial, qualityOfService: QualityOfService.Background)

on(background) {
    print("on background")
}
.delay(1) {
    print("after delay")
}.on(Queue.main) {
    print("on main")
}.run()

Notes

  • All functions, including after and delay defaults to main queue if no queue is provided !!
  • To use chain, use on and delay

Installation

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

pod "Performer"

Credit

Credit goes to

Author

Khoa Pham, [email protected]

License

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

Latest podspec

{
    "name": "Performer",
    "version": "0.1.0",
    "summary": "Interacting with GCD",
    "homepage": "https://github.com/onmyway133/Performer",
    "license": "MIT",
    "authors": {
        "Khoa Pham": "[email protected]"
    },
    "source": {
        "git": "https://github.com/onmyway133/Performer.git",
        "tag": "0.1.0"
    },
    "social_media_url": "https://twitter.com/onmyway133",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "Performer": [
            "Pod/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This