Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Dispatch queues (akin to Grand Central Dispatch), Promises and Cocoa Operations implemented in Java

License

Notifications You must be signed in to change notification settings

reTXT/concurrency-java

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advanced Java Concurrency Primitives

Build Status codecov.io

Dispatch Queues

Features

  • Functionally equivalent interface to GCD
  • Global Dispatch Queues (High, Medium, Low, Main & UI)
  • Concurrent Dispatch Queues
  • Serial Dispatch Queues
  • Dispatch Queue Groups
  • Dispatch Barriers
  • Android Support (currently requires retrolambda)

Implementation

All dispatch queues are implemented in 100% pure java using the standard Java 7 concurrency primitives. Global & Concurrent dispatch queues are implemented using a common priority based thread pool. Serial dispatch queues are implemented on top of an existing dispatch queue.

Availability

Maven (snapshots in oss.jfrog.org & oss.sonatype.org)

  <dependency>
      <groupId>io.retxt.concurrency</groupId>
      <artifactId>dispatch</artifactId>
      <version>${version}</version>
  </dependency>
  <!-- Optional Android support -->
  <dependency>
      <groupId>io.retxt.concurrency</groupId>
      <artifactId>dispatch-android</artifactId>
      <version>${version}</version>
  </dependency>

Gradle

io.retxt.concurrency:dispatch:${version}
// Optional Android support
io.retxt.concurrency:dispatch-android:${version}

Promises

Features

  • Similar interface and implementation to PromiseKit
  • Defaults to executing on main queue but easily redirectable to a specific or background queue

Implementation

Promises are implemented via the dispatch queues and they are 100% pure Java and provide tight integration with Operations as well.

Availability

Maven (snapshots in oss.jfrog.org & oss.sonatype.org)

  <dependency>
      <groupId>io.retxt.concurrency</groupId>
      <artifactId>promise</artifactId>
      <version>${version}</version>
  </dependency>

Gradle

io.retxt.concurrency:promise:${version}

Operations & Operation Queues

Features

  • General Operations
  • Advanced Operations
    • Very similar to those described in WWDC 2015 - Session #226
    • Conditions - Required to bet met before operation can be executed
      • Examples
        • Mutual Exclusion - Ensure only one instance of operations with this condition can execute simulataneously
        • No Cancelled Dependencies - Ensure operation executes only if no dependencies were cancelled
        • Delay - Delay start of operation for a specific time period
      • Easy creation of new conditions such as network reachability or UI modal exclusion
    • Finish & cancel with errors

Implementation

All Operations and AdvancedOperations are implemented via the dispatch queues and therefore are 100% pure Java and provide tight integration with Promises as well.

Availability

Maven (snapshots in oss.jfrog.org & oss.sonatype.org)

  <dependency>
      <groupId>io.retxt.concurrency</groupId>
      <artifactId>operations</artifactId>
      <version>${version}</version>
  </dependency>

Gradle

io.retxt.concurrency:operations:${version}

About

Dispatch queues (akin to Grand Central Dispatch), Promises and Cocoa Operations implemented in Java

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.