Skip to content

Thread pool-based automatic parallel execution for java.

License

Notifications You must be signed in to change notification settings

GustavBW/async4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

async4j

Thread pool-based automatic concurrent execution for java.
Introduces an entry point with static methods async() which can take any code, and functions, and distribute its execution on to a configurable thread pool.

NB: This is in beta. I've yet to impliment repeated and delayed concurrent execution.

How To Set This Up

  1. Open any of your java projects.
  2. Copy and paste this package into your SRC.
  3. Statically import the static async functions (or do it normally) from EntryPoint.java where you want to use it.
  4. Call EntryPoint.initialize() in your main method providing a pool size.

How To Use This

  1. Encapsulate any code in Entrypoint.async( {your code here} )
  2. Use Entrypoint.await(some concurrently running code) to have your main thread wait for the result and then return this.
  3. Use EnrichedRunnable.get(0) if you're sure enough its done computing (not recommended, can return null) Your encapsulated code will now automatically be distributed throughout the pool and executed as fast as possible.

Got Issues With Dependencies?

This package was developed using the Java.util.concurrency.ConcurrentBlockingQueue. Any implimentation of a concurrent blocking queue will do in its stead. Everything else requires the java standard library only.

About

Thread pool-based automatic parallel execution for java.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages