Zsolt Haraszti | e39523b | 2016-10-16 19:30:34 -0700 | [diff] [blame^] | 1 | syntax = "proto3"; |
| 2 | |
| 3 | package experiment; |
| 4 | |
| 5 | import "google/protobuf/empty.proto"; |
| 6 | |
| 7 | message AsyncEvent { |
| 8 | int32 seq = 1; |
| 9 | enum EventType { |
| 10 | BIG_BANG = 0; |
| 11 | SMALL_BANG = 1; |
| 12 | NO_BANG = 2; |
| 13 | } |
| 14 | EventType type = 2; |
| 15 | string details = 3; |
| 16 | } |
| 17 | |
| 18 | message Packet { |
| 19 | int32 source = 1; |
| 20 | bytes content = 2; |
| 21 | } |
| 22 | message Echo { |
| 23 | string msg = 1; |
| 24 | float delay = 2; |
| 25 | } |
| 26 | |
| 27 | service ExperimentalService { |
| 28 | |
| 29 | rpc GetEcho(Echo) returns(Echo); |
| 30 | |
| 31 | // For server to send async stream to client |
| 32 | rpc ReceiveStreamedEvents(google.protobuf.Empty) |
| 33 | returns(stream AsyncEvent); |
| 34 | |
| 35 | // For server to send async packets to client |
| 36 | rpc ReceivePackets(google.protobuf.Empty) returns(stream Packet); |
| 37 | |
| 38 | // For client to send async packets to server |
| 39 | rpc SendPackets(stream Packet) returns(google.protobuf.Empty); |
| 40 | |
| 41 | } |