def main(): session = Remote.new_session('[email protected]/rpc', '*****') thermostat = session.new_handler(ANY_ALL, Thermostat, 18) thermostat.wait_for_release() session.close()
def run(func, args): config.init('../xmpp.conf') client_jid = config.get('users', 'client_jid') client_password = config.get('users', 'client_password') server_jid = config.get('users', 'server_jid') session = Remote.new_session(client_jid, client_password) endpoint = session.new_proxy(server_jid + '/rpc', TestRunner) job = Future() heartbeat = Heartbeat(job, endpoint.ping, session) heartbeat.start() getattr(endpoint.async(job), func)(*args)
def main(): session = Remote.new_session('[email protected]/rpc', '*****') thermostat = session.new_proxy('[email protected]/rpc', Thermostat) print("Current temperature is %s" % thermostat.get_temperature()) thermostat.set_temperature(20) time.sleep(10) session.close()
def main(): session = Remote.new_session('[email protected]/rpc', '*****') session.new_handler(ANY_ALL, Boomerang) boomerang = session.new_proxy('[email protected]/rpc', Boomerang) callback = Future() boomerang. async (callback).throw() time.sleep(10) session.close()
def main(): session = Remote.new_session('[email protected]/rpc', '*****') session.new_handler(ANY_ALL, Boomerang) boomerang = session.new_proxy('[email protected]/rpc', Boomerang) callback = Future() boomerang.async(callback).throw() time.sleep(10) session.close()