Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    pysage 1.6.1

    Download button

    No screenshots available
    Downloads: 406  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    John S. Yang | More programs
    MIT/X Consortium Lic... / FREE
    November 12th, 2011, 04:15 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    pysage description

    lightweight high-level message passing library supporting actor based concurrency

    pysage is a lightweight high-level message passing Python library supporting actor based concurrency.

    It also extends the "actor model" to support actor partitioning/grouping to further scalability. pysage has a simple high-level interface. Messages are serialized and sent lightweight using pipes or domain sockets across local "groups". In the case of network messages, UDP is used.

    * simple pythonic API
    * efficient message propagation within group, across group, across network
    * network messages can optionally be configured to be reliable and/or ordered using UDP
    * grouping - actors can be partitioned into groups that are run in separate os processes
    * process-local singleton manager - actor registration, discovery, message propagation
    * publisher/subscriber pattern built-in

    pysage strives to stay thin and lightweight.

    Installation

    pysage can be installed via setuptools:

    easy_install pysage

    Usage

    Here, we have a simple actor that receives a "take damage" message in a 30 ticks/sec game loop.

    import time
    from pysage import Actor, ActorManager, Message

    mgr = ActorManager.get_singleton()

    class BombMessage(Message):
     properties = ['damage']
     packet_type = 101

    class Player(Actor):
     subscriptions = ['BombMessage']
     def handle_BombMessage(self, msg):
     print 'I took %s damage from the bomb' % msg.get_property('damage')

    mgr.register_actor(Player(), 'player1')
    mgr.queue_message(BombMessage(damage=10))

    while True:
     processed = mgr.tick()
     time.sleep(.03)


    pysage allows you to use this same simple API, for messaging across processes and networks.

    pysage does not confine you to the constraints of the "actor model". For example, the "grouping" concept allows many actors to reside in the same process. This allows you to avoid spawning too many os processes and reduce IPC overhead.

    Further, actors in the same group are local to each other, so they can have access to each other. It's kind of like a: "what happens in the group, stays in the group" concept. Although, using messages are encouraged instead of straight calls for most situations, even in the same pysage group.


    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    message passing | Python library | actor concurrency | Python | message | passing

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM