def run_application(self, nb_worker=8, nb_operations=100): thread_list = [] for i in range(nb_worker): client = myClient(self.node_id, i, nb_operations, self.key_range, self.send_queue, self.recv_queue, self.performance_queue, self._lock, self.metrics) thread_list.append(client) client.start() RepeatTimer(self.interval, self.monitor_thread).start() for thread in thread_list: thread.join()
# this instantiates our watcher watcher=PathWatcher(directory_to_watch,regex) # our container for keeping a record of the data tracker=rtpDataTracker() # the way we would like to process the data. calc = TwoROIDiff() # 2roicalculator.init(training=30,...) # this is our nice little client (to send stuff), client=myClient(server_address, port_number) while True: if watcher.isAdded(): if len(watcher.added) == 1: # add data from the new file... tracker.update(watcher.added[0]) # update/process percentage = calc.process(tracker) # send the percentage score.
#! /usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Lukasz Busko' __email__ = '*****@*****.**' __licenes__= 'Licenes GPL' try: import sys import time #Moje from myClient import myClient except ImportError, error: print "[Menu]->", error time.sleep(2) sys.exit(1) #MAIN if __name__ == "__main__": myClient()