Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/technohippy/appengine_multi_robot_runner
Run many wave robots on one GAE slot
https://github.com/technohippy/appengine_multi_robot_runner
Last synced: 19 days ago
JSON representation
Run many wave robots on one GAE slot
- Host: GitHub
- URL: https://github.com/technohippy/appengine_multi_robot_runner
- Owner: technohippy
- Created: 2010-03-25T06:47:37.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2010-04-14T16:02:01.000Z (almost 15 years ago)
- Last Synced: 2024-11-24T22:42:03.024Z (3 months ago)
- Language: Python
- Homepage: http://reviewmycode.blogspot.com/2010/04/google-wave-robot-multiplexer-again.html
- Size: 93.8 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
appengine_multi_robot_runner
============================This library allows you to run multiple robots on one GAE slot.
How to use
----------### Recommended way
If defining classes for robots, you can store them in separate files.
from waveapi import robot
from waveapi import events
import appengine_multi_robot_runner
class FooRobot(robot.Robot):
def __init__(self):
robot.Robot.__init__(self, 'Foo')
self.register_handler(events.BlipSubmitted, self.on_blip_submitted)
def on_blip_submitted(self, event, wavelet):
wavelet.reply('foo')
class BarRobot(robot.Robot):
def __init__(self):
robot.Robot.__init__(self, 'Bar')
self.register_handler(events.BlipSubmitted, self.on_blip_submitted)
def on_blip_submitted(self, event, wavelet):
wavelet.reply('bar')
if __name__ == '__main__':
appengine_multi_robot_runner.compound_and_run([
('foo', FooRobot()), # [email protected]
('bar', BarRobot()) # [email protected]
])### Or, you can do
from waveapi import robot
from waveapi import events
import appengine_multi_robot_runner
def on_submitted_foo(event, wavelet):
wavelet.reply('foo')
def on_submitted_bar(self, event, wavelet):
wavelet.reply('bar')
if __name__ == '__main__':
foo_robot = robot.Robot('Foo')
foo_robot.register_handler(events.BlipSubmitted, on_submitted_foo)
bar_robot = robot.Robot('Bar')
bar_robot.register_handler(events.BlipSubmitted, on_submitted_bar)
appengine_multi_robot_runner.compound_and_run([
('foo', foo_robot), # [email protected]
('bar', bar_robot) # [email protected]
])