Compare commits
No commits in common. "7ac53f9c8b90e29ee16dca1a1e7ad0450c6788bf" and "125bfe7fb7e0d352af4f32b00d221595fad80599" have entirely different histories.
7ac53f9c8b
...
125bfe7fb7
3
.gitignore
vendored
3
.gitignore
vendored
@ -118,5 +118,4 @@ GitHub.sublime-settings
|
||||
!.vscode/extensions.json
|
||||
.history
|
||||
|
||||
*pb2*
|
||||
schemas
|
||||
*pb2*
|
4
Makefile
4
Makefile
@ -1,6 +1,4 @@
|
||||
gen:
|
||||
curl https://platform.sprinthub.ru/generator >> generator.py
|
||||
python generator.py
|
||||
rm generator.py
|
||||
python -m grpc_tools.protoc --proto_path schemas --python_out=. --pyi_out=. --grpc_python_out=. ./schemas/tasks.proto
|
||||
run:
|
||||
python ./server.py
|
40
schemas/tasks.proto
Normal file
40
schemas/tasks.proto
Normal file
@ -0,0 +1,40 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package queues;
|
||||
|
||||
import "google/protobuf/struct.proto";
|
||||
|
||||
service Tasks {
|
||||
rpc Put (PutRequest) returns (EmptyResponse) {}
|
||||
|
||||
rpc Take (TakeRequest) returns (TakeResponse) {}
|
||||
|
||||
rpc Finish (FinishRequest) returns (EmptyResponse) {}
|
||||
}
|
||||
|
||||
message Task {
|
||||
string id = 1;
|
||||
int64 attempt = 2;
|
||||
google.protobuf.Struct payload = 3;
|
||||
}
|
||||
|
||||
message PutRequest {
|
||||
string queue = 1;
|
||||
int64 seconds_to_execute = 2;
|
||||
optional int64 delay = 3;
|
||||
google.protobuf.Struct payload = 4;
|
||||
}
|
||||
|
||||
message TakeRequest {
|
||||
string queue = 1;
|
||||
}
|
||||
|
||||
message FinishRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message EmptyResponse {}
|
||||
|
||||
message TakeResponse {
|
||||
optional Task task = 1;
|
||||
}
|
Loading…
Reference in New Issue
Block a user