fix split tile size

rework inference events and handling
todo: add Medias table and reflect recognition status there
This commit is contained in:
Oleksandr Bezdieniezhnykh
2025-09-05 16:50:09 +03:00
parent 7d68f7faee
commit 9a16099194
14 changed files with 86 additions and 47 deletions
@@ -27,7 +27,7 @@ cdef class RemoteCommandHandler:
for _ in range(4): # 4 worker threads
worker = Thread(target=self._worker_loop, daemon=True)
self._workers.append(worker)
constants_inf.log(f'Listening to commands on port {zmq_port}...')
constants_inf.log(<str>f'Listening to commands on port {zmq_port}...')
cdef start(self):
self._proxy_thread.start()
@@ -39,7 +39,7 @@ cdef class RemoteCommandHandler:
zmq.proxy_steerable(self._router, self._dealer, control=self._control)
except zmq.error.ZMQError as e:
if self._shutdown_event.is_set():
constants_inf.log("Shutdown, exit proxy loop.")
constants_inf.log(<str>'Shutdown, exit proxy loop')
else:
raise
@@ -58,17 +58,19 @@ cdef class RemoteCommandHandler:
client_id, message = worker_socket.recv_multipart()
cmd = RemoteCommand.from_msgpack(<bytes> message)
cmd.client_id = client_id
constants_inf.log(str(cmd))
constants_inf.log(<str>f'<- {str(cmd)}')
self._on_command(cmd)
except Exception as e:
if not self._shutdown_event.is_set():
constants_inf.log(f"Worker error: {e}")
constants_inf.log(<str>f'Worker error: {e}')
import traceback
traceback.print_exc()
finally:
worker_socket.close()
cdef send(self, bytes client_id, bytes data):
cdef send(self, bytes client_id, RemoteCommand command):
constants_inf.log(<str> f'-> {str(command)}')
cdef bytes data = command.serialize()
self._router.send_multipart([client_id, data])
# with self._context.socket(zmq.DEALER) as socket: