Re: [python-tulip] Auto-reconnect in transport.

2013-12-16 Thread Glyph
proceeding here: <http://twistedmatrix.com/trac/ticket/4735>. -glyph

Re: [python-tulip] Auto-reconnect in transport.

2013-12-18 Thread Glyph
On Dec 17, 2013, at 3:27 AM, Antoine Pitrou wrote: > On Mon, 16 Dec 2013 22:21:14 -0800 > Glyph wrote: >> >> This is another case where pushing more convenience functionality into a >> primitive just means more re-implementation of that convenience >> functi

Re: [python-tulip] Auto-reconnect in transport.

2013-12-18 Thread Glyph
if the transport itself remembers everything. So if you have a protocol that needs to know how to re-establish its connection, just write a protocol that knows what "re-establish" means. -glyph

Re: [python-tulip] Auto-reconnect in transport.

2013-12-20 Thread Glyph
On Dec 18, 2013, at 11:08 PM, Antoine Pitrou wrote: > On Wed, 18 Dec 2013 20:02:48 -0800 > Glyph wrote: >> On Dec 18, 2013, at 5:43 AM, Antoine Pitrou wrote: >> >>>> If you need to do something in connection_lost anyway, then why not just >>>

Re: [python-tulip] Calling coroutines within asyncio.Protocol.data_received

2014-01-04 Thread Glyph
ns use serverFromString or clientFromString to parse their command-line arguments, and an increasing number of the servers built in to Twisted do). > (Glyph kept telling me they were cool but not quite ready or something, so I > never had a good look.) The thing that wasn't ready wa

Re: [python-tulip] Calling coroutines within asyncio.Protocol.data_received

2014-01-05 Thread Glyph
ern of using a zope Interface or a python type object to identify the required semantics (as he pointed out above). In the case of endpoints, we just don't have any interfaces for datagram endpoints yet, since those are pretty esoteric and the only other use-case besides UDP we can come up with is DTLS (which, due to session-management issues, is also esoteric enough to require other setup). -glyph

Re: [python-tulip] Calling coroutines within asyncio.Protocol.data_received

2014-01-05 Thread Glyph
On Jan 5, 2014, at 12:20 AM, Guido van Rossum wrote: > On Sat, Jan 4, 2014 at 9:32 PM, Glyph wrote: >> Endpoints are really very simple. They're two interfaces for listening and >> connecting; .listen(factory) for servers and .connect(factory) for clients. >> T

Re: [python-tulip] Calling coroutines within asyncio.Protocol.data_received

2014-01-05 Thread Glyph
On Jan 5, 2014, at 12:44 AM, Guido van Rossum wrote: > On Sat, Jan 4, 2014 at 10:11 PM, Glyph wrote: >> Twisted's syntax is actually pretty bad [...] > > Noted. > >> "connected UDP" is a strange beast, and it doesn't make UDP a connected >> p

Re: [python-tulip] using coroutines within protocols?

2014-01-23 Thread Glyph
ement something like what it does with feed_data, unblocking futures that are waiting for data_received to be called: <https://code.google.com/p/tulip/source/browse/asyncio/streams.py#261>. -glyph

Re: [python-tulip] Event loop error handler

2014-02-10 Thread Glyph
this for my day job, but nevertheless, I still dream of making some cool games in Python ;-).) On Feb 7, 2014, at 4:18 PM, Guido van Rossum wrote: > OK, go for it unless Glyph pipes up. :-) > > > On Fri, Feb 7, 2014 at 2:03 PM, Yury Selivanov > wrote: > On 2/7/2014, 4:47

Re: [python-tulip] Event loop error handler

2014-02-10 Thread Glyph
Oops, it was pointed out to me that this message isn't super clear. To put it more simply: Please go ahead and do this, using the loop API everywhere would be a lot better for my uses :-). -glyph On Feb 10, 2014, at 5:12 PM, Glyph wrote: > I have a use-case, which is to direct T

Re: [python-tulip] Connection timeout in create_connection

2014-04-16 Thread Glyph
this is two or three times as bad if you care about running on PyPy, where garbage collection semantics mean files may not be closed for much longer if there isn't a lot of memory pressure. -glyph

Re: [python-tulip] TLS handshake exception. Bug/Comments/HeartBleed?

2014-05-05 Thread Glyph
tried this on any other machines, and so on. On May 5, 2014, at 5:24 PM, Imran Geriskovan wrote: > - Lack of proper CA certificates on Debian during this period On *your* debian installation, perhaps. Did you install the "ca-certificates" package? Is it updated? -glyph

Re: [python-tulip] TLS handshake exception. Bug/Comments/HeartBleed?

2014-05-06 Thread Glyph
OS X 10.9. If that says the same thing as asyncio, (ok for linkedin.com, not ok for licdn.com) then perhaps the issue is with your network. Good luck, -glyph

Re: [python-tulip] TLS handshake exception. Bug/Comments/HeartBleed?

2014-05-06 Thread Glyph
analyze.html?d=static.licdn.com>. Maybe your OpenSSL is mad about one of those things? At any rate, if other OpenSSL programs on the same computer are having the same results, this isn't an asyncio issue per se, and you should probably find an OpenSSL or Debian mailing list to ask :-). Good luck, -glyph

Re: [python-tulip] Performance of asynchronous data processing.

2014-06-13 Thread Glyph
earch project") in Twisted as to how to fix this in a more general way than creating a new interface for every new form of variable-length data, and if it ever works out, I'll be sure to share the technique with the asyncio community. -glyph

Re: [python-tulip] sockets, eof_received() and shutdown()

2014-06-27 Thread Glyph
"Didn't receive any data" is the wrong way of looking at this. It closes the socket if it receives an EOF. A 0-byte return is an authoritative statement that there *will be* no more data, not that there isn't any right now. "there isn't any right now" is EAGAIN. A couple of brief experiments

Re: [python-tulip] Re: Soliciting feedback on AsyncSSH

2014-07-17 Thread Glyph
milar to and interoperable with standard library unit testing (and the extra features it has are mostly related to letting you do more 'real' I/O in your tests, which are a bad idea for unit tests). -glyph

Re: [python-tulip] Re: Soliciting feedback on AsyncSSH

2014-07-17 Thread Glyph
o check in this code right away. By all means caption it with big warnings about its unsuitability for long-term use, but it will provide a valuable resource for anyone else who wants to help you unit-test stuff. -glyph

Re: [python-tulip] Writing unit tests for user code

2014-07-26 Thread Glyph
ay of hardware :-). Anyway, to make a long story short, returning a Deferred from a test is a very advanced, somewhat risky feature that you should use only if you have no other tools at your disposal that do what you want to do. And there are probably more tools to do what you want to do than you might initially think :). Happy testing, -glyph

Re: [python-tulip] Best way to read/write files with AsyncIO

2014-08-26 Thread Glyph
aio>. -glyph On Aug 25, 2014, at 6:55 PM, Guido van Rossum wrote: > On most OSes, select() and other polling APIs always report disk files to be > "ready", so you basically can't use asyncio with them. On Windows it will > fail; on *n*x it will appear to work but ac

Re: [python-tulip] Call protocol.connection_lost() when the creation of transport failed?

2015-01-28 Thread Glyph
ntation isn't complete, I'm pretty confident that the "right" way to do this is simply to have a separate (optional) callback which is only invoked on protocols with a TLS transport. Probably rather than having the transport promise to store its peer certificate forever, you

Re: [python-tulip] Call protocol.connection_lost() when the creation of transport failed?

2015-01-29 Thread Glyph
> On Jan 29, 2015, at 12:49 AM, Victor Stinner wrote: > > Hi, > > 2015-01-29 5:19 GMT+01:00 Glyph : >> Twisted always immediately reports the connectionMade to the >> application-level protocol, so a TLS protocol's connectionMade means the >> same th

Re: [python-tulip] Call protocol.connection_lost() when the creation of transport failed?

2015-01-29 Thread Glyph
ation of every transport. So how do you imagine this would be used? -glyph

Re: [python-tulip] Is async object creation supported?

2015-05-16 Thread Glyph
, having constructors do I/O is an anti-pattern for these same reasons; you just notice it faster in an async framework :). -glyph

Re: [python-tulip] StreamWriter.drain cannot be called concurrently

2015-06-11 Thread Glyph
put streams and interleaved writes. -glyph

Re: [python-tulip] StreamWriter.drain cannot be called concurrently

