summaryrefslogtreecommitdiff
path: root/system/doc/design_principles/sup-one_for_one.svg
blob: d9c0c420abd28bde06fb6a78756e8991611438bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/PR-SVG-20010719/DTD/svg10.dtd">
<svg width="21cm" height="11.2cm" viewBox="-5 -5 330 180" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <style type="text/css">
    .link {stroke: #000000; stroke-width: 2;}

    .sup.label {font-size: 27px; fill: #000000; text-anchor: middle; font-family: monospace; font-style: normal; font-weight: bold;}
    .sup.body {fill: #ddddff; fill-opacity: 1; stroke-width: 3; stroke: #000000;}

    .child.label {font-size: 27px; fill: #000000; text-anchor: middle; font-family: monospace; font-style: normal; font-weight: bold;}
    .child.label.index {font-size: 12px;}
    .child.body {fill: #eeeeee; fill-opacity: 1; stroke-width: 3; stroke: #000000;}
    .child.body.terminated {fill: #ff8888;}
    .child.body.sup-terminated {fill: #ffaa00;}
    .child.body.restarted {stroke: #00aa00;}

    .ellipsis {fill: #000000; fill-opacity: 1; stroke: none}
    .ellipsis.sup-terminated {fill: #ffaa00;}
    .ellipsis.restarted {stroke: #00aa00;}

    .divider {stroke: #000000; stroke-width: 0.2; stroke-dasharray: 1 3;}

    .legend.label {font-size: 10px; fill: #000000; font-family: sans-serif; font-style: normal; font-weight: normal;}
    .legend.body.terminated {fill: #ff8888; fill-opacity: 1; stroke: none;}
    .legend.body.restarted {fill: none; fill-opacity: 1; stroke: #00aa00; stroke-width: 2;}
  </style>
  <!-- illustration for the one_for_one strategy -->

  <!-- linking lines -->
  <line class="link" x1="140" y1="40" x2="20" y2="100" />
  <line class="link" x1="140" y1="40" x2="100" y2="100" />
  <line class="link" x1="140" y1="40" x2="180" y2="100" />
  <line class="link" x1="140" y1="40" x2="300" y2="100" />

  <!-- supervisor -->
  <g transform="translate(140 20)">
    <rect class="sup body" x="-20" y="-20" width="40" height="40"/>
    <text class="sup label" x="0" y="8.5">S</text>
  </g>

  <!-- child process 1 -->
  <g transform="translate(20 100)">
    <ellipse class="child body" cx="0" cy="0" rx="20" ry="20"/>
    <text><tspan class="child label" font-size="27" x="0" y="8.5">P</tspan><tspan class="child label index" x="8" y="12">1</tspan></text>
  </g>

  <!-- child process 2 -->
  <g transform="translate(100 100)">
    <ellipse class="child body terminated restarted" cx="0" cy="0" rx="20" ry="20"/>
    <text><tspan class="child label" x="0" y="8.5">P</tspan><tspan class="child label index" x="8" y="12">2</tspan></text>
  </g>

  <!--- child process 3 -->
  <g transform="translate(180 100)">
    <ellipse class="child body" cx="0" cy="0" rx="20" ry="20"/>
    <text><tspan class="child label" x="0" y="8.5">P</tspan><tspan class="child label index" x="8" y="12">3</tspan></text>
  </g>

  <!-- ... -->
  <g class="ellipsis" transform="translate(240 100)">
    <ellipse cx="-15" cy="0" rx="2" ry="2"/>
    <ellipse cx="0" cy="0" rx="2" ry="2"/>
    <ellipse cx="15" cy="0" rx="2" ry="2"/>
  </g>

  <!-- child process n -->
  <g transform="translate(300 100)">
    <ellipse class="child body" cx="0" cy="0" rx="20" ry="20"/>
    <text><tspan class="child label" font-size="27" x="0" y="8.5">P</tspan><tspan class="child label index" font-size="12" x="8" y="12">n</tspan></text>
  </g>

  <!-- divider -->
  <line class="divider" transform="translate(0 135)" x1="-5" y1="0" x2="330" y2="0" />

  <!-- legend -->
  <g transform="translate(5 140)">
    <g transform="translate(0 10)">
        <ellipse class="legend body terminated" cx="0" cy="0" rx="5" ry="5"/>
        <text class="legend label" x="10" y="3">Terminated process</text>
    </g>
    <g transform="translate(0 25)">
      <ellipse class="legend body restarted" cx="0" cy="0" rx="5" ry="5"/>
      <text class="legend label" x="10" y="3">Process restarted by the supervisor</text>
    </g>
  </g>
</svg>