1__all__ = (

2 "maybe_async",

3 "maybe_async_cm",

4 "run",

5 "sleep",

6 "sleep_forever",

7 "sleep_until",

8 "current_time",

9 "get_all_backends",

10 "get_cancelled_exc_class",

11 "BrokenResourceError",

12 "BrokenWorkerProcess",

13 "BusyResourceError",

14 "ClosedResourceError",

15 "DelimiterNotFound",

16 "EndOfStream",

17 "ExceptionGroup",

18 "IncompleteRead",

19 "TypedAttributeLookupError",

20 "WouldBlock",

21 "AsyncFile",

22 "Path",

23 "open_file",

24 "wrap_file",

25 "aclose_forcefully",

26 "open_signal_receiver",

27 "connect_tcp",

28 "connect_unix",

29 "create_tcp_listener",

30 "create_unix_listener",

31 "create_udp_socket",

32 "create_connected_udp_socket",

33 "getaddrinfo",

34 "getnameinfo",

35 "wait_socket_readable",

36 "wait_socket_writable",

37 "create_memory_object_stream",

38 "run_process",

39 "open_process",

40 "create_lock",

41 "CapacityLimiter",

42 "CapacityLimiterStatistics",

43 "Condition",

44 "ConditionStatistics",

45 "Event",

46 "EventStatistics",

47 "Lock",

48 "LockStatistics",

49 "Semaphore",

50 "SemaphoreStatistics",

51 "create_condition",

52 "create_event",

53 "create_semaphore",

54 "create_capacity_limiter",

55 "open_cancel_scope",

56 "fail_after",

57 "move_on_after",

58 "current_effective_deadline",

59 "TASK_STATUS_IGNORED",

60 "CancelScope",

61 "create_task_group",

62 "TaskInfo",

63 "get_current_task",

64 "get_running_tasks",

65 "wait_all_tasks_blocked",

66 "run_sync_in_worker_thread",

67 "run_async_from_thread",

68 "run_sync_from_thread",

69 "current_default_worker_thread_limiter",

70 "create_blocking_portal",

71 "start_blocking_portal",

72 "typed_attribute",

73 "TypedAttributeSet",

74 "TypedAttributeProvider",

75)

76

77 from typing import Any

78

79 from ._core._compat import maybe_async, maybe_async_cm

80 from ._core._eventloop import (

81 current_time,

82 get_all_backends,

83 get_cancelled_exc_class,

84 run,

85 sleep,

86 sleep_forever,

87 sleep_until,

88)

89 from ._core._exceptions import (

90 BrokenResourceError,

91 BrokenWorkerProcess,

92 BusyResourceError,

93 ClosedResourceError,

94 DelimiterNotFound,

95 EndOfStream,

96 ExceptionGroup,

97 IncompleteRead,

98 TypedAttributeLookupError,

99 WouldBlock,

100)

101 from ._core._fileio import AsyncFile, Path, open_file, wrap_file

102 from ._core._resources import aclose_forcefully

103 from ._core._signals import open_signal_receiver

104 from ._core._sockets import (

105 connect_tcp,

106 connect_unix,

107 create_connected_udp_socket,

108 create_tcp_listener,

109 create_udp_socket,

110 create_unix_listener,

111 getaddrinfo,

112 getnameinfo,

113 wait_socket_readable,

114 wait_socket_writable,

115)

116 from ._core._streams import create_memory_object_stream

117 from ._core._subprocesses import open_process, run_process

118 from ._core._synchronization import (

119 CapacityLimiter,

120 CapacityLimiterStatistics,

121 Condition,

122 ConditionStatistics,

123 Event,

124 EventStatistics,

125 Lock,

126 LockStatistics,

127 Semaphore,

128 SemaphoreStatistics,

129 create_capacity_limiter,

130 create_condition,

131 create_event,

132 create_lock,

133 create_semaphore,

134)

135 from ._core._tasks import (

136 TASK_STATUS_IGNORED,

137 CancelScope,

138 create_task_group,

139 current_effective_deadline,

140 fail_after,

141 move_on_after,

142 open_cancel_scope,

143)

144 from ._core._testing import (

145 TaskInfo,

146 get_current_task,

147 get_running_tasks,

148 wait_all_tasks_blocked,

149)

150 from ._core._typedattr import TypedAttributeProvider, TypedAttributeSet, typed_attribute

151

152# Re-exported here, for backwards compatibility

153# isort: off

154 from .to_thread import current_default_worker_thread_limiter, run_sync_in_worker_thread

155 from .from_thread import (

156 create_blocking_portal,

157 run_async_from_thread,

158 run_sync_from_thread,

159 start_blocking_portal,

160)

161

162# Re-export imports so they look like they live directly in this package

163 key: str

164 value: Any

165 for key, value in list(locals().items()):

166 if getattr(value, "__module__", "").startswith("anyio."):

167 value.__module__ = __name__