Add backend trait and git backend stub
parent: tbd commit: b9203a9
1 | use ; |
2 | |
3 | use ; |
4 | use |
5 | , |
6 | connection, listener, |
7 | ; |
8 | use Listeners; |
9 | use |
10 | , |
11 | , |
12 | , | Mutex
13 | ; |
14 | use ; |
15 | |
16 | |
17 | extern crate tracing; |
18 | |
19 | |
20 | async |
21 | ; | init
22 | let mut listener = bind .await?; |
23 | let mut connections: = default; |
24 | let mut listeners: = default; |
25 | let mut backend: = |
26 | ; | new
27 | |
28 | loop |
29 | let stream = accept_stream .await; |
30 | |
31 | let = match stream |
32 | Ok => stream, |
33 | Err => |
34 | error!; |
35 | continue; |
36 | |
37 | ; |
38 | |
39 | info!; |
40 | |
41 | let connection = accept_websocket_connection .await; |
42 | |
43 | let connection = match connection |
44 | Ok => connection, |
45 | Err => |
46 | error! |
47 | "Failed to initiate Websocket connection from {}. {:?}", |
48 | address, err |
49 | ; |
50 | continue; |
51 | |
52 | ; |
53 | |
54 | info!; |
55 | |
56 | let connection = RawConnection |
57 | task: spawn |
58 | connection, |
59 | listeners.clone, |
60 | connections.clone, |
61 | backend.clone, |
62 | address, |
63 | , |
64 | ; |
65 | |
66 | connections.lock .await.connections.push; |
67 | |
68 | |
69 | |
70 | async |
71 | listener: &mut TcpListener, |
72 | |
73 | let stream = listener.accept .await?; |
74 | |
75 | Ok |
76 | |
77 | |
78 | async |
79 | stream: S, |
80 | |
81 | let connection = accept_async .await?; |
82 | |
83 | Ok |
84 | |
85 |