-
Notifications
You must be signed in to change notification settings - Fork 0
/
activity_liveview.uml
71 lines (51 loc) · 1.36 KB
/
activity_liveview.uml
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
@startuml
!include default_style.iuml
' skinparam backgroundColor transparent
' title UML Activity Diagrama for Phoenix LiveView LifeCycle
start
repeat
:mount(params, session, socket)
/{:ok, socket, keyword};
:handle_params(params, uri, socket)
/{:noreply, socket, keyword};
:render(socket.assigns)
/template;
:Sent HTML to client>
if (connected?(socket)) then (yes)
break;
endif
:Client connects to the liveSocket<
:LiveView is spawned to receive messages;
repeat while ()
' :Connects from the client to the server where stateful views are spawned to push rendered updates to the browser, and receive client events via phx- bindings;
repeat
fork
:phx- event<
:handle_event(event, event_params, socket)
/{:noreply, socket} | {:reply, map, socket};
fork again
:Erlang msg<
:handle_info(msg, socket)
/{:ok, socket};
fork again
:GenServer call<
:handle_call(msg, {pid, ref}, socket)
/{:noreply, socket} | {:reply, term, socket};
fork again
:GenServer cast<
:handle_cast(msg, socket)
/{:noreply, socket};
fork again
: <.link patch={...}> <
:handle_params(params, uri, socket)
/{:noreply, socket, keyword};
end fork
if (socket anotated for "patch" navigation) then (yes)
:handle_params(params, uri, socket)
/{:noreply, socket, keyword};
endif
:render(socket.assigns)
/template;
:Send changes to client>
repeat while ()
@enduml