Giter Site home page Giter Site logo

Asynchronous API support about simpleamqpclient HOT 11 OPEN

alanxz avatar alanxz commented on July 28, 2024
Asynchronous API support

from simpleamqpclient.

Comments (11)

grasevski avatar grasevski commented on July 28, 2024 1

You can already consume asynchronously by setting timeout to 0 in BasicConsumeMessage. Async publish could be achieved by adding an async flag to BasicPublish and some pollable methods to Channel, eg IsPublished, GetNextConfirmation, etc.

from simpleamqpclient.

alanxz avatar alanxz commented on July 28, 2024

A while ago I put some thought into what it would take to add async support for messages delivered via consumer, (and other various other events). When I first wrote SimpleAmqpClient I did so to provide an easy-to-use interface when making synchronous RPC-style calls. I wasn't looking to get the best performance out of the protocol. With that constraint the internal bits of SimpleAmqpClient were architected in such a way to hide the async portions of the AMQP protocol.

To add the async bits back to SimpleAmqpClient would require rethinking the core of SimpleAmqpClient to run a thread internally to manage the rabbitmq-c structures, then all of the API calls would need to talk to this thread.

At the time I didn't see a whole lot of demand from users for this sort of feature, that said, if there is new demand maybe its time to re-think adding this feature to SimpleAmqpClient.

from simpleamqpclient.

asanand avatar asanand commented on July 28, 2024

I see. we are looking for high performance, and use our cores to do some other operations instead of waiting for these synchronous calls. thread is an option, but if we get async support, that would be really great.

from simpleamqpclient.

alanxz avatar alanxz commented on July 28, 2024

Noted.

from simpleamqpclient.

luca3m avatar luca3m commented on July 28, 2024

Hi,

I would like an async API too. How do you think is better to implement it? Boost provides Boost::asio with asynchronous sockets. Is it a good option or rabbitmq-c has yet something to manage asynchrony?

from simpleamqpclient.

alanxz avatar alanxz commented on July 28, 2024

SimpleAmqpClient wraps rabbitmq-c and rabbitmq-c currently does nothing to provide a good interface to the asynchronous parts of the AMQP protocol.

Since SimpleAmqpClient doesn't use sockets directly, boost::asio would not be a good option to use with SimpleAmqpClient. Currently I believe the best way forward to get useable support for the asynchronous parts of AMQP is to do a bit of re-architecting of the rabbitmq-c library to support both the various methods available to do network-based async-IO, and provide a useable async API .

from simpleamqpclient.

luca3m avatar luca3m commented on July 28, 2024

I've read some more details about code of rabbitmq-c and SimpleAmqpClient, for me probably it's easier to use asio sockets and use rabbitmq-c only for protocol parsing.

I'm doing some other experiments and eventually I'll get back on this issue if somebody it's interested.

from simpleamqpclient.

Vermillionaire avatar Vermillionaire commented on July 28, 2024

Did you come up with a solution for this? I'd like to have a consumer in a seperate thread, but it doesnt sound like it supports it.

from simpleamqpclient.

luca3m avatar luca3m commented on July 28, 2024

I used this library https://github.com/CopernicaMarketingSoftware/AMQP-CPP, no good luck but probably now it's better than two years ago.

from simpleamqpclient.

alosya avatar alosya commented on July 28, 2024

Is there any progress on providing async support. We are trying to use simpleamqpclient
for RPC purposes. Performance is not great. I really really like the simplicity nature of
this client but, we need performance as well. Yes, async support would be wonderful.

from simpleamqpclient.

alanxz avatar alanxz commented on July 28, 2024

@alosya - are you concerned about performance in publishing messages or receiving messages?

from simpleamqpclient.

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.