mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 14:46:31 +00:00
rewrite to zmq push and pull patterns.
file load works, suite can start up
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import msgpack
|
||||
|
||||
cdef class RemoteCommand:
|
||||
def __init__(self, CommandType command_type, str filename, bytes data):
|
||||
self.command_type = command_type
|
||||
self.filename = filename
|
||||
self.data = data
|
||||
|
||||
def __str__(self):
|
||||
command_type_names = {
|
||||
1: "INFERENCE",
|
||||
2: "LOAD",
|
||||
}
|
||||
return f'{command_type_names[self.command_type]}: {self.filename}'
|
||||
|
||||
@staticmethod
|
||||
cdef from_msgpack(bytes data):
|
||||
unpacked = msgpack.unpackb(data, strict_map_key=False)
|
||||
return RemoteCommand(unpacked.get("CommandType"), unpacked.get("Filename"), unpacked.get("Data"))
|
||||
Reference in New Issue
Block a user