长时运行,简化输入输出
流程:
- 编译 judger 和所有 gamer
- 运行 judger,获取 command
- 运行 gamer
- 运行 judger,直至 command=finish
- 返回 summary
ts 业务逻辑、拉取任务、返回 display(部分返回、最终结果返回) 输入
{
"code":{
"judger":{
"language":"",
"source":"",
"limit":{
"time":0,
"memory":0
}
},
"0":{
},
"1":{
}
}
}
输出
{
"compile":{
"judger":{
"time":{
"usr":0,
"sys":0,
"real":0
},
"memory":0,
"message":"",
"verdict": "OK"
},
"0":{
}
},
"round":[
{
"output":{
"command": "request",
"content": {
"0": "",
"1": ""
},
"display": "",
},
"time":{
"usr":0,
"sys":0,
"real":0
},
"memory":0,
"verdict": "OK"
},
{
"1": {
"memory": 0,
"time":{
"usr":0,
"sys":0,
"real":0
},
"verdict": "OK",
"raw": "1 6"
}
}
]
}
与 judger、gamer 通信,转发消息、返回 display、限制占用
流程:
- 运行 judger、gamer
- 获取 judger 输出、usage
- 解析 judger 输出
- 传入 gamer
- 获取 gamer 输出、usage
- 。。。
- 收到 finish
- kill everyone
获取 usage? 与 heng-core 通信。
输入
{
"0": {
"raw": "",
"verdict": "OK"
},
"1": {
}
}
输出
{
"command": "request",
"content": {
"0": "",
"1": ""
},
"display": ""
}
{
"command": "finish",
"content": {
"0": 1,
"1": -1
},
"display": ""
}
简化输入输出
输入
单行或多行,由 judger 提供
输出
单行