Example #1
0
    def stop(self):
        self.__boot_event_sender.stop()
        FriServer.stop(self)
        for i in self.__process_threads:
            self.__operations_queue.put(FINISH_FLAG)

        self.__operations_queue.join()
Example #2
0
    def __init__(self, workers_count=3):
        self.__process_threads = []
        self.__operations_queue = Queue()
        self.__boot_event_sender = BootEventSenderThread()
        self.__boot_event_sender.start()

        #register service on bus
        dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
        #self.loop = gobject.MainLoop()
        bus = dbus.SystemBus()
        name = dbus.service.BusName(NODE_AGENT, bus)
        self.dbus_client = NodeAgentEventService(bus, '/events')

        for i in xrange(workers_count):
            thread = ProcessOperationThread(self.__operations_queue, self.dbus_client)
            thread.setName('ProcessOperationThread#%i'%i)
            self.__process_threads.append( thread )

            thread.start()

        FriServer.__init__(self, hostname='0.0.0.0', port=NODE_AGENT_BIND_PORT, workers_count=1)
 def __init__(self):
     self.__dbconn = DatabaseConnection()
     FriServer.__init__(self, hostname='0.0.0.0', port=LISTENER_PORT, workers_count=1)
    def __init__(self, callback_routine, workers_count):
        self.__onAsyncOperationResult = callback_routine

        FriServer.__init__(self, workers_count=workers_count)