Worker Processes - org-z2env-worker » History » Version 3
Henning Blohm, 26.08.2015 15:02
1 | 1 | Henning Blohm | h1. Worker Processes (org.z2env.worker) |
---|---|---|---|
2 | 2 | Henning Blohm | |
3 | 3 | Henning Blohm | A worker process component, when _prepared_ starts a new z2 Java process that keeps running until invalidated or some configured Runnable or Main class completes. |
4 | 1 | Henning Blohm | |
5 | 3 | Henning Blohm | See also JAVADOC IWorkerProcess |
6 | |||
7 | 2 | Henning Blohm | ??The point in using worker process components is that this allows you to configure process configuration such as heap size via a component declaration in a central repository rather than using some scripting rules. Also, when using worker processes, the home process can be used to make sure actual application processes get restarted, in case of process crashes. Finally, in nontrivial and distributed scenarios, where a number of different node types are required, starting any combination of those from a single home process makes scale out configuration simple and robust.?? |
8 | |||
9 | A worker process component is declared by specifying some process configuration and some target states, e.g. like this: |
||
10 | |||
11 | <pre><code class="bash"> |
||
12 | org.z2env.component.type=org.z2env.worker |
||
13 | worker.process.vmOptions=-Xmx1024M |
||
14 | worker.states=mymodule/workerUp |
||
15 | </code></pre> |
||
16 | |||
17 | or like this, in case the component *mymodule/main* is a main component or supplies a Runnable. |
||
18 | |||
19 | <pre><code class="bash"> |
||
20 | org.z2env.component.type=org.z2env.worker |
||
21 | worker.process.vmOptions=-Xmx1024M |
||
22 | worker.states=mymodule/workerUp |
||
23 | worker.main=mymodule/main |
||
24 | 1 | Henning Blohm | </code></pre> |
25 | 3 | Henning Blohm | |
26 | h2. Some Details |
||
27 | |||
28 | |||
29 | |||
30 | |||
31 | h2. Properties |
||
32 | |||
33 | |_. name |_. values | |
||
34 | | org.z2env.component.type | org.z2env.any | |
||
35 | | component.className | Name of the class that implements the any components | |