Skip to content

Commit 6627cc8

Browse files
committed
Small language changes
1 parent 32cb5a7 commit 6627cc8

6 files changed

Lines changed: 75 additions & 73 deletions

File tree

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/async.md

Lines changed: 20 additions & 20 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 suppose to handle. We suggest you to start with the default setup and see how it goes, later you can reduce or increase the thread pool.
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+
In {{jooby}} we favor simplicity over complexity that is why your **code** can block, still there are more advanced options that 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 run in the **caller thread** (i.e. worker thread), so by default there is **no context switch** involved while running 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+
You might see this as a bad thing at first, but it's actually a good decision, because:
115115
116116
* It is super easy to setup a default executor (we will see how soon)
117117
118118
* 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.
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,7 +216,7 @@ 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

@@ -226,7 +226,7 @@ Suppose you want to build a truly async application and after a **deep analysis*
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
@@ -247,9 +247,9 @@ 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 that 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 here: `32` is just a random number for the purpose of the example.
253253
254254
For `intensive` computation, we use a `single` thread executor. Computation is too expensive and we want **one and only one** running at any time.
255255
@@ -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
319319
* we keep the default executor: `direct`. So we don't create a new thread and avoid context switching.
320320
* we use {{deferred}} object as `promise` and integrate with [rx java](https://github.com/ReactiveX/RxJava).
321321
* different thread pool semantic is done via [rx schedulers](http://reactivex.io/documentation/scheduler.html).
322322

323323
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`.
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/conf.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# conf, env and logging
22

3-
Jooby delegates configuration management to [Config library](https://github.com/typesafehub/config).
3+
Jooby delegates configuration management to the [Config library](https://github.com/typesafehub/config).
44

5-
By defaults Jooby expects to find an ```application.conf``` file at the root of classpath. You can find the `.conf` file under `conf` classpath directory.
5+
By defaults Jooby expects to find an ```application.conf``` file at the root of classpath. You can find the `.conf` file under the `conf` classpath directory.
66

77
## getting properties
88

@@ -59,7 +59,7 @@ Automatic type conversion is provided when a type:
5959

6060
6) Has a static method **forName** that accepts a single **String** argument. Like ```java.nio.charset.Charset```
6161

62-
You're free to inject the entirely ```com.typesafe.config.Config``` object or `sub-path/tree` of it.
62+
You're free to inject the entire ```com.typesafe.config.Config``` object or `sub-path/tree` of it.
6363

6464
## environment
6565

@@ -69,7 +69,7 @@ This special property is represented at runtime with the [Env]({{apidocs}}/org/j
6969

7070
For example: a module might decided to create a connection pool, cache, etc when ```application.env``` isn't set to `dev`.
7171

72-
The `application.env` property can be set as command line argument too:
72+
The `application.env` property can be set as command line argument as well:
7373

7474
Using a `fat jar`:
7575

@@ -80,9 +80,9 @@ Using [stork](/doc/stork):
8080

8181
bin/myapp --start prod
8282

83-
## turn on/off features
83+
## turning features on or off
8484

85-
As described before the ```application.env``` property defines the environment where the application is being executed. It is possible to turn on/off specific features base on the application environment:
85+
As described before, the ```application.env``` property defines the environment where the application is being executed. It's possible to turn on/off specific features based on the application environment:
8686

8787
```java
8888
{
@@ -108,7 +108,7 @@ There is a `~` (complement) operator:
108108
}
109109
```
110110

111-
The ```environment callback``` has access to ```config``` object, see:
111+
The ```environment callback``` has access to the ```config``` object, see:
112112

113113
```java
114114
{
@@ -141,7 +141,7 @@ Here is the list of special properties available in Jooby:
141141

142142
## precedence
143143

144-
Configuration files are loaded in the following order (first-listed are higher priority)
144+
Configuration files are loaded in the following order:
145145

146146
* system properties
147147
* arguments properties
@@ -150,6 +150,8 @@ Configuration files are loaded in the following order (first-listed are higher p
150150
* ([application].[conf])?
151151
* [module].[conf]*
152152

153+
The first occurence of a property will take precedence.
154+
153155
### system properties
154156

155157
System properties can override any other property. A system property is set at startup time, like:
@@ -188,7 +190,7 @@ The default `classpath conf` file: `application.conf`
188190

189191
### [module].[conf]
190192

191-
A [Module]({{defdocs}}/Jooby.Module.html) might have define his own set of (default) properties via [Module.config]({{defdocs}}/Jooby.Module.html#config--) method.
193+
A [Module]({{defdocs}}/Jooby.Module.html) might have defined its own set of (default) properties via the [Module.config]({{defdocs}}/Jooby.Module.html#config--) method.
192194

193195
```java
194196
{
@@ -198,7 +200,7 @@ A [Module]({{defdocs}}/Jooby.Module.html) might have define his own set of (defa
198200

199201
### custom .conf
200202

201-
As we said before, the default `conf` file is `application.conf`, but you can use any other name you want:
203+
As mentioned earlier, the default `conf` file is `application.conf`, but you can use whatever name you prefer:
202204

203205
```java
204206
{
@@ -228,7 +230,7 @@ As we said before, the default `conf` file is `application.conf`, but you can us
228230
}
229231
```
230232

231-
* Starting the application in `dev` produces `conf` tree similar to:
233+
* Starting the application in `dev` produces a `conf` tree similar to:
232234

233235
```
234236
.
@@ -241,7 +243,7 @@ As we said before, the default `conf` file is `application.conf`, but you can us
241243
└── ...
242244
```
243245

244-
* Starting the application in `prod` produces `conf` tree similar to:
246+
* Starting the application in `prod` produces a `conf` tree similar to:
245247

246248
```
247249
.

0 commit comments

Comments
 (0)