Hi,

Did you see the 3rd version of my patch? It adds
EventLoopPolicy.get_task_factory() which is called by BaseEventLoop
constructor:
https://codereview.appspot.com/110820049/

See also the issue:
https://code.google.com/p/tulip/issues/detail?id=185

Does the Pulsar Task class inherit from asyncio.Task?

Victor

2014-07-07 15:36 GMT+02:00 Luca Sbardella <[email protected]>:
> 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