mirror of
https://github.com/OMGeeky/tarpc.git
synced 2026-01-25 03:50:29 +01:00
Don't bake in Send + 'static.
Send + 'static was baked in to make it possible to spawn futures onto the default executor. We can accomplish the same thing by offering helper fns that do the spawning while not requiring it for the rest of the functionality. Fixes https://github.com/google/tarpc/issues/212
This commit is contained in:
@@ -75,11 +75,11 @@ async fn main() -> io::Result<()> {
|
||||
// the generated World trait.
|
||||
.map(|channel| {
|
||||
let server = HelloServer(channel.as_ref().as_ref().peer_addr().unwrap());
|
||||
channel.respond_with(server.serve())
|
||||
channel.respond_with(server.serve()).execute()
|
||||
})
|
||||
// Max 10 channels.
|
||||
.buffer_unordered(10)
|
||||
.for_each(|_| futures::future::ready(()))
|
||||
.for_each(|_| async {})
|
||||
.await;
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user