Home | History | Annotate | Download | only in _cygrpc
      1 # Copyright 2015 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 
     15 
     16 cdef _check_call_error_no_metadata(c_call_error)
     17 
     18 
     19 cdef _check_and_raise_call_error_no_metadata(c_call_error)
     20 
     21 
     22 cdef _check_call_error(c_call_error, metadata)
     23 
     24 
     25 cdef class _CallState:
     26 
     27   cdef grpc_call *c_call
     28   cdef set due
     29 
     30 
     31 cdef class _ChannelState:
     32 
     33   cdef object condition
     34   cdef grpc_channel *c_channel
     35   # A boolean field indicating that the channel is open (if True) or is being
     36   # closed (i.e. a call to close is currently executing) or is closed (if
     37   # False).
     38   # TODO(https://github.com/grpc/grpc/issues/3064): Eliminate "is being closed"
     39   # a state in which condition may be acquired by any thread, eliminate this
     40   # field and just use the NULLness of c_channel as an indication that the
     41   # channel is closed.
     42   cdef object open
     43   cdef object closed_reason
     44 
     45   # A dict from _BatchOperationTag to _CallState
     46   cdef dict integrated_call_states
     47   cdef grpc_completion_queue *c_call_completion_queue
     48 
     49   # A set of _CallState
     50   cdef set segregated_call_states
     51 
     52   cdef set connectivity_due
     53   cdef grpc_completion_queue *c_connectivity_completion_queue
     54 
     55 
     56 cdef class IntegratedCall:
     57 
     58   cdef _ChannelState _channel_state
     59   cdef _CallState _call_state
     60 
     61 
     62 cdef class SegregatedCall:
     63 
     64   cdef _ChannelState _channel_state
     65   cdef _CallState _call_state
     66   cdef grpc_completion_queue *_c_completion_queue
     67 
     68 
     69 cdef class Channel:
     70 
     71   cdef grpc_arg_pointer_vtable _vtable
     72   cdef _ChannelState _state
     73 
     74   # TODO(https://github.com/grpc/grpc/issues/15662): Eliminate this.
     75   cdef tuple _arguments
     76