Coder Social home page Coder Social logo

Comments (4)

LucioFranco avatar LucioFranco commented on September 23, 2024

@zakhenry Hi!

So, unfortunately, this part of tonic and tower is a bit rough at the moment. You can reference #29 for the issue tracking this.

So it is possible to route it is just a bit manual right now https://github.com/hyperium/tonic/blob/master/tonic-interop/src/bin/server.rs#L73 this routes between a TestService and an UnimplementedService.

Hopefully this helps you out!

from tonic.

tjtelan avatar tjtelan commented on September 23, 2024

Multiplexed server routing is covered in the examples now.

async fn main() -> Result<(), Box<dyn std::error::Error>> {
let addr = "[::1]:50051".parse().unwrap();
let greeter = GreeterServer::new(MyGreeter::default());
let echo = EchoServer::new(MyEcho::default());
Server::builder()
.add_service(greeter)
.add_service(echo)
.serve(addr)
.await?;
Ok(())
}

from tonic.

LucioFranco avatar LucioFranco commented on September 23, 2024

Yup, thanks for updating this, I think we can close it! Feel free to reopen if your issue is not resolved.

from tonic.

zakhenry avatar zakhenry commented on September 23, 2024

Hey thanks for the update, I got kinda stuck with the other strategy and ended up working on other projects, but coming back to this one and using the new .add_service method works perfectly, thanks!

from tonic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.