xref: /aosp_15_r20/external/grpc-grpc/src/python/grpcio/grpc/_cython/_cygrpc/event.pyx.pxi (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
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
15cdef class ConnectivityEvent(BaseEvent):
16
17  def __cinit__(
18      self, grpc_completion_type completion_type, bint success, object tag):
19    self.completion_type = completion_type
20    self.success = success
21    self.tag = tag
22
23
24cdef class RequestCallEvent(BaseEvent):
25
26  def __cinit__(
27      self, grpc_completion_type completion_type, bint success, object tag,
28      Call call, CallDetails call_details, tuple invocation_metadata):
29    self.completion_type = completion_type
30    self.success = success
31    self.tag = tag
32    self.call = call
33    self.call_details = call_details
34    self.invocation_metadata = invocation_metadata
35
36
37cdef class BatchOperationEvent(BaseEvent):
38
39  def __cinit__(
40      self, grpc_completion_type completion_type, bint success, object tag,
41      object batch_operations):
42    self.completion_type = completion_type
43    self.success = success
44    self.tag = tag
45    self.batch_operations = batch_operations
46
47
48cdef class ServerShutdownEvent(BaseEvent):
49
50  def __cinit__(
51      self, grpc_completion_type completion_type, bint success, object tag):
52    self.completion_type = completion_type
53    self.success = success
54    self.tag = tag
55