ReactiveX / RxPY

ReactiveX for Python
https://rxpy.rtfd.io
MIT License
4.81k stars 361 forks source link

Info about schedulers? #5

Closed bbirand closed 10 years ago

bbirand commented 10 years ago

I'm reading the official RxPy documentation here: http://rxpy.codeplex.com/documentation At some point, there is a mention of the "Using Schedulers" topic: This will be covered in more details in the Using Schedulers topic.

What type of schedulers are supported in RxPy? I am not interested in using the .NET platform, and am wondering if there is (or there will be) support for more Pythonic libraries like gevent or the Tornado ioloop.

Thanks

dbrattli commented 10 years ago

Hi. I have recently added support for Python 3.4 asyncio https://github.com/dbrattli/RxPY/blob/master/rx/concurrency/mainloopscheduler.py, and I think it should be quite easy to add support for other event loops as well. If you would be interested in testing, which scheduler would you be most interested in, gevent, ioloop or asyncio? There's some code that will show you how to use asyncio with RxPY https://github.com/dbrattli/RxPY/blob/master/tests/test_concurrency/test_mainloopscheduler.py

bbirand commented 10 years ago

Hi @dbrattli, Thanks for the response. I typically use gevent under Python 2.7 to do concurrency. I am now evaluating different approaches for reactive programming and an actor-based model. Would be happy to try out rxpy under gevent.

dbrattli commented 10 years ago

Ok @bbirand, I'll have a look at gevent this weekend. Started adding support for Tornado ioloop today https://github.com/dbrattli/RxPY/blob/develop/rx/concurrency/ioloopscheduler.py and tests at https://github.com/dbrattli/RxPY/blob/develop/tests/test_concurrency/test_ioloopscheduler.py

dbrattli commented 10 years ago

Experimental support for asyncio, ioloop and gevent now in latest 0.6 release. You can see the impl. https://github.com/dbrattli/RxPY/tree/master/rx/concurrency/mainloopscheduler, and examples on how to use at https://github.com/dbrattli/RxPY/tree/master/tests/test_concurrency/test_mainloopscheduler. Please test so we can fix any errors.

bbirand commented 10 years ago

Great, I'll give it a go soon. Thanks!

dbrattli commented 10 years ago

Ok, I'll try to come up with some better examples on how to use, since the test cases can be a bit confusing. Btw, also added support for Twisted last night, so now most of the Python event loops should be covered.

caente commented 10 years ago

So, schedule_relative means that the action will be executed every "duetime"?

caente commented 10 years ago

nvm,found the schedule_periodic

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.