Example #1
0
def main(environ, argv):
    greenhouse.global_exception_handler(traceback.print_exception)
    junction.configure_logging(level=1)

    hub = junction.Hub(("", 9057), [("", 9056)])
    hub.start()

    greenhouse.Event().wait()
Example #2
0
def main(environ, argv):
    greenhouse.global_exception_handler(traceback.print_exception)
    junction.configure_logging(level=1)

    hub = junction.Hub(("", 9056), [])
    hub.accept_rpc('service', 0, 0, 'echostream', handle)
    hub.start()

    greenhouse.Event().wait()
Example #3
0
def main(environ, argv):
    greenhouse.global_exception_handler(traceback.print_exception)
    junction.configure_logging(level=1)

    hub = junction.Hub(("", 9056), [])
    hub.accept_rpc('service', 0, 0, 'echostream', handle)
    hub.start()

    greenhouse.Event().wait()
Example #4
0
def main(environ, argv):
    greenhouse.global_exception_handler(traceback.print_exception)
    junction.configure_logging(level=1)

    port = 9056
    if argv[1:] and argv[1] == 'relay':
        port += 1

    #client = junction.Client(("", port))
    #client.connect()
    client = junction.Hub(("", port + 1), [("", port)])
    client.start()

    client.wait_connected()

    for line in client.rpc('service', 0, 'echostream', (gen_input(), )):
        print 'line:', line
Example #5
0
def main(environ, argv):
    greenhouse.global_exception_handler(traceback.print_exception)
    junction.configure_logging(level=1)

    port = 9056
    if argv[1:] and argv[1] == 'relay':
        port += 1

    #client = junction.Client(("", port))
    #client.connect()
    client = junction.Hub(("", port+1), [("", port)])
    client.start()

    client.wait_connected()

    for line in client.rpc(
            'service', 0, 'echostream', (gen_input(),)):
        print 'line:', line
Example #6
0
            code.co_firstlineno,
            code.co_lnotab,
            code.co_freevars,
            code.co_cellvars))

def load_func(s):
    def func():
        pass
    code = type(load_func.func_code)(*mummy.loads(s))
    func.func_code = code
    return func


if __name__ == '__main__':
    greenhouse.global_exception_handler(traceback.print_exception)
    junction.configure_logging(level=1)

    if sys.argv[1] == "mapper":
        hub = junction.Hub(("", 9090), [("", 9091), ("", 9092)])
        hub.start()
        mapper = Mapper(hub, 'map-reduce', 1)
        greenhouse.run_backdoor(("", 8090), locals())
    elif sys.argv[1] == "reducer":
        hub = junction.Hub(("", 9091), [("", 9090), ("", 9092)])
        hub.start()
        reducer = Reducer(hub, 'map-reduce', 0, 0)
        greenhouse.run_backdoor(("", 8091), locals())
    elif sys.argv[1] == "coordinator":
        hub = junction.Hub(("", 9092), [("", 9090), ("", 9091)])
        hub.start()
        coord = Coordinator(hub, 'map-reduce', 0, 0, 1)
Example #7
0
import junction

HOST = "127.0.0.1"
PORT = 9000

RELAY_HOST = HOST
RELAY_PORT = 9100

BACKHOST = HOST
BACKPORT = 9001

SERVICE = 1


greenhouse.global_exception_handler(traceback.print_exception)
junction.configure_logging()

def handler(x):
    return "echo: %s" % x


def main():
    hub = junction.Hub((HOST, PORT), [(RELAY_HOST, RELAY_PORT)])
    hub.start()

    hub.accept_rpc(SERVICE, 0, 0, "echo", handler)

    greenhouse.schedule(greenhouse.run_backdoor,
            args=((BACKHOST, BACKPORT), {'hub': hub}))

    try:
Example #8
0
#!/usr/bin/env python
# vim: fileencoding=utf8:et:sta:ai:sw=4:ts=4:sts=4

import traceback

import greenhouse
import junction

PORT = 9876
MIDDLEMAN_PORT = 9870

WAIT_SERVICE = 1

greenhouse.global_exception_handler(traceback.print_exception)
junction.configure_logging(level=1)


def wait(seconds):
    greenhouse.pause_for(seconds)


def main():
    hub = junction.Hub(("localhost", PORT), [("localhost", MIDDLEMAN_PORT)])
    hub.start()

    hub.accept_rpc(WAIT_SERVICE, 0, 0, "wait", wait)

    greenhouse.schedule(greenhouse.run_backdoor,
                        args=(("localhost", PORT + 1), {
                            'hub': hub
                        }))
Example #9
0
import greenhouse
import junction

HOST = "127.0.0.1"
PORT = 9000

RELAY_HOST = HOST
RELAY_PORT = 9100

BACKHOST = HOST
BACKPORT = 9001

SERVICE = 1

greenhouse.global_exception_handler(traceback.print_exception)
junction.configure_logging()


def handler(x):
    return "echo: %s" % x


def main():
    hub = junction.Hub((HOST, PORT), [(RELAY_HOST, RELAY_PORT)])
    hub.start()

    hub.accept_rpc(SERVICE, 0, 0, "echo", handler)

    greenhouse.schedule(greenhouse.run_backdoor,
                        args=((BACKHOST, BACKPORT), {
                            'hub': hub