Esempio n. 1
0
def main():
  iopoll = IOPoll()
  with iopoll.loop():
    NTHREADS = 8
    client = RaleighClient()
    with client.connection(iopoll, _RaleighJob.RALEIGH_HOST, _RaleighJob.RALEIGH_PORT):
      object_name = 'bench-number'
      data = client.semantic_create(object_name, RaleighNumber.TYPE)
      try:
        print 'Bench Number-Insert'
        bench_run(NTHREADS, NumberIncJob, data['oid'])
        print 'Bench Number-Get'
        bench_run(NTHREADS, NumberGetJob, data['oid'])
      finally:
        client.semantic_delete(object_name)