Coder Social home page Coder Social logo

Middleware registration about tonic HOT 4 CLOSED

hyperium avatar hyperium commented on June 21, 2024 10
Middleware registration

from tonic.

Comments (4)

LucioFranco avatar LucioFranco commented on June 21, 2024

Yeah so ideally we would use something like https://docs.rs/tower-layer/0.3.0-alpha.1/tower_layer/trait.Layer.html which achieves this. The issue right now is the extra api's around making these easier to define are not yet done. The interceptor_fn was the first attempt at trying to make an easy api for this. I would love to find a better one.

from tonic.

mawenqi avatar mawenqi commented on June 21, 2024

so how could I do this in version 0.1.1? thanks

from tonic.

LucioFranco avatar LucioFranco commented on June 21, 2024

There is now this https://docs.rs/tonic/0.1.1/tonic/struct.Interceptor.html

from tonic.

davidpdrsn avatar davidpdrsn commented on June 21, 2024

This was solved as part of #651. The API for adding tower middleware to tonic clients and servers has been simplified quite a bit. Interceptors are now also based on tower Service so they are composable in the same way any Service is.

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.