473,473 Members | 1,419 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Re: asynchat sends data on async_chat.push and .push_with_producer

On Tue, 13 May 2008 20:56:03 -0400, Jean-Paul Calderone <ex*****@divmod.comwrote:
>On Tue, 13 May 2008 16:44:11 -0700 (PDT), Giampaolo Rodola'
<gn****@gmail.comwrote:
>>
[snip]
>>>
To support scheduling calls, you just have to know when the next call is
going to happen. Then, you can wake up at exactly that time. This is
what Twisted does, even for select reactor. ;)

Yes but how do you know when it's the time to fire up a call without
using a thread?
You are forced to call time.time() periodically and check if that time
had come every time.
Take a look at twisted/internet/base/ReactorBase.runUntilCurrent.
That's where that should happen.

Why? Isn't this why subtraction exists? If there is a call scheduled to
happen at T1 and the current time is T2, then I know that after (T1 - T2)
elapses, it will be time to run the call. Why do I have to do any checks
at all? I just tell select() to wait that long. Presumably this is just
what someone will do if they want to use asyncore with timed calls. Call
asyncore.loop() in a loop, always passing (T1 - T2) as the timeout value.
Ah, of course this is wrong, since asyncore.loop... loops. :P I meant to
say asyncore.poll() here.
>So, actually, I'm not sure what the disagreement is about. ;) The
default value for the timeout parameter to the loop function seems
somewhat irrelevant. If someone wants timed events in their loop,
asyncore isn't standing in their way. On the other hand, I didn't
this thread (or maybe just this part of the thread) start out with
a question about asyncore throughput? I have no idea what that
might have to do with this.

Jean-Paul
Jun 27 '08 #1
0 1412

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Michael Welsh | last post by:
In order to learn sockets in Python I am trying to write a simple group chat server and client. I need a little nudge, please. My question contains some GUI but only as decoration. The root...
1
by: Patrick Useldinger | last post by:
I am trying to write both a server and a client using asynchat. For both, I have created a common subclass to collect the incoming data: class SingleServer(asynchat.async_chat): def...
16
by: Rob Snyder | last post by:
Greetings - I've embarked on a small learning project, trying to get a better grasp of the asyncore and asynchat modules. The project involves building a simple instant messenger application for...
1
by: Andreas R. | last post by:
Hello, I'm using Python's asynchat module for network support in a Python-based game, and I run into two problems, both of which occur at random times. Most of the time, the network sending and...
8
by: Andreas R. | last post by:
Hi again, I'm using Python's asynchat module for networking. When calling the sendall() method of asynchat, I sometimes get the error message "the operation could not complete without...
0
by: Z. Kotzer | last post by:
I can not get error notifications when an asynchat based client tries to connect to a non-responsive address. To validate the problem I changed lib/test/test_asynchat.py as follows: class...
5
by: ludvig.ericson | last post by:
Hello, My question concerns asynchat in particular. With the following half- pseudo code in mind: class Example(asynchat.async_chat): def readable(self): if foo:...
1
by: Jean-Paul Calderone | last post by:
On Tue, 13 May 2008 11:50:30 -0700 (PDT), Giampaolo Rodola' <gnewsg@gmail.comwrote: I'm not sure this is right. What timeout are we talking about? Twisted only wakes up when necessary. ...
0
by: davy zhang | last post by:
Python3.0rc1 windowsxp in the lib\asynchat.py def handle_write (self): self.initiate_send() def push (self, data): sabs = self.ac_out_buffer_size if len(data) sabs:
0
by: Orestis Markou | last post by:
Hello, I'm trying to add some better error handling to an async_chat client. What I want is to retry or terminate gracefully if the connection to the server doesn't succeed. Here's what I have:...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.