diff --git a/bin/inputdemo b/bin/inputdemo --- a/bin/inputdemo +++ b/bin/inputdemo @@ -12,6 +12,7 @@ from light9 import showconfig, networkin from light9.rdfdb import clientsession from light9.rdfdb.syncedgraph import SyncedGraph import cyclone.httpclient +from light9.curvecalc.client import sendLiveInputPoint class App(object): def __init__(self): @@ -49,20 +50,10 @@ class App(object): win.show_all() def onChanged(self, scale): - f = cyclone.httpclient.fetch( - networking.curveCalc.path('liveInputPoint'), - method='POST', timeout=1, - postdata=urllib.urlencode({ - 'curve': self.curve, - 'value': str(scale.get_value()), - })) - @f.addCallback - def cb(result): - if result.code // 100 != 2: - log.error("curveCalc said %s: %s", result.code, result.body) + t1 = time.time() + d = sendLiveInputPoint(self.curve, scale.get_value()) + @d.addCallback + def done(result): print "posted in %.1f ms" % (1000 * (time.time() - t1)) - @f.addErrback - def eb(err): - print "err", err App()