2015-06-13 Thread Glyph
> On Jun 12, 2015, at 2:37 PM, Martin Teichmann > wrote: > > Hi Glyph, hi Guido, hi everyone. > > You have two very different points of critique, > let me respond to both of them: > >> StreamWriter.drain cannot be called from different tasks (asyncio tasks th

Re: [python-tulip] Reading from character special device file

2014-01-13 Thread Glyph Lefkowitz
'uname' is asking about the version of the kernel; you want the version of Mac OS X. 10.8.0 is pretty old; up-to-date Darwin kernel is 13.0.2. If you want the whole-OS product version, the relevant command line is 'sw_vers -productVersion'. -glyph On Jan 10, 2014, a

Re: [python-tulip] Experimental Twisted event loop

2014-01-14 Thread Glyph Lefkowitz
much of the useful ancillary functionality hasn't been ported yet; I suspect it could be used as an event loop for Tulip already). Would you like to coordinate on contributing such a thing? -glyph smime.p7s Description: S/MIME cryptographic signature

Re: [python-tulip] Experimental Twisted event loop

2014-01-14 Thread Glyph Lefkowitz
On Jan 14, 2014, at 1:30 PM, Victor Stinner wrote: > Hi, > > 2014/1/14 Glyph Lefkowitz : >> I'm actually hoping to distribute such a thing within Twisted itself, so >> that it can run against either Trollius or Tulip (in fact, Twisted's core >> event l

Re: [python-tulip] using coroutines within protocols?

2014-01-23 Thread Glyph Lefkowitz
On Jan 23, 2014, at 9:47 AM, Guido van Rossum wrote: > So I think we should just note that > protocols are a lower-level concept than StreamReader. (And more > versatile -- that's usually how lower-level concepts work. :-) +1. Even within Twisted, which follows the callback idiom thoroughly,

Re: [python-tulip] Waiting for all written data to a socket to be flushed

2014-02-18 Thread Glyph Lefkowitz
ing the error of HTTP/0.9's the-body-is-over-when-the-connection-is-closed non-deterministic framing. You still need to be able to flush the transport somehow for tuning reasons, but it's good that people trip over this early. -glyph smime.p7s Description: S/MIME cryptographic signature

Re: [python-tulip] TTY and non-blocking mode

2014-02-21 Thread Glyph Lefkowitz
rarely doing anything real with job control. The only real way to deal with this in a portable way is ... to use threads. Sorry :-(. -glyph smime.p7s Description: S/MIME cryptographic signature

Re: [python-tulip] Idle actions in loop

2014-03-04 Thread Glyph Lefkowitz
thin the loop itself. (And this reminds me, I really need to upstream some patches into urwid to get it to stop doing horrible stuff to various framework internals to get this feature and instead implement it in a simple high-level way...) -glyph smime.p7s Description: S/MIME cryptographic signature

Re: [python-tulip] SyPy Presentation on asyncio: Hitchhiker's Guide To Asyncio in Python 3

2014-03-10 Thread Glyph Lefkowitz
at's a resource for those of you who may have to start answering this question on a weekly basis now for the rest of your lives ;-) -glyph smime.p7s Description: S/MIME cryptographic signature

Re: [python-tulip] Proposal: make coroutines stand out in the asyncio docs.

2015-02-12 Thread Glyph Lefkowitz
> On Feb 12, 2015, at 8:39 AM, Andrew Svetlov wrote: > > I'm with Ben Darnell: coroutine decorator is more like classmethod > than return type. For what it's worth, I disagree; a coroutine is something that a method either returns or doesn't return, so it is more like return type than classmet

Re: [python-tulip] Proposal: make coroutines stand out in the asyncio docs.

2015-02-12 Thread Glyph Lefkowitz
> On Feb 12, 2015, at 12:38 PM, Luciano Ramalho wrote: > > The asyncio code often uses the inspect module to determine the kind > of function, right? From the caller's perspective (i.e. the reader of the documentation), though, isn't a method that returns an asyncio Future more or less the sam

Re: [python-tulip] Benchmark Python Web production stack: Nginx with uWSGI, Meinheld and API-Hour

2015-03-12 Thread Glyph Lefkowitz
you care about performance, PyPy should always be your default. -glyph

Re: [python-tulip] Discussion thread for: http://lucumr.pocoo.org/2016/10/30/i-dont-understand-asyncio/

2016-10-30 Thread Glyph Lefkowitz
Some of the students at such tutorials would say stuff like "Actually I wanted to do something with IRC and IMAP, not a web app, but this gave me a much clearer idea of how to approach it." So I think having asyncio's tutorial work this way would probably be a big win. -glyph