MCPcopy Create free account

hub / github.com/agronholm/anyio / functions

Functions2,553 in github.com/agronholm/anyio

↓ 256 callersFunctioncreate_task_group
Create a task group. :return: a task group :raises NoEventLoopError: if no supported asynchronous event loop is running in the c
src/anyio/_core/_tasks.py:238
↓ 224 callersMethodstart_soon
Start a new task in this task group. :param func: a coroutine function :param args: positional arguments to call the functio
src/anyio/abc/_tasks.py:138
↓ 175 callersMethodcancel
Cancel this task group's cancel scope immediately. This is a shortcut for calling ``.cancel_scope.cancel()`` on the task group.
src/anyio/abc/_tasks.py:105
↓ 102 callersFunctionwait_all_tasks_blocked
Wait until all other tasks are waiting for something.
src/anyio/_core/_testing.py:80
↓ 86 callersFunctioncheckpoint
Check for cancellation and allow the scheduler to switch to another task. Equivalent to (but more efficient than):: await checkpoin
src/anyio/lowlevel.py:28
↓ 84 callersMethodclose
Shutdown and close event loop.
src/anyio/_backends/_asyncio.py:158
↓ 77 callersFunctionrun
Call a coroutine function from a worker thread. :param func: a coroutine function :param args: positional arguments for the callable
src/anyio/from_thread.py:68
↓ 75 callersMethodaclose
(self)
tests/streams/test_stapled.py:52
↓ 73 callersMethodextra
(self, attribute: T_Attr)
src/anyio/_core/_typedattr.py:62
↓ 71 callersFunctionsleep
Pause the current task for the specified duration. :param delay: the duration, in seconds :raises ValueError: if ``delay`` is negative (
src/anyio/_core/_eventloop.py:88
↓ 66 callersMethodappend
(x: int, task_status: TaskStatus)
tests/test_synchronization.py:890
↓ 63 callersMethodstart
( self, func: Callable[..., Coroutine[Any, Any, T_co]], *args: object, name: o
src/anyio/abc/_tasks.py:161
↓ 60 callersFunctionget_async_backend
(asynclib_name: str | None = None)
src/anyio/_core/_eventloop.py:195
↓ 52 callersMethodwait
Waits for the future to finish. This method will attempt to wait for a result or exception
src/anyio/_core/_futures.py:78
↓ 51 callersFunctionconnect_tcp
( remote_host: IPAddressType, remote_port: int, *, local_host: IPAddressType | None = ...,
src/anyio/_core/_sockets.py:73
↓ 50 callersMethodset
Set the value of this run variable for the current event loop. :param value: the new value :return: a token that can be used
src/anyio/lowlevel.py:189
↓ 49 callersMethodreceive
()
tests/test_sockets.py:1635
↓ 44 callersFunctioncollect
(iterator: AsyncIterator[T])
tests/test_itertools.py:46
↓ 42 callersMethodsend
()
tests/test_sockets.py:296
↓ 40 callersMethodget
(self, default: D)
src/anyio/lowlevel.py:161
↓ 39 callersMethodmatch
( self, path_pattern: str, *, case_sensitive: bool | None = None )
src/anyio/_core/_fileio.py:490
↓ 39 callersFunctionstart_blocking_portal
Start a new event loop in a new thread and run a blocking portal in its main task. The parameters are the same as for :func:`~anyio.run`.
src/anyio/from_thread.py:607
↓ 38 callersFunctionget_cancelled_exc_class
Return the current async library's cancellation exception class. :raises NoEventLoopError: if no supported asynchronous event loop is runnin
src/anyio/_core/_eventloop.py:166
↓ 37 callersMethodcreate_task
Create a new task from a coroutine object and schedule it to run. :param coro: a coroutine object :param name: optional name
src/anyio/abc/_tasks.py:119
↓ 37 callersMethodsleep
Pause the current task for the specified duration. :param delay: the duration, in seconds
src/anyio/abc/_eventloop.py:143
↓ 36 callersMethodreceive
(self, max_bytes: int = 65536)
tests/streams/test_stapled.py:29
↓ 35 callersMethodsend
(self, item: bytes)
tests/streams/test_stapled.py:46
↓ 33 callersFunctionfail_after
Create a context manager which raises a :class:`TimeoutError` if the code in the enclosing context block does not finish in time. :param
src/anyio/_core/_tasks.py:159
↓ 32 callersMethodrun
Run a coroutine inside the embedded event loop.
src/anyio/_backends/_asyncio.py:182
↓ 31 callersFunctionaiter_from
(iterable: Iterable[T])
tests/test_itertools.py:69
↓ 28 callersFunctionassert_cancelled_on_first_next
(iterator: AsyncIterator[Any])
tests/test_itertools.py:73
↓ 28 callersMethodcheckpoint
(cls)
src/anyio/_backends/_asyncio.py:2636
↓ 28 callersFunctionconnect_unix
Connect to the given UNIX socket. Not available on Windows. :param path: path to the socket :param kind: socket type (``SOCK_STREAM
src/anyio/_core/_sockets.py:290
↓ 27 callersMethodstarted
(self: TaskStatus[None])
src/anyio/abc/_tasks.py:76
↓ 26 callersMethodfrom_socket
Wrap an existing socket object or file descriptor as a UDP socket. The newly created socket wrapper takes ownership of the socket be
src/anyio/abc/_sockets.py:294
↓ 24 callersFunctionfunc
()
tests/test_lowlevel.py:20
↓ 24 callersMethodset
(self)
src/anyio/_backends/_trio.py:723
↓ 24 callersMethodwait
(self)
src/anyio/_backends/_trio.py:716
↓ 23 callersFunctioncheckpoint_if_cancelled
Enter a checkpoint if the enclosing cancel scope has been cancelled. This does not allow the scheduler to switch to a different task. .
src/anyio/lowlevel.py:43
↓ 22 callersMethodadd
(a: int, b: int)
tests/test_itertools.py:865
↓ 22 callersFunctioncreate_tcp_listener
Create a TCP socket listener. :param local_port: port number to listen on :param local_host: IP address of the interface to listen on. I
src/anyio/_core/_sockets.py:311
↓ 22 callersMethodwrite
(self: AsyncFile[bytes], b: ReadableBuffer)
src/anyio/_core/_fileio.py:140
↓ 21 callersMethodcall
( self, func: Callable[..., T_Retval], args: tuple[Any, ...], )
src/anyio/to_interpreter.py:47
↓ 21 callersMethodcreate_task_group
(cls)
src/anyio/abc/_eventloop.py:173
↓ 21 callersMethodwrite_text
( self, data: str, encoding: str | None = None, errors: str | None = None,
src/anyio/_core/_fileio.py:1030
↓ 20 callersMethodaccept
()
tests/test_sockets.py:1153
↓ 20 callersMethodread
(self, size: int = -1)
src/anyio/_core/_fileio.py:121
↓ 20 callersMethodset_result
(self, result: Any)
tests/test_from_thread.py:791
↓ 20 callersFunctionsock_or_fd_factory
( request: SubRequest, tmp_path_factory: TempPathFactory )
tests/test_sockets.py:186
↓ 19 callersFunctionget_available_backends
Test for the availability of built-in backends. :return a tuple of the built-in backend names that were successfully imported .. versio
src/anyio/_core/_eventloop.py:145
↓ 19 callersMethodsend
(self, item: bytes)
src/anyio/streams/tls.py:274
↓ 19 callersMethodsendto
Alias for :meth:`~.UnreliableObjectSendStream.send` ((data, (host, port))).
src/anyio/abc/_sockets.py:308
↓ 19 callersMethodwrap
Wrap an existing stream with Transport Layer Security. This performs a TLS handshake with the peer. :param transport_stream
src/anyio/streams/tls.py:101
↓ 18 callersFunction_iterate
(iterable: Iterable[T] | AsyncIterable[T])
src/anyio/itertools.py:69
↓ 18 callersFunctionmove_on_after
Create a cancel scope with a deadline that expires after the given delay. :param delay: maximum allowed time (in seconds) before exiting the
src/anyio/_core/_tasks.py:201
↓ 17 callersFunctioncreate_udp_socket
Create a UDP socket. If ``port`` has been given, the socket will be bound to this port on the local machine, making this socket suitable
src/anyio/_core/_sockets.py:484
↓ 17 callersMethodset
(self)
src/anyio/_backends/_asyncio.py:1999
↓ 16 callersMethodreceive_nowait
Receive the next item if it can be done without waiting. :return: the received item :raises ~anyio.ClosedResourceError: if t
src/anyio/streams/memory.py:88
↓ 16 callersMethodsend_nowait
(self, item: T_Item)
tests/streams/test_stapled.py:146
↓ 14 callersMethod_convert_socket_error
(self, exc: BaseException)
src/anyio/_backends/_trio.py:470
↓ 14 callersFunctioncreate_connected_udp_socket
Create a connected UDP socket. Connected UDP sockets can only communicate with the specified remote host/port, an any packets sent from
src/anyio/_core/_sockets.py:530
↓ 14 callersFunctioncreate_unix_datagram_socket
Create a UNIX datagram socket. Not available on Windows. If ``local_path`` has been given, the socket will be bound to this path, makin
src/anyio/_core/_sockets.py:586
↓ 14 callersFunctioncreate_unix_listener
Create a UNIX socket listener. Not available on Windows. :param path: path of the socket :param mode: permissions to set on the soc
src/anyio/_core/_sockets.py:448
↓ 14 callersMethodexists
(self, *, follow_symlinks: bool = True)
src/anyio/_core/_fileio.py:582
↓ 14 callersFunctionget_current_task
Return the current task. :return: a representation of the current task :raises NoEventLoopError: if no supported asynchronous event loop
src/anyio/_core/_testing.py:56
↓ 14 callersFunctionopen_process
Start an external command in a subprocess. .. seealso:: :class:`subprocess.Popen` :param command: either a string to pass to the shell,
src/anyio/_core/_subprocesses.py:122
↓ 14 callersMethodread_text
( self, encoding: str | None = None, errors: str | None = None,
src/anyio/_core/_fileio.py:833
↓ 13 callersMethodconnect
(self)
tests/streams/test_tls.py:654
↓ 13 callersFunctiontaskfunc
(*, task_status: TaskStatus)
tests/test_taskgroups.py:174
↓ 12 callersFunctionaclose_forcefully
Close an asynchronous resource in a cancelled scope. Doing this closes the resource without waiting on anything. :param resource: the r
src/anyio/_core/_resources.py:7
↓ 12 callersMethodcache_info
(self)
src/anyio/functools.py:83
↓ 12 callersMethodcancel
(self, reason: str | None = None)
src/anyio/_backends/_asyncio.py:690
↓ 12 callersMethodopen
( self, mode: OpenBinaryMode, buffering: int = ..., encoding: str | None = ...
src/anyio/_core/_fileio.py:774
↓ 12 callersMethodreceive
(self, max_bytes: int = 65536)
src/anyio/streams/tls.py:264
↓ 12 callersMethodseek
(self, offset: int, whence: int | None = os.SEEK_SET)
src/anyio/_core/_fileio.py:164
↓ 11 callersFunctioncurrent_time
Return the current value of the event loop's internal clock. :return: the clock value (seconds) :raises NoEventLoopError: if no supporte
src/anyio/_core/_eventloop.py:128
↓ 11 callersMethodfrom_path
Create a file read stream by opening the given file. :param path: path of the file to read from
src/anyio/streams/file.py:76
↓ 11 callersFunctionrun_process
Run an external command in a subprocess and wait until it completes. .. seealso:: :func:`subprocess.run` :param command: either a strin
src/anyio/_core/_subprocesses.py:16
↓ 11 callersMethodset
Set the flag, notifying all listeners.
src/anyio/_core/_synchronization.py:97
↓ 11 callersMethodset_exception
(self, exception: BaseException | None)
tests/test_from_thread.py:795
↓ 11 callersMethodstart_task_soon
( self, func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]], *args: Unpack[PosArgs
src/anyio/from_thread.py:444
↓ 11 callersMethodsymlink_to
( self, target: str | bytes | PathLike[str] | PathLike[bytes], target_is_directory: bo
src/anyio/_core/_fileio.py:952
↓ 11 callersMethodtouch
(self, mode: int = 0o666, exist_ok: bool = True)
src/anyio/_core/_fileio.py:964
↓ 10 callersMethodcancel
Cancels a pending `.Future` object Does nothing if the Future was already finished.
src/anyio/_core/_futures.py:86
↓ 10 callersFunctioncreate_connected_unix_datagram_socket
Create a connected UNIX datagram socket. Connected datagram sockets can only communicate with the specified remote path. If ``local_pat
src/anyio/_core/_sockets.py:614
↓ 10 callersMethodjoinpath
(self, *args: str | PathLike[str])
src/anyio/_core/_fileio.py:755
↓ 10 callersFunctionopen_file
( file: str | PathLike[str] | int, mode: OpenBinaryMode, buffering: int = ..., encoding: str |
src/anyio/_core/_fileio.py:177
↓ 10 callersFunctionreduce
( function: Callable[[T, S], Awaitable[T]], iterable: Iterable[S] | AsyncIterable[S], /, initi
src/anyio/functools.py:328
↓ 10 callersMethodrelative_to
( self, *other: str | PathLike[str], walk_up: bool = False )
src/anyio/_core/_fileio.py:858
↓ 10 callersMethodrelease
(self)
src/anyio/_backends/_trio.py:774
↓ 9 callersMethod__init__
(self, *, fast_acquire: bool = False)
src/anyio/_backends/_trio.py:733
↓ 9 callersMethodacquire_nowait
(self)
src/anyio/_backends/_trio.py:762
↓ 9 callersMethodis_dir
(self, *, follow_symlinks: bool = True)
src/anyio/_core/_fileio.py:682
↓ 9 callersMethodstatistics
(self)
src/anyio/_backends/_trio.py:777
↓ 9 callersMethodwait
(self)
src/anyio/_backends/_asyncio.py:2005
↓ 8 callersFunctionas_connectable
Return a byte stream connectable from the given object. If a bytestream connectable is given, it is returned unchanged. If a tuple of (h
src/anyio/_core/_sockets.py:975
↓ 8 callersMethodcall_async
( self, func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]], *args: Unpack[PosArgs
src/anyio/from_thread.py:350
↓ 8 callersMethodcancel_shielded_checkpoint
(cls)
src/anyio/_backends/_asyncio.py:2659
↓ 8 callersFunctioncurrent_token
Return a token object that can be used to call code in the current event loop from another thread. :raises NoEventLoopError: if no suppo
src/anyio/lowlevel.py:83
↓ 8 callersMethodmkdir
( self, mode: int = 0o777, parents: bool = False, exist_ok: bool = False )
src/anyio/_core/_fileio.py:766
next →1–100 of 2,553, ranked by callers