Giter VIP home page Giter VIP logo

Comments (6)

asvetlov avatar asvetlov commented on August 20, 2024

Sorry for delay.
I'll take a look this weekend.

from aiozmq.

wabu avatar wabu commented on August 20, 2024

Not a problem at all. You're really doing a great job with this lib!

from aiozmq.

asvetlov avatar asvetlov commented on August 20, 2024

Please explain me why do you need to wait for transport's write buffer flush?
Looks like you are seeking for pause_writing/resume_writing pair.
I'we implemented it in stream branch as part of creating ZmqStream class for giving more human interface that transports/protocols.
The code is almost ready for merging but I need to make several tests for 100% coverage.
I've postponed my work on streams for sake of other my projects but can force development if the stream branch is that you needed.

from aiozmq.

wabu avatar wabu commented on August 20, 2024

I run a task with run_until_complete, which issues some writes. The task is done after the last write, so the event loop stops running and and some messages don't get written, as the write callback can't happen when the loops stops. As the loop gets other tasks to run later, I don't want to call close() and wait for connection_lost(), but still I want all buffers flushed before the task is done and the loop suspended.

from aiozmq.

asvetlov avatar asvetlov commented on August 20, 2024

Aaah, understood.
Sorry, I don't want to do anything to fix your particular requirement.
The reason is: ZmqTransport has modeled after asyncio ones.
Neither of asyncio transports: TCP, UDP, SSL, Unix, pipe -- doesn't have any user callback to signal that data has been moved from python buffer to OS one. In the most cases (regular usage with run_forever or for client sockets) that doesn't make sense.
Twisted's protocols has no such callback also.

I'll add the callback only after asyncio will do it.

Good news for you: probably you don't need for callback at all.
ZeroMQ executes separate IO thread for writing and has reasonable big default buffer sizes.
If your ZMQ socket counterpart consumes ZMQ messages quickly enough you simply never get situation when ZmqTrasport will need to use own buffer.

from aiozmq.

wabu avatar wabu commented on August 20, 2024

ok. thank you anyway. perhaps I raise the issue for asyncio

from aiozmq.

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.