Coder Social home page Coder Social logo

Comments (3)

Tradias avatar Tradias commented on June 13, 2024 1

In some low-level libraries like Boost.Beast the user is responsible for synchronizing reads and writes.

For a single streaming RPC you can only have one outstanding read/write at a time. But of course, you can have multiple clients, each doing their RPC and won't need to sync reads/writes between all clients.

from asio-grpc.

Tradias avatar Tradias commented on June 13, 2024

Hi, thanks for considering this library :).

  1. Correct, without timeout this would consume 100% CPU. In agrpc::run I therefore use a backoff policy going from the default of 250ms down to 0ms depending on most recent activity on either context. If a context has just processed them work in their poll call -> reduce timeout to 0ms, if not -> gradually increase back to 250ms. I am personally not a big fan of this API either, but users seem to like the convenience of running io_context and GrpcContext on the same thread (and thereby avoiding any need for synchronization). I feel that it needs more real-world testing though. I have some performance numbers for unary rpcs in the [README].(https://github.com/Tradias/asio-grpc#performance) (look for cpp_asio_grpc_io_context_coro).
  2. Yes you can, otherwise it wouldn't be an asynchronous API, right? 😁

from asio-grpc.

criatura2 avatar criatura2 commented on June 13, 2024

Thanks

Yes you can, otherwise it wouldn't be an asynchronous API, right?

In some low-level libraries like Boost.Beast the user is responsible for synchronizing reads and writes.

from asio-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.