Skip to content

happn-app/RunLoopThread

Repository files navigation

RunLoopThread

A thread that has a running RunLoop.

Usage

let thread = RunLoopThread(name: "MyRunLoopThread")
thread.start()
thread.async{
   /* This job requires (and has) a configured RunLoop. */
}
/* When the job is done, call thread.cancel() to stop the thread.
 * The cancel method can be called from within a sync or async execution block,
 * or from elsewhere. */

/* You can see the tests of the project for funnier use cases (mostly starting
 * the thread _after_ dispatching async job on it). */

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages