From ed87ffcd3ed95d7217370e8eca39d7f365ef55dd Mon Sep 17 00:00:00 2001 From: Loganathan Sekaran Date: Fri, 15 Jun 2018 17:31:49 +0530 Subject: [PATCH] Updating readme for 4.0.0 release --- README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index e6701b7..9a23657 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,11 @@ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/loganathan001/AsyncHelper/issues) -Async-Helper is a Java utility to invoke/schedule tasks or fetch data asynchronously using tags/flags in a functional way. This internally utilizes ForkJoin pool to submit the tasks. +Async-Helper is a Java utility (also an OSGi bundle) to invoke/schedule tasks or fetch data asynchronously using tags/flags in a functional way. This internally utilizes ForkJoin pool to submit the tasks. -This contains various helper classes such as [Async](https://github.com/loganathan001/AsyncHelper/blob/master/Project/asynchelper/src/main/java/org/vishag/async/Async.java), [AsyncTask](https://github.com/loganathan001/AsyncHelper/blob/master/Project/asynchelper/src/main/java/org/vishag/async/AsyncTask.java), [AsyncSupplier](https://github.com/loganathan001/AsyncHelper/blob/master/Project/asynchelper/src/main/java/org/vishag/async/AsyncSupplier.java), [SchedulingTask](https://github.com/loganathan001/AsyncHelper/blob/master/Project/asynchelper/src/main/java/org/vishag/async/SchedulingTask.java) and [SchedulingSupplier](https://github.com/loganathan001/AsyncHelper/blob/master/Project/asynchelper/src/main/java/org/vishag/async/SchedulingSupplier.java) to perform various asynchronous operations. +This contains various helper classes such as [AsyncContext](https://github.com/loganathan001/AsyncHelper/blob/master/Project/asynchelper/src/main/java/org/vishag/async/AsyncContext.java), [AsyncTask](https://github.com/loganathan001/AsyncHelper/blob/master/Project/asynchelper/src/main/java/org/vishag/async/AsyncTask.java), [AsyncSupplier](https://github.com/loganathan001/AsyncHelper/blob/master/Project/asynchelper/src/main/java/org/vishag/async/AsyncSupplier.java), [SchedulingTask](https://github.com/loganathan001/AsyncHelper/blob/master/Project/asynchelper/src/main/java/org/vishag/async/SchedulingTask.java) and [SchedulingSupplier](https://github.com/loganathan001/AsyncHelper/blob/master/Project/asynchelper/src/main/java/org/vishag/async/SchedulingSupplier.java) to perform various asynchronous operations. -Please refer to the [JavaDocs](http://www.javadoc.io/doc/org.vishag/async-helper/3.0.1) also.   +Please refer to the [JavaDocs](http://www.javadoc.io/doc/org.vishag/async-helper/4.0.0) also.   ### Below are the some of the operations that can be perfomed using this utility: 1. Submitting one or more Runnable(s) to run asynchronously. @@ -31,7 +31,7 @@ Also refer to the getMethodParam1(arg1, arg2), () -> getMethodParam2(arg2, arg3) () -> getMethodParam3(arg3, arg4), @@ -54,7 +54,7 @@ Also if it is desired to obtain a return value from each of the asynchronous met ``` Supplier[] resultSuppliers = - AsyncSupplier.submitSuppliers( + AsyncSupplier.getDefault().submitSuppliers( () -> getMethodParam1(arg1, arg2), () -> getMethodParam2(arg3, arg4), () -> getMethodParam3(arg5, arg6) @@ -74,9 +74,9 @@ myBigMethod(a,b,c); If the return type of each method differ, use the below kind of snippet. ``` -Supplier aResultSupplier = AsyncSupplier.submitSupplier(() -> getMethodParam1(arg1, arg2)); -Supplier bResultSupplier = AsyncSupplier.submitSupplier(() -> getMethodParam2(arg3, arg4)); -Supplier cResultSupplier = AsyncSupplier.submitSupplier(() -> getMethodParam3(arg5, arg6)); +Supplier aResultSupplier = AsyncSupplier.getDefault().submitSupplier(() -> getMethodParam1(arg1, arg2)); +Supplier bResultSupplier = AsyncSupplier.getDefault().submitSupplier(() -> getMethodParam2(arg3, arg4)); +Supplier cResultSupplier = AsyncSupplier.getDefault().submitSupplier(() -> getMethodParam3(arg5, arg6)); myBigMethod(aResultSupplier.get(), bResultSupplier.get(), cResultSupplier.get()); ``` @@ -84,15 +84,15 @@ myBigMethod(aResultSupplier.get(), bResultSupplier.get(), cResultSupplier.get()) The result of the asynchronous method calls/code blocks can also be obtained at a different point of code in the same thread or a different thread as in the below snippet. ``` -AsyncSupplier.submitSupplierForSingleAccess(() -> getMethodParam1(arg1, arg2), "a"); -AsyncSupplier.submitSupplierForSingleAccess(() -> getMethodParam2(arg3, arg4), "b"); -AsyncSupplier.submitSupplierForSingleAccess(() -> getMethodParam3(arg5, arg6), "c"); +AsyncSupplier.getDefault().submitSupplierForSingleAccess(() -> getMethodParam1(arg1, arg2), "a"); +AsyncSupplier.getDefault().submitSupplierForSingleAccess(() -> getMethodParam2(arg3, arg4), "b"); +AsyncSupplier.getDefault().submitSupplierForSingleAccess(() -> getMethodParam3(arg5, arg6), "c"); //Following can be in the same thread or a different thread -Optional aResult = AsyncSupplier.waitAndGetFromSupplier(String.class, "a"); -Optional bResult = AsyncSupplier.waitAndGetFromSupplier(Integer.class, "b"); -Optional cResult = AsyncSupplier.waitAndGetFromSupplier(Object.class, "c"); +Optional aResult = AsyncSupplier.getDefault().waitAndGetFromSupplier(String.class, "a"); +Optional bResult = AsyncSupplier.getDefault().waitAndGetFromSupplier(Integer.class, "b"); +Optional cResult = AsyncSupplier.getDefault().waitAndGetFromSupplier(Object.class, "c"); myBigMethod(aResult.get(),bResult.get(),cResult.get()); ```