Skip to content
Snippets Groups Projects
Commit 81b12ed0 authored by jkerdreu's avatar jkerdreu
Browse files

Summary: Rollback to queue-less receive

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/trunk@2160 b32b6428-25c9-4566-ad07-03861ab6144f
parent 77f9efd6
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,7 @@ from .network import NetworkConnector
from .messages import MessageFactory
from .exceptions import *
from . import config
from . import tools
import time
import inspect
......@@ -89,7 +90,7 @@ class Engine(object):
# try to limit rate
cnt = cnt + 1
if cnt > config.queue_size:
time.sleep(0.1)
time.sleep(0.2)
break
......@@ -138,6 +139,7 @@ class Engine(object):
body = {}
body['devTypes'] = devtypes
msg = self.msg_factory.build_msg(dev, [], "request", "isAlive", body)
logger.warning(msg)
self.queue_msg(msg)
def process_alives(self):
......@@ -194,16 +196,16 @@ class Engine(object):
def remove_rx_hanlder(self,func):
self.rx_handlers.remove(func)
# ======== DEPRECATED ===================
def _process_rx_msg(self):
def process_rx_msg(self):
"""process incomming messages"""
msg = self.receive_msg()
if msg:
for func in self.rx_handlers:
func(msg)
# =========================================
self.process_attributesChange()
def process_rx_msg(self):
# ======== DEPRECATED ===================
def _process_rx_msg(self):
"""process incomming messages"""
cnt = 0
msg = self.receive_msg()
......@@ -215,6 +217,7 @@ class Engine(object):
cnt = cnt + 1
if cnt > config.queue_size: break
msg = self.receive_msg()
# =========================================
def handle_request(self, msg):
"""Filter msg for devices according default xAAL API then process the
......@@ -300,8 +303,8 @@ class Engine(object):
#####################################################
def loop(self):
"""Process incomming xAAL msg
Process attributes change for device
Process timers
Process attributes change for devices
Process isAlive for device
Send msgs from the Tx Buffer
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment