Skip to content

Commit 78fa480

Browse files
committed
Added and updated README.md as well as added 2-4 more methods, added a definition and function for all methods.
Fixed README.md Fixed README.md (again)
1 parent 883e347 commit 78fa480

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
An API that allows you to execute, parallelize, and async code dynamically, and simply.
33

44
> [!NOTE]
5-
> > This is not a shaded project. If you plan on using it then you will
6-
> > **Have** to have the dependency downloaded.
5+
> > This is not a shaded project.
76
87
> [!WARNING]
9-
> > This project is very early in development. Beware that the API will
8+
> > This project is very early in development. Beware that the API **WILL**
109
> > change, although functionality will still be extremely performant and well > verse.
1110
1211
> [!NOTE]
@@ -57,7 +56,7 @@ public final MyPlugin extends JavaPlugin {
5756
```
5857
## Features & Methods
5958
While there are sparse features, there is a large sum of methods you can use to suit your needs.
60-
> [!FEATURES]
59+
> ## Features
6160
> - The ability to run code parallel.
6261
> - The ability to run code async.
6362
> - The ability to run code async, later joining it into the parent thread.
@@ -67,8 +66,8 @@ While there are sparse features, there is a large sum of methods you can use to
6766
> [!NOTE]
6867
> This is Extremely important to know,
6968
> There are **TWO** types of AsyncTask's
70-
> * Runnables
71-
> * Returnables
69+
> * **Runnables**
70+
> * **Returnables**
7271
>
7372
> Runnables have a `AsyncTask<Void>` type
7473
> Returnables have a `AsyncTask<?>` where `?` is **NOT** `Void`
@@ -118,8 +117,16 @@ While there are sparse features, there is a large sum of methods you can use to
118117
> ### Behavior & Hooking Tasks
119118
>
120119
> While examples and explanations will be provided further down, we will provide clarifications here.
121-
> Firstly, **Runnables** and **Returnables** can be converted between each other fluidly through **.after()**
122-
> Secondly, `.after()` should not be used as a substitution for `.onComplete()` or other events tied to threads. See more about events after this section.
120+
> 1. Firstly, **Runnables** and **Returnables** can be converted between each other fluidly through `**.after()**`
121+
> 2. Secondly, `.after()` should not be used as a substitution for `.onComplete()` or other events tied to threads. See more about events after this section.
122+
> ```java
123+
> void main() {
124+
> AsyncTask<Integer> runnableToReturnable =
125+
> AsyncTask.of(() -> System.out.println("I Executed!")) // only a runnable
126+
> .after(() -> 15) // it's now a returnable of type "Integer"
127+
> .start(); // start thread to execute, will print "I Executed" and nothing else.
128+
> }
129+
> ```
123130
>
124131
> ### Events
125132
>

0 commit comments

Comments
 (0)