Compare commits
1 Commits
dev
...
2fbac213c7
| Author | SHA1 | Date | |
|---|---|---|---|
| 2fbac213c7 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -119,4 +119,3 @@ GitHub.sublime-settings
|
||||
.history
|
||||
|
||||
*pb2*
|
||||
schemas
|
||||
|
||||
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
|
||||
@@ -1,18 +1,13 @@
|
||||
annotated-types==0.7.0
|
||||
certifi==2024.8.30
|
||||
charset-normalizer==3.4.0
|
||||
dnspython==2.7.0
|
||||
grpcio==1.68.1
|
||||
grpcio-tools==1.68.1
|
||||
idna==3.10
|
||||
motor==3.6.0
|
||||
protobuf==5.29.1
|
||||
pydantic==2.10.3
|
||||
pydantic_core==2.27.1
|
||||
pymongo==4.9
|
||||
pymongo==4.9.2
|
||||
python-dateutil==2.9.0.post0
|
||||
requests==2.32.3
|
||||
setuptools==75.6.0
|
||||
six==1.17.0
|
||||
typing_extensions==4.12.2
|
||||
urllib3==2.2.3
|
||||
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user