Giter Site home page Giter Site logo

Comments (7)

mgravell avatar mgravell commented on August 28, 2024

No; the call-context is strictly per operation - it has a very different lifetime than the service (on the native version, the service is essentially a singleton; on Kestrel, the service lifetime is configurable in many different ways). I'd also rather avoid some kind of ambient thread-local API.

Can you clarify: what is the scenario where you need it, but are reluctant to make it a parameter?

from protobuf-net.grpc.

ElderJames avatar ElderJames commented on August 28, 2024

I want to get data from headers of the current HttpContext,like jwt,better to make the IHttpContextAccssor work in the service on Kestrel.

from protobuf-net.grpc.

mgravell avatar mgravell commented on August 28, 2024

OK; I understand what you mean.

@JamesNK: before I go too far down the rabbit-hole investigating this - is there any ambient gRPC context already implemented in your bits?

from protobuf-net.grpc.

ElderJames avatar ElderJames commented on August 28, 2024

And I also need to get the complate signal from client at duplex streaming mode

from protobuf-net.grpc.

mgravell avatar mgravell commented on August 28, 2024

@ElderJames that sounds like a very different thing, but that should currently materialize as the end of the IAsyncEnumerable<T> sequence. Is that now working for you? Or are you after something different? Perhaps an example of your intent would help there (just pretend that what you wanted existed)

from protobuf-net.grpc.

ElderJames avatar ElderJames commented on August 28, 2024

Ok, yield break for IAsyncEnumerable is work.

from protobuf-net.grpc.

mgravell avatar mgravell commented on August 28, 2024

I'm assuming that HttpContextAccessorExtensions.GetServerCallContext / .GetCallContext do what is needed here

from protobuf-net.grpc.

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.