event.pyx.pxi 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Copyright 2017 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. cdef class ConnectivityEvent:
  15. def __cinit__(
  16. self, grpc_completion_type completion_type, bint success, object tag):
  17. self.completion_type = completion_type
  18. self.success = success
  19. self.tag = tag
  20. cdef class RequestCallEvent:
  21. def __cinit__(
  22. self, grpc_completion_type completion_type, bint success, object tag,
  23. Call call, CallDetails call_details, tuple invocation_metadata):
  24. self.completion_type = completion_type
  25. self.success = success
  26. self.tag = tag
  27. self.call = call
  28. self.call_details = call_details
  29. self.invocation_metadata = invocation_metadata
  30. cdef class BatchOperationEvent:
  31. def __cinit__(
  32. self, grpc_completion_type completion_type, bint success, object tag,
  33. object batch_operations):
  34. self.completion_type = completion_type
  35. self.success = success
  36. self.tag = tag
  37. self.batch_operations = batch_operations
  38. cdef class ServerShutdownEvent:
  39. def __cinit__(
  40. self, grpc_completion_type completion_type, bint success, object tag):
  41. self.completion_type = completion_type
  42. self.success = success
  43. self.tag = tag