no clue what this is
parent: tbd commit: 7889bf6
1 | use Error; |
2 | use ; |
3 | |
4 | use Instance; |
5 | |
6 | use ; |
7 | use ; |
8 | use ; |
9 | use |
10 | , | File
11 | , |
12 | , |
13 | , | Mutex
14 | ; |
15 | use ; |
16 | use LocalPoolHandle; |
17 | use Table; |
18 | |
19 | |
20 | extern crate tracing; |
21 | |
22 | |
23 | async |
24 | ; | init
25 | let config: Table = |
26 | let mut file = open .await?; |
27 | let mut text = String new; |
28 | file.read_to_string .await?; |
29 | text.parse? |
30 | ; |
31 | let mut listener = bind .await?; |
32 | let db_conn_options = new |
33 | .host |
34 | .port |
35 | .database |
36 | .username |
37 | .password |
38 | .log_statements; |
39 | let db_pool = connect_with .await?; |
40 | |
41 | debug!; |
42 | ! .run .await?; | migrate
43 | info!; |
44 | |
45 | let _token_granter = new |
46 | config: config.clone, |
47 | instance: from_str .unwrap, |
48 | ; |
49 | |
50 | info!; |
51 | |
52 | let runtime = new; |
53 | |
54 | let pool = new; |
55 | |
56 | loop |
57 | let stream = accept_stream .await; |
58 | info!; |
59 | |
60 | let = match stream |
61 | Ok => stream, |
62 | Err => |
63 | error!; |
64 | continue; |
65 | |
66 | ; |
67 | |
68 | info!; |
69 | |
70 | let connection = accept_websocket_connection .await; |
71 | |
72 | let connection = match connection |
73 | Ok => connection, |
74 | Err => |
75 | error! |
76 | "Failed to initiate Websocket connection from {}. {:?}", |
77 | address, err |
78 | ; |
79 | continue; |
80 | |
81 | ; |
82 | |
83 | info!; |
84 | |
85 | let our_instance = |
86 | unwrap; | from_str .
87 | |
88 | pool.spawn_pinned |
89 | client_wrapper |
90 | ; |
91 | |
92 | |
93 | |
94 | async |
95 | let stream = listener.accept .await?; |
96 | |
97 | Ok |
98 | |
99 | |
100 | async |
101 | stream: S, |
102 | |
103 | let connection = accept_async .await?; |
104 | |
105 | Ok |
106 | |
107 |