mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 15:36:30 +00:00
add pxd headers for correct work
fixes definitions can run until API call
This commit is contained in:
@@ -1,23 +1,13 @@
|
||||
import msgpack
|
||||
|
||||
cdef enum CommandType:
|
||||
INFERENCE = 1
|
||||
LOAD = 2
|
||||
|
||||
cdef enum ProcessorType:
|
||||
SOCKET = 1,
|
||||
RABBIT = 2
|
||||
|
||||
cdef class FileCommand:
|
||||
cdef str filename
|
||||
|
||||
def __init__(self, command_type: CommandType, processor_type: ProcessorType, str filename):
|
||||
def __init__(self, command_type: CommandType, ProcessorType processor_type, str filename):
|
||||
self.command_type = command_type
|
||||
self.processor_type = processor_type
|
||||
self.filename = filename
|
||||
|
||||
@staticmethod
|
||||
cdef from_msgpack(bytes data, processor_type: ProcessorType):
|
||||
cdef from_msgpack(bytes data, ProcessorType processor_type):
|
||||
unpacked = msgpack.unpackb(data, strict_map_key=False)
|
||||
return FileCommand(unpacked.get("CommandType"), processor_type, unpacked.get("Filename")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user