Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

225 rindas
5.9 KiB

  1. # cython: language_level=3
  2. from .includes cimport uv
  3. from .includes cimport system
  4. from libc.stdint cimport uint64_t, uint32_t, int64_t
  5. include "includes/consts.pxi"
  6. cdef extern from *:
  7. ctypedef int vint "volatile int"
  8. cdef class UVHandle
  9. cdef class UVSocketHandle(UVHandle)
  10. cdef class UVAsync(UVHandle)
  11. cdef class UVTimer(UVHandle)
  12. cdef class UVIdle(UVHandle)
  13. cdef class UVBaseTransport(UVSocketHandle)
  14. ctypedef object (*method_t)(object)
  15. ctypedef object (*method1_t)(object, object)
  16. ctypedef object (*method2_t)(object, object, object)
  17. ctypedef object (*method3_t)(object, object, object, object)
  18. cdef class Loop:
  19. cdef:
  20. uv.uv_loop_t *uvloop
  21. bint _coroutine_debug_set
  22. int _coroutine_origin_tracking_saved_depth
  23. public slow_callback_duration
  24. readonly bint _closed
  25. bint _debug
  26. bint _running
  27. bint _stopping
  28. uint64_t _thread_id
  29. bint _thread_is_main
  30. object _task_factory
  31. object _exception_handler
  32. object _default_executor
  33. object _ready
  34. set _queued_streams
  35. Py_ssize_t _ready_len
  36. set _servers
  37. object _transports
  38. set _processes
  39. dict _fd_to_reader_fileobj
  40. dict _fd_to_writer_fileobj
  41. set _signals
  42. dict _signal_handlers
  43. object _ssock
  44. object _csock
  45. bint _listening_signals
  46. set _timers
  47. dict _polls
  48. UVProcess active_process_handler
  49. UVAsync handler_async
  50. UVIdle handler_idle
  51. UVCheck handler_check__exec_writes
  52. object _last_error
  53. cdef object __weakref__
  54. object _asyncgens
  55. bint _asyncgens_shutdown_called
  56. char _recv_buffer[UV_STREAM_RECV_BUF_SIZE]
  57. bint _recv_buffer_in_use
  58. # DEBUG fields
  59. # True when compiled with DEBUG.
  60. # Used only in unittests.
  61. readonly bint _debug_cc
  62. readonly object _debug_handles_total
  63. readonly object _debug_handles_closed
  64. readonly object _debug_handles_current
  65. readonly uint64_t _debug_uv_handles_total
  66. readonly uint64_t _debug_uv_handles_freed
  67. readonly uint64_t _debug_cb_handles_total
  68. readonly uint64_t _debug_cb_handles_count
  69. readonly uint64_t _debug_cb_timer_handles_total
  70. readonly uint64_t _debug_cb_timer_handles_count
  71. readonly uint64_t _debug_stream_shutdown_errors_total
  72. readonly uint64_t _debug_stream_listen_errors_total
  73. readonly uint64_t _debug_stream_read_cb_total
  74. readonly uint64_t _debug_stream_read_cb_errors_total
  75. readonly uint64_t _debug_stream_read_eof_total
  76. readonly uint64_t _debug_stream_read_eof_cb_errors_total
  77. readonly uint64_t _debug_stream_read_errors_total
  78. readonly uint64_t _debug_stream_write_tries
  79. readonly uint64_t _debug_stream_write_errors_total
  80. readonly uint64_t _debug_stream_write_ctx_total
  81. readonly uint64_t _debug_stream_write_ctx_cnt
  82. readonly uint64_t _debug_stream_write_cb_errors_total
  83. readonly uint64_t _poll_read_events_total
  84. readonly uint64_t _poll_read_cb_errors_total
  85. readonly uint64_t _poll_write_events_total
  86. readonly uint64_t _poll_write_cb_errors_total
  87. readonly uint64_t _sock_try_write_total
  88. readonly uint64_t _debug_exception_handler_cnt
  89. cdef _init_debug_fields(self)
  90. cdef _on_wake(self)
  91. cdef _on_idle(self)
  92. cdef __run(self, uv.uv_run_mode)
  93. cdef _run(self, uv.uv_run_mode)
  94. cdef _close(self)
  95. cdef _stop(self, exc)
  96. cdef uint64_t _time(self)
  97. cdef inline _queue_write(self, UVStream stream)
  98. cdef _exec_queued_writes(self)
  99. cdef inline _call_soon(self, object callback, object args, object context)
  100. cdef inline _call_soon_handle(self, Handle handle)
  101. cdef _call_later(self, uint64_t delay, object callback, object args,
  102. object context)
  103. cdef void _handle_exception(self, object ex)
  104. cdef inline _new_future(self)
  105. cdef inline _check_signal(self, sig)
  106. cdef inline _check_closed(self)
  107. cdef inline _check_thread(self)
  108. cdef _getaddrinfo(self, object host, object port,
  109. int family, int type,
  110. int proto, int flags,
  111. int unpack)
  112. cdef _getnameinfo(self, system.sockaddr *addr, int flags)
  113. cdef _track_transport(self, UVBaseTransport transport)
  114. cdef _fileobj_to_fd(self, fileobj)
  115. cdef _ensure_fd_no_transport(self, fd)
  116. cdef _track_process(self, UVProcess proc)
  117. cdef _untrack_process(self, UVProcess proc)
  118. cdef _add_reader(self, fd, Handle handle)
  119. cdef _has_reader(self, fd)
  120. cdef _remove_reader(self, fd)
  121. cdef _add_writer(self, fd, Handle handle)
  122. cdef _has_writer(self, fd)
  123. cdef _remove_writer(self, fd)
  124. cdef _sock_recv(self, fut, sock, n)
  125. cdef _sock_recv_into(self, fut, sock, buf)
  126. cdef _sock_sendall(self, fut, sock, data)
  127. cdef _sock_accept(self, fut, sock)
  128. cdef _sock_connect(self, sock, address)
  129. cdef _sock_connect_cb(self, fut, sock, address)
  130. cdef _sock_set_reuseport(self, int fd)
  131. cdef _setup_signals(self)
  132. cdef _shutdown_signals(self)
  133. cdef _recv_signals_start(self)
  134. cdef _recv_signals_stop(self)
  135. cdef _handle_signal(self, sig)
  136. cdef _read_from_self(self)
  137. cdef inline _ceval_process_signals(self)
  138. cdef _invoke_signals(self, bytes data)
  139. cdef _set_coroutine_debug(self, bint enabled)
  140. cdef _print_debug_info(self)
  141. include "cbhandles.pxd"
  142. include "handles/handle.pxd"
  143. include "handles/async_.pxd"
  144. include "handles/idle.pxd"
  145. include "handles/check.pxd"
  146. include "handles/timer.pxd"
  147. include "handles/poll.pxd"
  148. include "handles/basetransport.pxd"
  149. include "handles/stream.pxd"
  150. include "handles/streamserver.pxd"
  151. include "handles/tcp.pxd"
  152. include "handles/pipe.pxd"
  153. include "handles/process.pxd"
  154. include "request.pxd"
  155. include "sslproto.pxd"
  156. include "handles/udp.pxd"
  157. include "server.pxd"