Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add stream response to DownloadTask #212

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading