Add message forwarding
parent: tbd commit: e4fa992
1 | use ; |
2 | use DaemonConnectionPool; |
3 | use ; |
4 | use Serialize; |
5 | use Message; |
6 | |
7 | pub async |
8 | pool: &DaemonConnectionPool, |
9 | message: , |
10 | |
11 | let connection = pool.get .await; |
12 | |
13 | let mut connection = match connection |
14 | Ok => connection, |
15 | Err => |
16 | return Binary |
17 | |
18 | ; |
19 | |
20 | let send_result = connection |
21 | .send |
22 | .await; |
23 | |
24 | if let Err = send_result |
25 | return Binary; |
26 | |
27 | |
28 | loop |
29 | let message = connection.next .await; |
30 | |
31 | match message |
32 | Some => |
33 | match message |
34 | => return Binary, | Binary
35 | => | Ping
36 | let _ = connection.send .await; |
37 | continue; |
38 | |
39 | => | Close
40 | return Binary |
41 | String from |
42 | .into_bytes, |
43 | |
44 | |
45 | _ => continue, |
46 | ; |
47 | |
48 | Some => |
49 | return Binary |
50 | unwrap, | to_vec .
51 | |
52 | |
53 | _ => |
54 | info!; |
55 | continue; |
56 | |
57 | |
58 | |
59 | |
60 | todo! |
61 | |
62 |