Major rework of gRPC handling (do not merge yet)
Includes the following chages:
* Refactored proto files
- separation of logical devices vs devices
- common flow related message types moved to openflow_13
- most RPC is defined in voltha.proto now
* Expanded RPC definitions to cover now most of what we
need (a few device provisioning RPCs are still missing)
* Reworked RPC handlers to work with new config tree
* Implemented test cases for all existing RPCs, tested via
chameleon's REST service
* Did away wih the OrderedDict internal representation
in the config nodes (3x performance boost on bulk
add, and negligible penalty in other ops)
* Refactored transacton merge handling to align with
new structures
Change-Id: I3740ec13b8296943b307782e86e6b596af78140e
diff --git a/common/utils/grpc_utils.py b/common/utils/grpc_utils.py
index 86abdba..b9cc8f7 100644
--- a/common/utils/grpc_utils.py
+++ b/common/utils/grpc_utils.py
@@ -20,6 +20,7 @@
from concurrent.futures import Future
from twisted.internet import reactor
from twisted.internet.defer import Deferred
+from twisted.python.threadable import isInIOThread
def twisted_async(func):
@@ -60,6 +61,10 @@
"""
def in_thread_wrapper(*args, **kw):
+ if isInIOThread():
+
+ return func(*args, **kw)
+
f = Future()
def twisted_wrapper():