Esempio n. 1
0
def process3():
	print("PROCESS 3", os.getpid())
	bus = FullBus()
	await(sleep(0.1))
	connection = bus.bootstrapOnURI("tcp://localhost:1292")
	client = bus.connection()
	await(sleep(0.25))
	echoService.offerOn(connection)
	gateway = EchoService.on(client)
	print("EchoService")
	test = gateway.Test(5)
	try:
		test.echo("blarg")
	except:
		pass
	test.echo("blarg")
	a = [test.echo.async("blarg") for i in range(100)]
Esempio n. 2
0
from ripley.bus import *
from ripley.transport import *

import test_iface
from test_iface import EchoService

@implements(test_iface.Test)
class Test:
	def __init__(self, a):
		self.a = a
	def echo(self, msg):
		self.a+=1
		return "%s:%d"%(msg,self.a), self.a


echoService = EchoService.implementation(
	Test)



def process1():
	print("PROCESS 1", os.getpid())
	bus = FullBus()
	server = SocketStreamServer(1292)
	busMaster = BusMaster(bus)
	connection = bus.bootstrapOnLocalMaster(busMaster)
	server.entryServer(connection)
	await(sleep(20))
	#await(transport.release())

import time
def process2():