|
Re: seeking non gtk io monitoring function: msg#00061gnome.gtk+.python
I had exactly the same problem recently, so I developed this pure python mainloop module. I hope it helps. Regards. Dom, 2004-12-12 às 11:10 -0800, Steven Howe escreveu: > Hello, > I'm making a server/client type program. The server will monitor and > process data collecting in a file. > I have two criteria I must satisfy. These are: > 1) The data creation is completely asynchronous. > 2) I need to respond to new data immediately. > > The obvious solution would be to form a tight while loop with read, > test for read result and a short sleep function at it's end. But this > seem to be very wasteful. I'd rather have a function that is suspended > (not racking up CPU cycles). On the PYGTK side I've used: > > gobject.io_add_watch(source, condition, callback) ( see: > MonitoringIO ) > > in a mainloop and let the pygtk app deal with CPU cycles. > > For the server side, I'd rather not use pygtk as it doesn't have any > other gtk functionality. Some pygtk function wrap other python > function. Is there a non-pygtk io_add_watch function? One that > suspends execution until there's new IO on a file? > > > Steven Howe > steven.howe@xxxxxxxxxxx > > _______________________________________________ > pygtk mailing list pygtk@xxxxxxxxxx > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ -- Gustavo J. A. M. Carneiro <gjc@xxxxxxxxxxxxx> <gustavo@xxxxxxxxxxxxxxxxxxxxx> The universe is always one step beyond logic.
pygtk mailing list pygtk@xxxxxxxxxx http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: codegen documentation?: 00061, Xavier Ordoquy |
|---|---|
| Next by Date: | Get value of selected treeview rows: 00061, Marcus Habermehl |
| Previous by Thread: | Re: seeking non gtk io monitoring functioni: 00061, Steve McClure |
| Next by Thread: | Re: seeking non gtk io monitoring function: 00061, matthew . bull |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |