feat(rcf): fix violation error by disabling timer
This commit is contained in:
23
client.py
23
client.py
@ -140,6 +140,8 @@ class RCFClientAgent(object):
|
|||||||
id = None
|
id = None
|
||||||
state = State.INITIAL
|
state = State.INITIAL
|
||||||
server = None
|
server = None
|
||||||
|
serial = None
|
||||||
|
serialisation_agent = None
|
||||||
|
|
||||||
def __init__(self, ctx, pipe):
|
def __init__(self, ctx, pipe):
|
||||||
self.ctx = ctx
|
self.ctx = ctx
|
||||||
@ -152,6 +154,11 @@ class RCFClientAgent(object):
|
|||||||
self.publisher.setsockopt(zmq.IDENTITY, self.id)
|
self.publisher.setsockopt(zmq.IDENTITY, self.id)
|
||||||
self.publisher.setsockopt(zmq.SNDHWM, 60)
|
self.publisher.setsockopt(zmq.SNDHWM, 60)
|
||||||
self.publisher.linger = 0
|
self.publisher.linger = 0
|
||||||
|
self.serial, peer = zpipe(self.ctx)
|
||||||
|
self.serial_agent = threading.Thread(
|
||||||
|
target=serialization_agent, args=(self.ctx, peer))
|
||||||
|
self.serial_agent.daemon = True
|
||||||
|
self.serial_agent.start()
|
||||||
|
|
||||||
def control_message(self):
|
def control_message(self):
|
||||||
msg = self.pipe.recv_multipart()
|
msg = self.pipe.recv_multipart()
|
||||||
@ -261,28 +268,26 @@ class SerializationAgent(object):
|
|||||||
ctx = None
|
ctx = None
|
||||||
pipe = None
|
pipe = None
|
||||||
|
|
||||||
def __init__(self, ctx, pipe_in, pipe_out):
|
def __init__(self, ctx, pipe):
|
||||||
self.ctx = ctx
|
self.ctx = ctx
|
||||||
self.pipe_in = pipe_in
|
self.pipe = pipe
|
||||||
self.pipe_out = pipe_out
|
logger.info("serialisation service launched")
|
||||||
|
|
||||||
def control_message(self):
|
def control_message(self):
|
||||||
msg = self.pipe_in.recv_multipart()
|
msg = self.pipe.recv_multipart()
|
||||||
command = msg.pop(0)
|
command = msg.pop(0)
|
||||||
|
|
||||||
if command == b"DUMP":
|
if command == b"DUMP":
|
||||||
key = umsgpack.unpackb(msg[0])
|
key = umsgpack.unpackb(msg[0])
|
||||||
|
|
||||||
logger.log("Dumping....")
|
|
||||||
|
|
||||||
elif command == b"LOAD":
|
elif command == b"LOAD":
|
||||||
key, value = msg
|
key, value = msg
|
||||||
logger.log("Loading....")
|
|
||||||
|
|
||||||
|
|
||||||
def serialization_agent(ctx, pipe_in, pipe_out):
|
def serialization_agent(ctx, pipe):
|
||||||
agent = SerializationAgent(ctx, pipe_in, pipe_out)
|
agent = SerializationAgent(ctx, pipe)
|
||||||
server = None
|
|
||||||
|
|
||||||
global stop
|
global stop
|
||||||
while True:
|
while True:
|
||||||
|
@ -304,7 +304,7 @@ def default_tick():
|
|||||||
# except Exception as e:
|
# except Exception as e:
|
||||||
# print("pull error: {}".format(e))
|
# print("pull error: {}".format(e))
|
||||||
|
|
||||||
bpy.ops.session.refresh()
|
# bpy.ops.session.refresh()
|
||||||
|
|
||||||
return 0.5
|
return 0.5
|
||||||
|
|
||||||
@ -620,7 +620,6 @@ def depsgraph_update(scene):
|
|||||||
updates = bpy.context.depsgraph.updates
|
updates = bpy.context.depsgraph.updates
|
||||||
# update_selected_object(bpy.context)
|
# update_selected_object(bpy.context)
|
||||||
push = False
|
push = False
|
||||||
|
|
||||||
# Update selected object
|
# Update selected object
|
||||||
|
|
||||||
# for update in updates.items():
|
# for update in updates.items():
|
||||||
|
Reference in New Issue
Block a user