promise_fuzzer.proto 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // Copyright 2021 gRPC authors.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package promise_fuzzer;
  16. message Seq {
  17. Promise first = 1;
  18. repeated PromiseFactory promise_factories = 2;
  19. }
  20. message Join {
  21. repeated Promise promises = 1;
  22. }
  23. message Race {
  24. repeated Promise promises = 1;
  25. }
  26. message Last {}
  27. message PromiseFactory {
  28. oneof promise_factory_type {
  29. // Return a specific promise
  30. Promise promise = 1;
  31. // Return the result of the last thing
  32. Last last = 2;
  33. }
  34. }
  35. message Never {}
  36. message ScheduleWaker {
  37. bool owning = 1;
  38. int32 waker = 2;
  39. }
  40. message Promise {
  41. oneof promise_type {
  42. // Seq combinator
  43. Seq seq = 1;
  44. // Join combinator
  45. Join join = 2;
  46. // Race combinator
  47. Race race = 3;
  48. // Never complete
  49. Never never = 4;
  50. // Sleep n times, then wakeup
  51. int32 sleep_first_n = 5;
  52. // Cancel and be pending
  53. Cancel cancel_from_inside = 6;
  54. // Wait for waker n, then continue
  55. ScheduleWaker wait_once_on_waker = 7;
  56. }
  57. }
  58. message Cancel {}
  59. message Wakeup {}
  60. message Action {
  61. oneof action_type {
  62. // Activity::ForceWakeup
  63. Wakeup force_wakeup = 1;
  64. // Cancel the activity
  65. Cancel cancel = 2;
  66. // Flush any pending scheduled wakeups
  67. Wakeup flush_wakeup = 3;
  68. // Awake waker n if it exists
  69. int32 awake_waker = 4;
  70. // Drop waker n if it exists
  71. int32 drop_waker = 5;
  72. }
  73. }
  74. message Msg {
  75. Promise promise = 1;
  76. repeated Action actions = 2;
  77. }