[Twisted-Python] Logging observers and threads

Tobias Oberstein tobias.oberstein at tavendo.de
Thu Jul 12 13:33:54 MDT 2012


> libuv is a giant pile of new, unaudited C code that didn't even have a passing
> test suite until a month or two ago.  Please feel free to write a reactor for it;

>From what I've read, libuv has designed it's API around the pattern

A. "do operation and get notified when done"

instead of

B. "get notified when ready and then do operation".

The native Windows API is A., Posix the B and operation = read, write, open, stat, ..

I think A. is more natural, since how do wait for a file to be ready to get open'ed/stat'ed?

Do the open/stat and get notified when done seems to be straight forward rgd API.

Do you think a library with API pattern A would make a nice basis for a Twisted reactor?
 
> better interop with node.js would be great, but it's definitely not a place we
> should go looking for new core features.

;) I knew it would be controversial .. if only for the fact that it's from the node guys ... with support by Microsoft.

> 
> The tricky part of this is not implementation; on today's OSes (except
> maaaaybe solaris?), you just have to use threads or subprocesses, end of story.

Weeeell, Windows. People say IOCP/OverlappedIO works. Without threads. For file I/O also .. don't think for open/stat/.. though.

On Linux there is eventfd ..

> The tricky part is finding an interface for things that is nice and general and
> isn't just a Deferred that fires with a Deferred with a Deferred on top.
> 
> So, <http://tm.tl/1956>, probably.  If we're all lucky I'll have some time to move
> the ball on that on Saturday.
> 
> -glyph
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python




More information about the Twisted-Python mailing list