Coder Social home page Coder Social logo

implementing async rpc client about py-amqp HOT 2 CLOSED

celery avatar celery commented on May 25, 2024
implementing async rpc client

from py-amqp.

Comments (2)

ask avatar ask commented on May 25, 2024

Channel.wait is a relic from amqplib, I don't believe it's used anymore.

Connection.drain_events is the common way to read from the socket, it will drain events from all channels and supports a timeout argument. Like channel.wait it's also a blocking function though, so if you want to drain events asynchronously you should use select/poll/epoll to call the function when the socket is readable.

kombu.async is what celery uses to consume messages asynchronously, but the API is not really public yet. You don't have to use kombu, as you should be able to write a simple select loop around py-amqp, but you will have to learn how to do that elsewhere.

from py-amqp.

eandersson avatar eandersson commented on May 25, 2024

As a temporary solution I set a timeout on drain_events and simply caught the timeout event. Works like a charm. Thanks.

from py-amqp.

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.