three.MF.V3.Buffer
1from MF.V3.Task import Task as MF_V3_Task_Task 2from google.protobuf import any_pb2 as _any_pb2 3 4 5class Buffer: 6 """* 7 Generic buffer message for the Three Scanner. 8 9 Some tasks require the server and/or client to transfer binary data. In such cases the _buffer message_ is sent to inform the server/client what the data is and what task it belongs to. The binary data it refers to is sent immediately following the buffer message. 10 11 For example, `DownloadProject` requires the server to transfer a ZIP file containing the project data to the client. 12 13 > First, the client sends the task request to the server: 14 15 ```json 16 { 17 "Task":{ 18 "Index":1, 19 "Type":"DownloadProject", 20 "Input":5 21 } 22 } 23 ``` 24 25 > The server sends the buffer message telling the client to expect a binary data transfer and what to do with it. Note that the buffer message `Task` field echoes the task request, making it clear which request this data is a response to. 26 27 ```json 28 { 29 "Buffer":{ 30 "Descriptor":"Project-5.zip", 31 "Index":0, 32 "Size":15682096, 33 "Task":{ 34 "Index":1, 35 "Type":"DownloadProject", 36 "Input":5 37 } 38 } 39 } 40 ``` 41 42 > The server then sends the 15682096 byte data buffer of the project ZIP file. 43 > Finally, the server sends a task completion message. 44 45 ```json 46 { 47 "Task":{ 48 "Index":1, 49 "Type":"DownloadProject" 50 "Input":5, 51 "State":"Completed" 52 } 53 } 54 ``` 55 """ 56 def __init__(self, Index: int, Size: int, Task: MF_V3_Task_Task, Descriptor: _any_pb2 = None): 57 # The zero-based index identifying the data buffer. 58 self.Index = Index 59 # The size of the incoming data buffer in bytes. 60 self.Size = Size 61 # The task associated with the data buffer. This informs the client which request this data buffer corresponds to. 62 self.Task = Task 63 # Optional data buffer descriptor. See each task definition for details. 64 self.Descriptor = Descriptor
6class Buffer: 7 """* 8 Generic buffer message for the Three Scanner. 9 10 Some tasks require the server and/or client to transfer binary data. In such cases the _buffer message_ is sent to inform the server/client what the data is and what task it belongs to. The binary data it refers to is sent immediately following the buffer message. 11 12 For example, `DownloadProject` requires the server to transfer a ZIP file containing the project data to the client. 13 14 > First, the client sends the task request to the server: 15 16 ```json 17 { 18 "Task":{ 19 "Index":1, 20 "Type":"DownloadProject", 21 "Input":5 22 } 23 } 24 ``` 25 26 > The server sends the buffer message telling the client to expect a binary data transfer and what to do with it. Note that the buffer message `Task` field echoes the task request, making it clear which request this data is a response to. 27 28 ```json 29 { 30 "Buffer":{ 31 "Descriptor":"Project-5.zip", 32 "Index":0, 33 "Size":15682096, 34 "Task":{ 35 "Index":1, 36 "Type":"DownloadProject", 37 "Input":5 38 } 39 } 40 } 41 ``` 42 43 > The server then sends the 15682096 byte data buffer of the project ZIP file. 44 > Finally, the server sends a task completion message. 45 46 ```json 47 { 48 "Task":{ 49 "Index":1, 50 "Type":"DownloadProject" 51 "Input":5, 52 "State":"Completed" 53 } 54 } 55 ``` 56 """ 57 def __init__(self, Index: int, Size: int, Task: MF_V3_Task_Task, Descriptor: _any_pb2 = None): 58 # The zero-based index identifying the data buffer. 59 self.Index = Index 60 # The size of the incoming data buffer in bytes. 61 self.Size = Size 62 # The task associated with the data buffer. This informs the client which request this data buffer corresponds to. 63 self.Task = Task 64 # Optional data buffer descriptor. See each task definition for details. 65 self.Descriptor = Descriptor
* Generic buffer message for the Three Scanner.
Some tasks require the server and/or client to transfer binary data. In such cases the _buffer message_ is sent to inform the server/client what the data is and what task it belongs to. The binary data it refers to is sent immediately following the buffer message.
For example, DownloadProject
requires the server to transfer a ZIP file containing the project data to the client.
First, the client sends the task request to the server:
{
"Task":{
"Index":1,
"Type":"DownloadProject",
"Input":5
}
}
The server sends the buffer message telling the client to expect a binary data transfer and what to do with it. Note that the buffer message
Task
field echoes the task request, making it clear which request this data is a response to.
{
"Buffer":{
"Descriptor":"Project-5.zip",
"Index":0,
"Size":15682096,
"Task":{
"Index":1,
"Type":"DownloadProject",
"Input":5
}
}
}
The server then sends the 15682096 byte data buffer of the project ZIP file. Finally, the server sends a task completion message.
{
"Task":{
"Index":1,
"Type":"DownloadProject"
"Input":5,
"State":"Completed"
}
}
57 def __init__(self, Index: int, Size: int, Task: MF_V3_Task_Task, Descriptor: _any_pb2 = None): 58 # The zero-based index identifying the data buffer. 59 self.Index = Index 60 # The size of the incoming data buffer in bytes. 61 self.Size = Size 62 # The task associated with the data buffer. This informs the client which request this data buffer corresponds to. 63 self.Task = Task 64 # Optional data buffer descriptor. See each task definition for details. 65 self.Descriptor = Descriptor