Re: [python-tulip] asyncio, datagram transports and recvmsg

2018-09-26 Thread chrysn
msgDatagramTransport / RecvmsgDatagramProtocol pair, mine is implemented at [1]. Thank you for you quick and helpful response chrysn [1]: https://gitlab.com/energyharvesting/aiocoap/blob/f4fa27227bb8d6dfe64eae7807040f6ef4ee8235/aiocoap/util/asyncio/recvmsg.py -- There's always a bigger fish. -- Qui

[python-tulip] asyncio, datagram transports and recvmsg

2018-09-24 Thread chrysn
ent thread that runs on a loop where I can do that (which kind of defeats the point of asyncio). Which of the sketched ways do you think are worth pursuing, or should this all be handled differently? Best regards Christian [1]: https://github.com/chrysn/aiocoap/blob/0d09b2eb92a12a01279883f75f

Re: [python-tulip] Asyncio extension for IPython

2014-09-17 Thread chrysn
>...: print("DONE") > In [2]: Task(f()) > Out[2]: > > In [3]: doing_other_stuff() (that's where the user is interrupted by the PRINT) > In [4]: doing_more_DONE > Out[2]: result=None> > In [4]: doing_more_ (but he can continue from there) would that

Re: [python-tulip] cancellation of `TimerHandle`s and freeing references

2014-07-04 Thread chrysn
n't be work the hassle; i prefer to think of cancelled objects as dead-and-gone) best regards chrysn -- There's always a bigger fish. -- Qui-Gon Jinn signature.asc Description: Digital signature

Re: [python-tulip] cancellation of `TimerHandle`s and freeing references

2014-07-03 Thread chrysn
the resulting bug appeared like (objects not being garbage collected, which my unit tests in aiocoap are watchful of). best regards chrysn -- I shouldn't have written all those tank programs. -- Kevin Flynn signature.asc Description: Digital signature

[python-tulip] cancellation of `TimerHandle`s and freeing references

2014-07-03 Thread chrysn
ding `self._callback = self._args = None` to asyncio.events.Handle.cancel. best regards chrysn -- To use raw power is to make yourself infinitely vulnerable to greater powers. -- Bene Gesserit axiom signature.asc Description: Digital signature

Re: [python-tulip] list-style futures that can be used like generators

2014-04-24 Thread chrysn
(item) note that due to the decorator-injected explicit asyncyield, the cogenerator would be called as `self.filtered_results(search_term)`. a current implementation called QueueWithEnd is attached; i've uploaded the development history of proposals to [1] for easier review and containing exampl

Re: [python-tulip] list-style futures that can be used like generators

2014-04-24 Thread chrysn
to have this as syntactic sugar for the equivalent `while .can_peek(): value = .consume()` like `for` is syntactic sugar for `i = .iter(); while True: try: value = i.__next() / except StopIteration`. but independent of future syntax suggestions, there needs to be an agreeable syntax-independent

Re: [python-tulip] list-style futures that can be used like generators

2014-04-24 Thread chrysn
d; i've uploaded the development history of proposals to [1] for easier review and containing examples. best regards chrysn [1] https://gitorious.org/asyncio-for-loop-replacement/asyncio-for-loop-replacement import abc import enum import asyncio class AsyncIterable(metaclass=abc.ABCMeta):

[python-tulip] list-style futures that can be used like generators

2014-04-20 Thread chrysn
ith non-python3.4 syntax like `for song yield from ...`) * would such a pattern be a useful addition to the common mechanisms used in asyncio? * do you see the need for more features in such a mechanism (eg a `for i, cursor in (yield from client.listall().lines_enumerated)` for progress in

Re: [python-tulip] aiohttp and classical web frameworks

2014-02-21 Thread chrysn
On Tue, Feb 18, 2014 at 11:48:19AM -0700, Don Brown wrote: > Great work chrysn. Does the same limitation apply that you can't use Task > manually any more? I use them a lot in a sql driver library I'm working > on, and can see using them in other places as well. it does;

Re: [python-tulip] aiohttp and classical web frameworks

2014-02-21 Thread chrysn
On Tue, Feb 18, 2014 at 02:24:39PM -0500, Yury Selivanov wrote: > > On 2/18/2014, 4:44 AM, chrysn wrote: > >technically, i added an `asyncio.events.current_context` global > >dictionary, [...] > > Don't forget to patch Future.add_done_callback() too. thanks for the

Re: [python-tulip] aiohttp and classical web frameworks

2014-02-18 Thread chrysn
hello don, On Tue, Feb 18, 2014 at 10:44:28AM +0100, chrysn wrote: > [... much ...] had i read the python-tulip mailing list more carefully, i would have seen the "ThreadLocal analogue" thread. the whole hackery described in the abovementioned mail can be easily avo

Re: [python-tulip] aiohttp and classical web frameworks

2014-02-18 Thread chrysn
On Tue, Feb 18, 2014 at 09:21:52AM +0100, chrysn wrote: > flask (and other werkzeug-based frameworks) seem not to use thread-local > variables directly, but have their own "local" manager[1]. especially, > the flask RequestContext objects (which fling the described exceptions) &

Re: [python-tulip] aiohttp and classical web frameworks

2014-02-18 Thread chrysn
be thread-local, but "request-local". (not sure where to hook it up exactly, might need dirty stuff like stack inspection for a first hack). i'm very new to flask (used django and pylons ages ago, and just recently needed web stuff again), but it is too nice not to try to use it with

[python-tulip] aiohttp and classical web frameworks

2014-02-16 Thread chrysn
es a wsgi+async interface? if the topic fits here, i'd like to keep this thread updated if relevant information comes back from the pocoo people. best regards, and thank you all for providing this cool new python base technology chrysn [1] https://www.gitorious.org/aiohttp-werkzeug-demo/aioht