Skip to content

Commit 47d91e4

Browse files
authored
Merge pull request #714 from hansjorg/doc-changes
Small language changes
2 parents b86a573 + d10c3dc commit 47d91e4

48 files changed

Lines changed: 492 additions & 491 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

md/app.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public class MyModule implements Jooby.Module {
7070
}
7171
```
7272

73-
The `onStart` callbacks are part of bootstrap and executed before server is ready. The `onStarted` callbacks are executed when server is ready.
73+
The `onStart` callbacks are part of bootstrap and executed before the server is ready. The `onStarted` callbacks are executed when the server is ready.
7474

7575
Modules are covered later all you need to know now is that you can start/stop module as you usually do from your application.
7676

@@ -95,7 +95,7 @@ Callback order is preserved:
9595
}
9696
```
9797

98-
Order is useful for service dependencies, like `ServiceB` should be started after `ServiceA`.
98+
Order is useful for service dependencies, for example if `ServiceB` should be started after `ServiceA`.
9999

100100
### service registry
101101

@@ -117,7 +117,7 @@ You have access to the the service registry from start/stop events:
117117

118118
### PostConstruct/PreDestroy annotations
119119

120-
If you prefer the annotation way then:
120+
If you prefer annotations you can do:
121121

122122
```java
123123
@Singleton

md/asset-processor.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# asset processor
22

3-
Checks, validate and/or modify asset contents. An [AssetProcessor]({{defdocs}}/assets/AssetProcessor.html) is usually provided as a separated dependency.
3+
Checks, validates and/or modifies asset contents. An [AssetProcessor]({{defdocs}}/assets/AssetProcessor.html) is usually provided as a separate dependency.
44

5-
## how to use it?
5+
## usage
66

7-
First thing to do is to add the dependency:
7+
Start by adding the dependency to your ```pom.xml```:
88

99
```xml
1010
<dependency>
@@ -14,9 +14,10 @@ First thing to do is to add the dependency:
1414
</dependency>
1515
```
1616

17-
Did you see the **provided** scope? We just need the processor for development, because assets are processed at runtime. In ```prod```, assets are processed at built-time via Maven/Gradle plugin, so we don't need this library/dependency. This also, helps to keep our dependencies and the jar size small.
17+
Notice the **provided** scope. The processor is only required for development, since the assets are processed at runtime in this case. In ```prod```, assets are processed at build-time via the Maven or Gradle plugins, so the dependency is not needed there. This also helps to keep the number of dependencies and the jar size smaller.
18+
19+
After the dependency is declared, all that's needed is to add the processor to the pipeline:
1820

19-
Now we have the dependency all we have to do is to add it to our pipeline:
2021

2122
```text
2223
assets {
@@ -28,7 +29,7 @@ assets {
2829

2930
## configuration
3031

31-
It is possible to configure or set options too:
32+
It's possible to configure or set options as well:
3233

3334
```text
3435
assets {
@@ -42,7 +43,7 @@ assets {
4243
}
4344
```
4445

45-
Previous example, set a ```foo``` property to ```bar```! Options can be set per environment too:
46+
The previous example sets the ```foo``` property to ```bar```. Options can be set per environment as well:
4647

4748
```text
4849
assets {
@@ -62,11 +63,11 @@ assets {
6263
}
6364
```
6465

65-
Here, in ```dev``` processor has two properties: ```foo:foo``` and ```bar:bar```, while in ```dist``` the processor only has ```foo:bar```
66+
In this example, the processor will have two properties in the ```dev``` environment: ```foo:foo``` and ```bar:bar```, while in ```dist``` the processor will only have ```foo:bar```
6667

6768
## binding
6869

69-
The ```my-processor``` will be resolved it to: ```org.jooby.assets.MyProcessor``` class. The processor name is converted to ```MyProcessor```, it converts the hyphenated name to upper camel and by default processors are defined in the ```org.jooby.assets``` package.
70+
The ```my-processor``` token will be resolved to the: ```org.jooby.assets.MyProcessor``` class. The processor name is converted to ```MyProcessor``` by converting the hyphenated name to upper camel case and by placing it in the ```org.jooby.assets``` package (a default for processors).
7071

7172
A custom binding is provided via the ```class``` property:
7273

@@ -86,9 +87,9 @@ assets {
8687

8788
Contributes new or dynamically generated content to a ```fileset```. Content generated by an aggregator might be processed by an {@link AssetProcessor}.
8889

89-
## how to use it?
90+
## usage
9091

91-
First thing to do is to add the dependency:
92+
Start by adding the dependency to your ```pom.xml```:
9293

9394
```xml
9495
<dependency>
@@ -99,9 +100,9 @@ First thing to do is to add the dependency:
99100

100101
```
101102

102-
Did you see the **provided** scope? We just need the aggregator for development, because assets are processed at runtime. In ```prod```, assets are processed at built-time via Maven/Gradle plugin, so we don't need it. This also, helps to keep our dependencies and the jar size small.
103+
Notice the **provided** scope. The aggregator is only required for development, since the assets are processed at runtime in this case. In ```prod```, assets are processed at build-time via the Maven or Gradle plugins, so the dependency is not needed there. This also helps to keep the number of dependencies and the jar size smaller.
103104

104-
Now we have the dependency all we have to do is to add the ```svg-sprites``` aggregator to a fileset:
105+
After the dependency is declared, all that's needed is to add the ```svg-sprites``` aggregator to a fileset:
105106

106107
```
107108
assets {
@@ -124,7 +125,7 @@ assets {
124125
}
125126
```
126127

127-
Here for example, the ```svg-sprites``` aggregator contributes the ```css/sprite.css``` file to the ```home``` fileset. The fileset then looks like:
128+
In this example, the ```svg-sprites``` aggregator contributes the ```css/sprite.css``` file to the ```home``` fileset. The fileset then looks like:
128129

129130
```
130131
assets {
@@ -138,7 +139,7 @@ assets {
138139
}
139140
```
140141

141-
It replaces the aggregator name with one or more files from [AssetAggregator.fileset]({{defdocs}}/assets/AssetAggregator.html#fileset--) method.
142+
It replaces the aggregator name with one or more files from the [AssetAggregator.fileset]({{defdocs}}/assets/AssetAggregator.html#fileset--) method.
142143

143144
# available processors
144145

md/assets-require.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Make sure you already setup the [assets module](https://github.com/jooby-project/jooby/tree/master/jooby-assets) in your project!
1+
Make sure you've already set up the [assets module](https://github.com/jooby-project/jooby/tree/master/jooby-assets) in your project!

md/async.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# thread model
22

3-
You can see {{jooby}} as an `event loop server` thanks to the supported web servers: {{netty_server}}, {{jetty_server}} and {{undertow_server}}. Being {{netty_server}} the default web server.
3+
You can see {{jooby}} as an `event loop server` thanks to the supported web servers: {{netty_server}}, {{jetty_server}} and {{undertow_server}}. The default web server is {{netty_server}}.
44

55
{{jooby}} isn't a traditional `thread server` where a HTTP request is bound to a thread.
66

77
In {{jooby}} all the HTTP IO operations are performed in async & non blocking fashion. HTTP IO operations run in an IO thread (a.k.a event loop) while the application logic (your code) **always run in a worker thread**.
88

99
## worker threads
1010

11-
The **worker thread** pool is provided by the web server: {{netty_server}}, {{jetty_server}} and {{undertow_server}}. To simplify application programming you can **block a worker thread**, for example you can safely run a **jdbc** query in a **worker thread**:
11+
The **worker thread** pool is provided by one of the supported web servers: {{netty_server}}, {{jetty_server}} or {{undertow_server}}. To simplify application programming you can **block a worker thread**, for example you can safely run a **jdbc** query in a **worker thread**:
1212

1313
```java
1414
{
@@ -22,11 +22,11 @@ The **worker thread** pool is provided by the web server: {{netty_server}}, {{je
2222
}
2323
```
2424

25-
Here the web server can accept as many connection it can (as its on non blocking) while the worker thread might blocks.
25+
The web server can accept as many connections it can (as its on non blocking) while the worker thread might block.
2626

27-
Default worker thread pool is `20/100`. The correct/right size depends on your **business** and **work load** your application is suppose to handle. We suggest you to start with default setup and see how it goes, later you can reduce or increase the thread pool.
27+
The default worker thread pool is `20/100`. The optimal size depends on the **business** and **work load** your application is supposed to handle. It's recommended to start with the default setup and then tune the size of the thread pool if the need arises.
2828

29-
In {{jooby}} we favor simplicity over complexity that is why your **code** can block, still there are more advanced setup that allow you to build async and reactive applications.
29+
{{jooby}} favors simplicity over complexity hence allowing your **code** to block. However, it also provides you with more advanced options that will allow you to build async and reactive applications.
3030

3131
## deferred
3232

@@ -54,7 +54,7 @@ MVC API:
5454
}
5555
```
5656

57-
Previous examples are just `syntax sugar` for:
57+
The previous examples are just `syntactic sugar` for:
5858

5959
```
6060
return new Deferred(deferred -> {
@@ -66,7 +66,7 @@ Previous examples are just `syntax sugar` for:
6666
});
6767
```
6868

69-
There is more `syntax sugar` if you add the [AsyncMapper]({{defdocs}}/AsyncMapper.html) to your application:
69+
You can get more `syntactic sugar` if you add the [AsyncMapper]({{defdocs}}/AsyncMapper.html) to your application:
7070

7171
Script API:
7272

@@ -95,9 +95,9 @@ MVC API:
9595
}
9696
```
9797

98-
The [AsyncMapper]({{defdocs}}/AsyncMapper.html) convert `java.util.concurrent.Callable` and `java.util.concurrent.CompletableFuture` objects to {{deferred}} objects.
98+
The [AsyncMapper]({{defdocs}}/AsyncMapper.html) converts `java.util.concurrent.Callable` and `java.util.concurrent.CompletableFuture` objects to {{deferred}} objects.
9999

100-
Another important thing to notice is that the deferred run in the **caller thread** (i.e. worker thread), so by default there is **no context switch** involve while running a {{deferred}} result:
100+
Another important thing to notice is that the deferred will run in the **caller thread** (i.e. worker thread), so by default there is **no context switch** involved in obtaining a {{deferred}} result:
101101

102102
```java
103103
{
@@ -111,15 +111,15 @@ Another important thing to notice is that the deferred run in the **caller threa
111111
}
112112
```
113113

114-
You might first see this as a bad thing, but is actually a good decision, because:
114+
This might not seem optimal at first, but there are some benefits to this:
115115

116-
* It is super easy to setup a default executor (we will see how soon)
116+
* It makes it very easy to set up a default executor (this will be explained shortly)
117117

118-
* Provides better integration with async & reactive libraries. A `direct` executor avoid the need of switching to a new thread and then probably dispatch (again) to a different thread provided by a library.
118+
* It provides better integration with async & reactive libraries. A `direct` executor avoids the need of switching to a new thread and then probably dispatch (again) to a different thread provided by a library.
119119

120120
## executor
121121

122-
As we said before, the default executor run in the caller thread (a.k.a direct executor). Let's see how to override the default executor:
122+
As previously mentioned, the default executor runs in the caller thread (a.k.a direct executor). Let's see how to override the default executor:
123123
124124
```java
125125
{
@@ -131,7 +131,7 @@ As we said before, the default executor run in the caller thread (a.k.a direct e
131131
}
132132
```
133133
134-
Done! Now all our {{deferred}} result run in a `ForkJoinPool`. It also possible to specify an alternative executor:
134+
Done! Now all our {{deferred}} results run in a `ForkJoinPool`. It's also possible to specify an alternative executor:
135135

136136
Script API:
137137

@@ -175,7 +175,7 @@ import static org.jooby.Deferred.deferred;
175175
}
176176
```
177177

178-
Worth mention the [executor(ExecutorService)]({{defdocs}}/Jooby.html#executor-java.util.concurrent.ExecutorService-) methods automatically `shutdown` at application shutdown time.
178+
It's worth mentioning that the [executor(ExecutorService)]({{defdocs}}/Jooby.html#executor-java.util.concurrent.ExecutorService-) methods automatically `shutdown` at application shutdown time.
179179
180180
## promise
181181
@@ -216,17 +216,17 @@ MVC API:
216216
}
217217
```
218218
219-
The **"promise"** version of {{deferred}} object is a key concept for integrating with external libraries.
219+
The **"promise"** version of the {{deferred}} object is a key concept for integrating with external libraries.
220220
221221
## advanced configuration
222222
223-
Suppose you want to build a truly async application and after a **deep analysis** of your business you realize your application need to:
223+
Suppose you want to build a truly async application and after a **deep analysis** of your business demands you realize your application needs to:
224224
225225
* Access a database
226226
* Call a remote service
227227
* Make a CPU intensive computation
228228
229-
These are the 3 points where your application is suppose to block and wait for a result.
229+
These are the 3 points where your application is supposed to block and wait for a result.
230230
231231
Let's start by reducing the **worker thread pool** to the number of **available processors**:
232232

@@ -235,7 +235,7 @@ server.threads.Min = ${runtime.processors}
235235
server.threads.Max = ${runtime.processors}
236236
```
237237

238-
With this change, you need to be careful and **don't run blocking code** on routes anymore. Otherwise performance will be affected.
238+
With this change, you need to be careful to **avoid any blocking code** on routes, otherwise performance will suffer.
239239

240240
Let's create a custom thread pool for each blocking access:
241241
@@ -247,11 +247,11 @@ Let's create a custom thread pool for each blocking access:
247247
}
248248
```
249249
250-
For `database` access, we use a `cached` executor that will grow without a limit but free and release thread that are idle after `60s`.
250+
For `database` access, we use a `cached` executor which will grow without a limit but free and release threads that are idle after `60s`.
251251
252-
For `remote` service, we use a `fixed` executor of `32` thread. The number here: `32` is just a random number for the purpose of the example.
252+
For `remote` service, we use a `fixed` executor of `32` threads. The number `32` is just a random number for the purpose of the example.
253253
254-
For `intensive` computation, we use a `single` thread executor. Computation is too expensive and we want **one and only one** running at any time.
254+
For `intensive` computations, we use a `single` thread executor. Computation is too expensive and we want **one and only one** running at any time.
255255
256256
```java
257257
{
@@ -277,7 +277,7 @@ For `intensive` computation, we use a `single` thread executor. Computation is t
277277
}
278278
```
279279
280-
Here is the same example with [rx java](https://github.com/ReactiveX/RxJava):
280+
Here's the same example with [rx java](https://github.com/ReactiveX/RxJava):
281281
282282
```java
283283
{
@@ -314,14 +314,14 @@ Here is the same example with [rx java](https://github.com/ReactiveX/RxJava):
314314
}
315315
```
316316
317-
Main difference are:
317+
The main differences are:
318318
319-
* we keep the default executor: `direct`. So we don't create a new thread and avoid context switching.
320-
* we use {{deferred}} object as `promise` and integrate with [rx java](https://github.com/ReactiveX/RxJava).
321-
* different thread pool semantic is done via [rx schedulers](http://reactivex.io/documentation/scheduler.html).
319+
* the default executor is kept `direct`. No new thread is created and context switching is avoided.
320+
* the {{deferred}} object is used as a `promise` and integrate with [rx java](https://github.com/ReactiveX/RxJava).
321+
* different thread pool semantics is achieved with the help of [rx schedulers](http://reactivex.io/documentation/scheduler.html).
322322
323-
This is just one more example to demonstrate the value of the {{deferred}} object, because we provide an [rxjava](/doc/rxjava) module which takes care of binding {{deferred}} object into `Observables`.
323+
This is just another example to demonstrate the value of the {{deferred}} object, since a [rxjava](/doc/rxjava) module is provided which takes care of binding the {{deferred}} object into `Observables`.
324324
325-
That's all about {{deferred}} object, it allows you to build async and reactive applications and at the same time: **keep it simple** (Jooby design goal).
325+
That sums up everything about the {{deferred}} object. It allows you to build async and reactive applications and at the same time: **keep it simple** (a Jooby design goal).
326326
327-
Also, we invite you to checkout the available [async/reactive modules](/doc/async).
327+
You're also invited to check out the available [async/reactive modules](/doc/async).

md/available-modules.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
* [gson](https://github.com/jooby-project/jooby/tree/master/jooby-gson): JSON supports via Gson.
1010

1111
## template engines
12-
* [handlebars/mustache](https://github.com/jooby-project/jooby/tree/master/jooby-hbs): logic less and semantic Mustache templates.
12+
* [handlebars/mustache](https://github.com/jooby-project/jooby/tree/master/jooby-hbs): logic-less and semantic Mustache templates.
1313
* [freemarker](https://github.com/jooby-project/jooby/tree/master/jooby-ftl): render templates with FreeMarker.
1414

1515
## session
16-
* [redis](https://github.com/jooby-project/jooby/tree/master/jooby-jedis/#redis-session-store): HTTP session on {{redis}}.
17-
* [memcached](https://github.com/jooby-project/jooby/tree/master/jooby-spymemcached/#session-store): HTTP session on {{memcached}}.
18-
* [mongodb](https://github.com/jooby-project/jooby/tree/master/jooby-mongodb/#mongodb-session-store): HTTP session on {{mongodb}}.
19-
* [hazelcast](https://github.com/jooby-project/jooby/tree/master/jooby-hazelcast/#session-store): HTTP session on {{hazelcast}}.
20-
* [ehcache](https://github.com/jooby-project/jooby/tree/master/jooby-ehcache/#session-store): HTTP session on {{ehcache}}.
16+
* [redis](https://github.com/jooby-project/jooby/tree/master/jooby-jedis/#redis-session-store): HTTP session store for {{redis}}.
17+
* [memcached](https://github.com/jooby-project/jooby/tree/master/jooby-spymemcached/#session-store): HTTP session store for {{memcached}}.
18+
* [mongodb](https://github.com/jooby-project/jooby/tree/master/jooby-mongodb/#mongodb-session-store): HTTP session store for {{mongodb}}.
19+
* [hazelcast](https://github.com/jooby-project/jooby/tree/master/jooby-hazelcast/#session-store): HTTP session store for {{hazelcast}}.
20+
* [ehcache](https://github.com/jooby-project/jooby/tree/master/jooby-ehcache/#session-store): HTTP session store for {{ehcache}}.
2121

2222
## sql
2323
* [jdbc](https://github.com/jooby-project/jooby/tree/master/jooby-jdbc): high performance connection pool for jdbc via {{hikari}}.

md/capsule.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The ```capsule``` Maven profile is activated by the presence of the ```src/etc/c
2424

2525
## options
2626

27-
Integration provides some defaults, which are listed here:
27+
The integration provides the following defaults:
2828

2929
```xml
3030
<properties>

0 commit comments

Comments
 (0)