Skip to content

Commit

Permalink
feat(rsjudge-grpc): 🏗️ use chunk based fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
Jisu-Woniu committed Apr 18, 2024
1 parent 44f8343 commit 73e4ce9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions crates/rsjudge-grpc/proto/cases/v1/cases.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ package cases.v1;
// Fetch cases from backend server.
service CasesService {
// Fetch cases from the backend server.
rpc FetchCases(FetchCasesRequest) returns (FetchCasesResponse) {}
//
// Server should return cases in chunks. Each chunk should be around 1kiB.
rpc FetchCases(FetchCasesRequest) returns (stream FetchCasesResponse);
}

// Request to fetch cases from the backend server.
Expand All @@ -18,9 +20,12 @@ message FetchCasesRequest {
message FetchCasesResponse {
// The id of the cases requested.
int32 cases_id = 1;
// The tarball of the cases, with config file.
// The id of the chunk.
int32 chunk_id = 2;
// Chunk of the tarball, containing poblem config and cases.
//
// Chunk size should be around 1kiB.
//
// TODO: The tarball should be compressed in a specified format.
// Maybe .tar.zst
bytes tarball = 2;
// The tarball should be compressed in zstd.
bytes chunk = 3;
}
2 changes: 1 addition & 1 deletion crates/rsjudge-grpc/proto/register/v1/register.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package register.v1;
// The register service definition.
service RegisterService {
// Register a new rsjudge instance.
rpc Register(RegisterRequest) returns (RegisterResponse) {}
rpc Register(RegisterRequest) returns (RegisterResponse);
}

// Request to register a new rsjudge instance.
Expand Down

0 comments on commit 73e4ce9

Please sign in to comment.