Repeat - Modern Timer in Swift, Debouncer and Throttler (alternative to NSTimer)

  •        20

Repeat is small lightweight alternative to NSTimer with a modern Swift Syntax, no strong references, multiple observers reusable instances. Repeat is based upon GCD - Grand Central Dispatch. It also support debouncer and throttler features. If you want to learn more about it check out my article on Medium: "The secret world of NSTimer".

https://github.com/malcommac/Repeat

Tags
Implementation
License
Platform

   




Related Projects

Queuer - Queuer is a queue manager, built on top of OperationQueue and Dispatch (aka GCD).

  •    Swift

Queuer is a queue manager, built on top of OperationQueue and Dispatch (aka GCD). It allows you to create any synchronous and asynchronous task easily, with just a few lines. * Currently, URLSession.shared property is not yet implemented on Linux.

gcdobjc - Objective-C wrapper for Grand Central Dispatch

  •    Objective-C

A Swift port is at GCDSwift. GCDObjC.h is the only header file that needs to be imported.

MSWeakTimer - Thread-safe NSTimer alternative that doesn't retain the target and supports being used with GCD queues

  •    Objective-C

Thread-safe NSTimer drop-in alternative that doesn't retain the target and supports being used with GCD queues. The first motivation for this class was to have a type of timer that objects could own and retain, without this creating a retain cycle ( like NSTimer causes, since it retains its target ). This way you can just release the timer in the -dealloc method of the object class that owns the timer.

Zewo - Lightweight library for web server applications in Swift on macOS and Linux powered by coroutines

  •    Swift

Zewo is a lightweight library for web applications in Swift.Zewo is not a web framework. Zewo is a lightweight library for web applications in Swift. Most server-side Swift projects use Grand Central Dispatch (GCD) as the concurrency library of choice. The drawback of using GCD is that its APIs are asynchronous. With async code comes callback hell and we all know it, it's no fun.

libdispatch - Linux port of Apple's open-source concurrency library

  •    C

pthreads getting you down? libdispatch, aka Grand Central Dispatch (GCD) is Apple's high-performance event-handling library, introduced in OS X Snow Leopard. It provides asynchronous task queues, monitoring of file descriptor read and write-ability, asynchronous I/O (for sockets and regular files), readers-writer locks, parallel for-loops, sane signal handling, periodic timers, semaphores and more. You'll want to read over Apple's API reference. I've added the ability to integrate libdispatch's main queue with third-party run-loops, e.g. GLib's GMainLoop. Call dispatch_get_main_queue_handle_np() to get a file descriptor your run-loop can monitor for reading; when it becomes readable call dispatch_main_queue_drain_np() to execute the pending tasks.


swift-corelibs-libdispatch - The libdispatch Project, (a

  •    C

Grand Central Dispatch (GCD or libdispatch) provides comprehensive support for concurrent code execution on multicore hardware. libdispatch is currently available on all Darwin platforms. This project aims to make a modern version of libdispatch available on all other Swift platforms. To do this, we will implement as much of the portable subset of the API as possible, using the existing open source C implementation.

Async - Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch

  •    Swift

Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch

Chronos-Swift - :hourglass: Grand Central Dispatch Utilities

  •    Swift

Chronos is a collection of useful Grand Central Dispatch utilities. If you have any specific requests or ideas for new utilities, don't hesitate to create a new issue. Chronos is available under the MIT License.

GCDKit - Grand Central Dispatch simplified with swift.

  •    Swift

GCDKit is Grand Central Dispatch simplified with Swift. GCDKit implements the following constructs. To see how they work, jump right to the Common Usage Patterns section below.

NSTimer-Blocks - Simple category on NSTimer to give it blocks capability.

  •    Objective-C

Extremely simple category on NSTimer which makes it able to use blocks. I figure if you're using a block, you probably won't need to pass any userinfo object into the timer... you can get to whatever you need just from the block. So, I just hijack the +scheduledTimerWithTimeInterval:target:selector:userInfo:repeats: class method and it's brother -init..., setting it to use itself as the target, and to execute the class method +jdExecuteSimpleBlock: (which is part of the category) then pass the block you specify as the userInfo object which is then uses in the execute method. Pretty straightforward stuff.

SwiftyTimer - Swifty API for NSTimer

  •    Swift

Read Swifty APIs: NSTimer for more information about this project.

GCDExample

  •    Objective-C

An example application that shows you how to use Grand Central Dispatch for loading table views on iOS.

electron-remote - Execute JavaScript in remote Electron processes, but more betterer

  •    Javascript

electron-remote provides an alternative to Electron's remote module based around Promises instead of synchronous execution. It also provides an automatic way to use BrowserWindows as "background processes" that auto-scales based on usage, similar to Grand Central Dispatch or the .NET TPL Taskpool. Remote is super convenient! But it also has some downsides - its main downside is that its action is synchronous. This means that both the main and window processes will wait for a method to finish running. Even for quick methods, calling it too often can introduce scroll jank and generally cause performance problems.

BlocksKit - The Objective-C block utilities you always wish you had.

  •    Objective-C

Blocks in C and Objective-C are downright magical. They make coding easier and potentially quicker, not to mention faster on the front end with multithreading and Grand Central Dispatch. BlocksKit hopes to facilitate this kind of programming by removing some of the annoying - and, in some cases, impeding - limits on coding with blocks. BlocksKit is a framework for OS X Mountain Lion and newer, a static library for iOS 6 and iOS 7, and a framework for iOS 8 and newer.

Grand Prix Race Timer

  •    

GPRT is a the code for building a race timer for use with Grand Prix or Pinewood Derby. For full project detail please go to http://jarrodsinclair.wordpress.com

angular-validation - Angular Form Validation made simple

  •    Javascript

The base concept is not new, it comes from the easy form input validation approach of Laravel Framework as well as PHP Gump Validation. They are both PHP frameworks and use a very simple approach, so why not re-use the same concept over Angular as well? Well it's now made available with a few more extras. For a smoother user experience, I also added validation on inactivity (timer/debounce). So validation will not bother the user while he is still typing... though as soon as the user pauses for a certain amount of time, then validation comes into play. It's worth knowing that this inactivity timer is only available while typing, if user focuses away from his input (onBlur) it will then validate instantly.

SharePoint Timer Job Administration

  •    

The solution provides UI for managing SharePoint timer job schedule, disabling, adding or removing SharePoint timer jobs, updating persisted properties It also allows deploying a custom SharePoint timer job without writing an installer

Testimony

  •    Java

Offline indexing tool for the GCD (Grand Comic Book Database). No longer in active development.

Each - Elegant ⏱ interface for Swift apps

  •    Swift

Each is a NSTimer bridge library written in Swift. CocoaPods 1.1.0+ is required to build Each.

jquery-throttle-debounce - jQuery throttle / debounce: Sometimes, less is more!

  •    Javascript

jQuery throttle / debounce allows you to rate-limit your functions in multiple useful ways. Passing a delay and callback to $.throttle returns a new function that will execute no more than once every delay milliseconds. Passing a delay and callback to $.debounce returns a new function that will execute only once, coalescing multiple sequential calls into a single execution at either the very beginning or end. These working examples, complete with fully commented code, illustrate a few ways in which this plugin can be used.