Hi,

>
> I propose the following change in asyncio, add a new
> BaseEventLoop.task_factory attribute:
> https://codereview.appspot.com/110820049/#ps20001
>
>
That is how I implemented it in pulsar. I'm not sure it is the best way,
but it works.
It could also be a method in the EventLoopPolicy. Something like


class EventLoopPolicy(asyncio.AbstractEventLoopPolicy):

    def task_factory(self):
        return ...

    def new_event_loop(self):
        return EventLoop(task_factory=self.task_factory)


>
> The limitation is that all libraries must agree on the task factory.
> For example, greenio wants to use greenio.GreenTask whereas Pulsar
> wants to use
>
>
its own. I'm not sure how greenio task interoperate with asyncio event loop.
Pusar uses greenlets without the need of a greenlet-specialised task class.

Luca

Reply via email to