Skip to content

Commit

Permalink
feat: add stream response to DownloadTask (#212)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Nov 15, 2023
1 parent 3394a57 commit 6d86592
Show file tree
Hide file tree
Showing 9 changed files with 640 additions and 127 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dragonfly-api"
version = "2.0.49"
version = "2.0.50"
authors = ["Gaius <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
237 changes: 153 additions & 84 deletions pkg/apis/dfdaemon/v2/dfdaemon.pb.go

Large diffs are not rendered by default.

142 changes: 142 additions & 0 deletions pkg/apis/dfdaemon/v2/dfdaemon.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion pkg/apis/dfdaemon/v2/dfdaemon.proto
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ message DownloadTaskRequest {
common.v2.Download download = 1 [(validate.rules).message.required = true];
}

// DownloadTaskResponse represents response of DownloadTask.
message DownloadTaskResponse {
// Finished piece of task.
common.v2.Piece piece = 1 [(validate.rules).message.required = true];
}

// UploadTaskRequest represents request of UploadTask.
message UploadTaskRequest {
// Task metadata.
Expand Down Expand Up @@ -102,7 +108,7 @@ service Dfdaemon {
rpc SyncPieces(stream SyncPiecesRequest)returns(stream SyncPiecesResponse);

// DownloadTask downloads task back-to-source.
rpc DownloadTask(DownloadTaskRequest) returns(google.protobuf.Empty);
rpc DownloadTask(DownloadTaskRequest) returns(stream DownloadTaskResponse);

// UploadTask uploads task to p2p network.
rpc UploadTask(UploadTaskRequest) returns(google.protobuf.Empty);
Expand Down
81 changes: 54 additions & 27 deletions pkg/apis/dfdaemon/v2/dfdaemon_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6d86592

Please sign in to comment.