Pykka - Actors For Python
pykka.readthedocs.org
Pykka - Actors For Python
1–10 of 17 posts
Re: Pykka - Actors For Python
#2http://docs.python.org/library/xmlrpclib.html#example-of-cli...
Re: Pykka - Actors For Python
#3How is it different from xmlrpclib? http://docs.python.org/library/xmlrpclib.html#example-of-cli...
Re: Pykka - Actors For Python
#4How is it different from xmlrpclib? http://docs.python.org/library/xmlrpclib.html#example-of-cli...
Pykka helps multiple threads (or eventlets if using pykka.gevent) in a single program to communicate in a safe and easy matter without requiring the developer to manage locks and whatnot that he would have if he used plain threads. Under the hood Pykka is just an abstraction on top of threads and queues.
It's not uncommon for actor frameworks, like Akka, to support communication between actors on different computers, but there is currently no support for remote actors in Pykka.
Re: Pykka - Actors For Python
#5How is it different from xmlrpclib? http://docs.python.org/library/xmlrpclib.html#example-of-cli...
They're not even comparable. xmlrpclib is a library for remote procedure call. Pykka provides an implementation of the Actor model, which is a model of concurrent computation.
* send a finite number of messages to other actors; * create a finite number of new actors; * designate the behavior to be used for the next message receives.
Now, I'm not saying that xmlrpclib and actors are the same, but one could implement a system that has these properties using xmlrpclib as the basis of transport, and to "designate the behavior to be used for the next message receieves." The way you'd designate is the message you sent, is the handler that gets run.
And, if you want to get even more actor like, run xmlrpc servers in their own threads.
But, yeah, a real actor system would probably never do this.
Re: Pykka - Actors For Python
#6Re: Pykka - Actors For Python
#7Re: Pykka - Actors For Python
#8Re: Pykka - Actors For Python
#9Won't the GIL really limit the performance of this?
http://dabeaz.blogspot.com/2012/03/pycon-2012-followup.html
"In any case, the performance of threads is highly specific to the application at hand. You can't just take some benchmark from one of my GIL talks and extrapolate that out to a general statement about all Python thread programming. Personally, I find that Python threads have worked pretty well for most of the problems where I've used them. Of course your mileage might vary."
So.... maybe, it depends on what you are doing.
Personally I would have been happy to see ProcessingActor in pykka, maybe with 0mq for the ipc. That would be cool, but this looks useful nonetheless.