File tree Expand file tree Collapse file tree 6 files changed +11
-21
lines changed Expand file tree Collapse file tree 6 files changed +11
-21
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,7 @@ async fn main() -> Result<()> {
27
27
// identified by its ALPN. Spawn the router to start listening.
28
28
let router = Router :: builder (endpoint )
29
29
. accept (iroh_blobs :: ALPN , blobs )
30
- . spawn ()
31
- . await ? ;
30
+ . spawn ();
32
31
33
32
// get our own address. At this point we have a running router
34
33
// that's ready to accept connections.
@@ -46,4 +45,4 @@ async fn main() -> Result<()> {
46
45
}
47
46
```
48
47
49
- You can add whatever protocols you need to the router, multiplexing them all over the same endpoint.
48
+ You can add whatever protocols you need to the router, multiplexing them all over the same endpoint.
Original file line number Diff line number Diff line change @@ -118,8 +118,7 @@ async fn main() -> Result<()> {
118
118
// protocol.
119
119
let router = Router :: builder (endpoint . clone ())
120
120
. accept (iroh_gossip :: ALPN , gossip . clone ())
121
- . spawn ()
122
- . await ? ;
121
+ . spawn ();
123
122
124
123
// Cleanly shutdown the router.
125
124
router . shutdown (). await ? ;
@@ -147,8 +146,7 @@ async fn main() -> Result<()> {
147
146
148
147
let router = Router :: builder (endpoint . clone ())
149
148
. accept (iroh_gossip :: ALPN , gossip . clone ())
150
- . spawn ()
151
- . await ? ;
149
+ . spawn ();
152
150
153
151
// Create a new topic.
154
152
let id = TopicId :: from_bytes (rand :: random ());
@@ -342,8 +340,7 @@ async fn main() -> Result<()> {
342
340
343
341
let router = Router :: builder (endpoint . clone ())
344
342
. accept (iroh_gossip :: ALPN , gossip . clone ())
345
- . spawn ()
346
- . await ? ;
343
+ . spawn ();
347
344
348
345
let id = TopicId :: from_bytes (rand :: random ());
349
346
let node_ids = vec! [];
@@ -599,8 +596,7 @@ async fn main() -> Result<()> {
599
596
600
597
let router = Router :: builder (endpoint . clone ())
601
598
. accept (iroh_gossip :: ALPN , gossip . clone ())
602
- . spawn ()
603
- . await ? ;
599
+ . spawn ();
604
600
605
601
// in our main file, after we create a topic `id`:
606
602
// print a ticket that includes our own node id and endpoint addresses
Original file line number Diff line number Diff line change @@ -39,8 +39,7 @@ async fn start_accept_side() -> anyhow::Result<iroh::protocol::Router> {
39
39
let endpoint = iroh :: Endpoint :: builder (). discovery_n0 (). bind (). await ? ;
40
40
41
41
let router = iroh :: protocol :: Router :: builder (endpoint )
42
- . spawn ()
43
- . await ? ;
42
+ . spawn ();
44
43
45
44
Ok (router )
46
45
}
@@ -102,8 +101,7 @@ async fn start_accept_side() -> anyhow::Result<iroh::protocol::Router> {
102
101
103
102
let router = iroh :: protocol :: Router :: builder (endpoint )
104
103
. accept (ALPN , Echo ) // This makes the router handle incoming connections with our ALPN via Echo::accept!
105
- . spawn ()
106
- . await ? ;
104
+ . spawn ();
107
105
108
106
Ok (router )
109
107
}
Original file line number Diff line number Diff line change @@ -123,8 +123,7 @@ async fn main() -> anyhow::Result<()> {
123
123
// to the blobs protocol.
124
124
let router = Router :: builder (endpoint )
125
125
. accept (iroh_blobs :: ALPN , blobs . clone ())
126
- . spawn ()
127
- . await ? ;
126
+ . spawn ();
128
127
129
128
// do *something*
130
129
Original file line number Diff line number Diff line change @@ -29,8 +29,7 @@ async fn main() -> anyhow::Result<()> {
29
29
// build the router
30
30
let router = Router :: builder (endpoint )
31
31
. accept (iroh_blobs :: ALPN , blobs . clone ())
32
- . spawn ()
33
- . await ? ;
32
+ . spawn ();
34
33
35
34
router . shutdown (). await ? ;
36
35
Original file line number Diff line number Diff line change @@ -29,8 +29,7 @@ async fn main() -> anyhow::Result<()> {
29
29
let router = Router :: builder (endpoint )
30
30
. accept (iroh_blobs :: ALPN , blobs . clone ())
31
31
. accept (iroh_gossip :: ALPN , gossip . clone ())
32
- . spawn ()
33
- . await ? ;
32
+ . spawn ();
34
33
35
34
router . shutdown (). await ? ;
36
35
Ok (())
You can’t perform that action at this time.
0 commit comments