Coder Social home page Coder Social logo

Comments (3)

philliphoff avatar philliphoff commented on June 3, 2024

@Ashishpote A couple of initial thoughts:

  • The HttpClient used by DaprClient, both for HTTP and gRPC, can be customized and has a Timeout property.
  • The HttpClient docs also suggests per-invocation timeouts be implemented using CancellationTokenSource, which can be done with DaprClient methods as well.
  • Dapr offers "resiliency" as a building block of its own, which comprehends timeouts and could be used for similar purposes, and/or as part of a larger resiliency policy.

If you don't believe any of these options would work, I'd love to know more about your specific scenarios.

from dotnet-sdk.

philliphoff avatar philliphoff commented on June 3, 2024

Looking more closely, it looks like some of the HttpClient customization mechanisms are meant for testing and not necessarily exposed in the public API, so there may still be more we could do here (see similar issue #756). From the same question on Discord, it seems the scenario isn't applying a specific timeout, but extending the existing (default) HttpClient timeout (which is documented as 100s). (The Dapr runtime method invocation does not have a timeout, unless explicitly configured via resiliency policy.)

There was a suggestion on Discord to use DaprClient.CreateInvokeHttpClient() which returns a HttpClient instance that can then have its Timeout property set. That's admittedly an entirely different way to do method invocation, but should work in the (hopefully) limited case of a specific method requiring more time.

from dotnet-sdk.

Ashishpote avatar Ashishpote commented on June 3, 2024

Agreed. We have indeed been using Resiliency now to have central control over Timeout for both service invocation and pub/sub. However, I would still prefer if we can pass more options by exposing HttpClient directly or indirectly so that we can have control per service.

from dotnet-sdk.

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.