Exemplo n.º 1
0
Arquivo: Face.py Projeto: cawka/PyNDN
 def run(self, timeoutms):
     assert not _pyndn.is_run_executing(self.ndn_data), "Command should be called when ndn_run is not running"
     self._handle_lock.acquire()
     try:
         _pyndn.run(self.ndn_data, timeoutms)
     finally:
         self._handle_lock.release()
Exemplo n.º 2
0
 def run(self, timeoutms):
     assert not _pyndn.is_run_executing(
         self.ndn_data
     ), "Command should be called when ndn_run is not running"
     self._handle_lock.acquire()
     try:
         _pyndn.run(self.ndn_data, timeoutms)
     finally:
         self._handle_lock.release()
Exemplo n.º 3
0
 def output_is_pending(self):
     assert not _pyndn.is_run_executing(
         self.ndn_data
     ), "Command should be called when ndn_run is not running"
     return _pyndn.output_is_pending(self.ndn_data)
Exemplo n.º 4
0
 def process_scheduled(self):
     assert not _pyndn.is_run_executing(
         self.ndn_data
     ), "Command should be called when ndn_run is not running"
     return _pyndn.process_scheduled_operations(self.ndn_data)
Exemplo n.º 5
0
 def _release_lock(self, tag):
     if not _pyndn.is_run_executing(self.ndn_data):
         #            print("%s: releasing lock" % tag)
         self._handle_lock.release()
Exemplo n.º 6
0
 def _acquire_lock(self, tag):
     if not _pyndn.is_run_executing(self.ndn_data):
         #            print("%s: acquiring lock" % tag)
         self._handle_lock.acquire()
Exemplo n.º 7
0
Arquivo: Face.py Projeto: cawka/PyNDN
 def output_is_pending(self):
     assert not _pyndn.is_run_executing(self.ndn_data), "Command should be called when ndn_run is not running"
     return _pyndn.output_is_pending(self.ndn_data)
Exemplo n.º 8
0
Arquivo: Face.py Projeto: cawka/PyNDN
 def process_scheduled(self):
     assert not _pyndn.is_run_executing(self.ndn_data), "Command should be called when ndn_run is not running"
     return _pyndn.process_scheduled_operations(self.ndn_data)
Exemplo n.º 9
0
Arquivo: Face.py Projeto: cawka/PyNDN
    def _release_lock(self, tag):
        if not _pyndn.is_run_executing(self.ndn_data):
#            print("%s: releasing lock" % tag)
            self._handle_lock.release()
Exemplo n.º 10
0
Arquivo: Face.py Projeto: cawka/PyNDN
    def _acquire_lock(self, tag):
        if not _pyndn.is_run_executing(self.ndn_data):
#            print("%s: acquiring lock" % tag)
            self._handle_lock.acquire()
Exemplo n.º 11
0
 def stop(self):
     self.running = False
     for fd, handle in zip(self.fds.keys(), self.fds.values()):
         # disconnect only when nothing is running, otherwise segfaul guaranteed
         if not _pyndn.is_run_executing(handle.ndn_data):
             handle.disconnect()
Exemplo n.º 12
0
 def stop(self):
     self.running = False
     for fd, handle in zip(self.fds.keys(), self.fds.values()):
         # disconnect only when nothing is running, otherwise segfaul guaranteed
         if not _pyndn.is_run_executing (handle.ndn_data):
             handle.disconnect ()