TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Nov 2017 |
SwiftSwift Version | 4.0 |
SPMSupports SPM | ✗ |
Maintained by Gerrel Krishan.
Throttle mechanism for DispatchQueue. Only the last dispatched code-block will be executed when delay has passed.
DispatchThrottle is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod 'DispatchThrottle'
Run the following terminal command in the root of the project
$ jazzy
let throttle = DispatchThrottle(time: DispatchTimeInterval.milliseconds(100))
let throttle = DispatchThrottle(time: DispatchTimeInterval.milliseconds(100))
// ...
internal func save() {
DispatchQueue.global(qos: .background).async(throttle: throttle) {
// Write file to disk
}
}
DispatchThrottle is available under the MIT license. See the LICENSE file for more info.