MCPcopy Create free account

hub / github.com/agronholm/anyio / functions

Functions2,163 in github.com/agronholm/anyio

↓ 189 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:191
↓ 159 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:124
↓ 127 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:91
↓ 92 callersMethodclose
Shutdown and close event loop.
src/anyio/_backends/_asyncio.py:158
↓ 86 callersFunctionwait_all_tasks_blocked
Wait until all other tasks are waiting for something.
src/anyio/_core/_testing.py:80
↓ 80 callersMethodreceive
(self, max_bytes: int = 65536)
tests/streams/test_stapled.py:29
↓ 74 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
↓ 64 callersMethodsend
(self, item: bytes)
tests/streams/test_stapled.py:46
↓ 59 callersMethodaclose
(self)
tests/streams/test_stapled.py:52
↓ 58 callersMethodwait
(self)
src/anyio/_backends/_trio.py:715
↓ 57 callersFunctionget_async_backend
(asynclib_name: str | None = None)
src/anyio/_core/_eventloop.py:191
↓ 56 callersMethodstart
( self, func: Callable[..., Coroutine[Any, Any, T_co]], *args: object, name: o
src/anyio/abc/_tasks.py:147
↓ 51 callersMethodappend
(x: int, task_status: TaskStatus)
tests/test_synchronization.py:851
↓ 49 callersFunctionsleep
Pause the current task for the specified duration. :param delay: the duration, in seconds
src/anyio/_core/_eventloop.py:88
↓ 46 callersMethodextra
(self, attribute: T_Attr)
src/anyio/_core/_typedattr.py:53
↓ 42 callersFunctioncollect
(iterator: AsyncIterator[T])
tests/test_itertools.py:46
↓ 39 callersMethodmatch
( self, path_pattern: str, *, case_sensitive: bool | None = None )
src/anyio/_core/_fileio.py:488
↓ 38 callersFunctionconnect_tcp
( remote_host: IPAddressType, remote_port: int, *, local_host: IPAddressType | None = ...,
src/anyio/_core/_sockets.py:73
↓ 37 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
↓ 34 callersMethodget
(self, default: D)
src/anyio/lowlevel.py:161
↓ 31 callersFunctionaiter_from
(iterable: Iterable[T])
tests/test_itertools.py:69
↓ 30 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:105
↓ 30 callersFunctionfail_after
Create a context manager which raises a :class:`TimeoutError` if does not finish in time. :param delay: maximum allowed time (in seconds
src/anyio/_core/_tasks.py:130
↓ 28 callersFunctionassert_cancelled_on_first_next
(iterator: AsyncIterator[Any])
tests/test_itertools.py:73
↓ 27 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:504
↓ 25 callersMethodcheckpoint
(cls)
src/anyio/_backends/_asyncio.py:2496
↓ 24 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:292
↓ 24 callersFunctionfunc
()
tests/test_lowlevel.py:20
↓ 23 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:162
↓ 23 callersMethodsleep
Pause the current task for the specified duration. :param delay: the duration, in seconds
src/anyio/abc/_eventloop.py:134
↓ 21 callersFunctionconnect_unix
Connect to the given UNIX socket. Not available on Windows. :param path: path to the socket :return: a socket stream object :ra
src/anyio/_core/_sockets.py:285
↓ 21 callersMethodstarted
(self: TaskStatus[None])
src/anyio/abc/_tasks.py:62
↓ 20 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
↓ 20 callersFunctionsock_or_fd_factory
( request: SubRequest, tmp_path_factory: TempPathFactory )
tests/test_sockets.py:172
↓ 20 callersMethodwrite_text
( self, data: str, encoding: str | None = None, errors: str | None = None,
src/anyio/_core/_fileio.py:943
↓ 19 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:67
↓ 19 callersMethodset
(self)
src/anyio/_backends/_trio.py:722
↓ 18 callersFunction_iterate
(iterable: Iterable[T] | AsyncIterable[T])
src/anyio/itertools.py:66
↓ 18 callersMethodadd
(a: int, b: int)
tests/test_itertools.py:854
↓ 17 callersMethodaccept
Accept an incoming connection.
src/anyio/abc/_sockets.py:265
↓ 17 callersMethodcreate_task_group
(cls)
src/anyio/abc/_eventloop.py:164
↓ 17 callersMethodset
(self)
src/anyio/_backends/_asyncio.py:1856
↓ 17 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:100
↓ 16 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:300
↓ 16 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:141
↓ 16 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
↓ 15 callersMethodcall
( self, func: Callable[..., T_Retval], args: tuple[Any, ...], )
src/anyio/to_interpreter.py:47
↓ 15 callersMethodrun
Run a coroutine inside the embedded event loop.
src/anyio/_backends/_asyncio.py:182
↓ 15 callersMethodsendto
Alias for :meth:`~.UnreliableObjectSendStream.send` ((data, (host, port))).
src/anyio/abc/_sockets.py:306
↓ 14 callersMethod_convert_socket_error
(self, exc: BaseException)
src/anyio/_backends/_trio.py:465
↓ 14 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:157
↓ 14 callersMethodsend_nowait
Send an item immediately if it can be done without waiting. :param item: the item to send :raises ~anyio.ClosedResourceError
src/anyio/streams/memory.py:206
↓ 14 callersMethodwrite
(self: AsyncFile[bytes], b: ReadableBuffer)
src/anyio/_core/_fileio.py:138
↓ 13 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
↓ 12 callersMethodcache_info
(self)
src/anyio/functools.py:83
↓ 12 callersMethodcancel
(self, reason: str | None = None)
src/anyio/_backends/_asyncio.py:650
↓ 12 callersMethodconnect
(self)
tests/streams/test_tls.py:625
↓ 12 callersMethodread_text
( self, encoding: str | None = None, errors: str | None = None )
src/anyio/_core/_fileio.py:774
↓ 12 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:87
↓ 12 callersFunctiontaskfunc
(*, task_status: TaskStatus)
tests/test_taskgroups.py:118
↓ 11 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:469
↓ 11 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:565
↓ 11 callersMethodwait
(self)
src/anyio/_backends/_asyncio.py:1862
↓ 10 callersMethodexists
(self)
src/anyio/_core/_fileio.py:578
↓ 10 callersMethodopen
( self, mode: OpenBinaryMode, buffering: int = ..., encoding: str | None = ...
src/anyio/_core/_fileio.py:728
↓ 10 callersMethodread
(self, size: int = -1)
src/anyio/_core/_fileio.py:119
↓ 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:783
↓ 10 callersMethodrelease
(self)
src/anyio/_backends/_trio.py:773
↓ 10 callersMethodtouch
(self, mode: int = 0o666, exist_ok: bool = True)
src/anyio/_core/_fileio.py:889
↓ 9 callersMethod__init__
(self, *, fast_acquire: bool = False)
src/anyio/_backends/_trio.py:732
↓ 9 callersMethodacquire_nowait
(self)
src/anyio/_backends/_trio.py:761
↓ 9 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
↓ 9 callersMethodstart_task_soon
( self, func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]], *args: Unpack[PosArgs
src/anyio/from_thread.py:341
↓ 9 callersMethodstatistics
(self)
src/anyio/_backends/_trio.py:776
↓ 8 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:515
↓ 8 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:437
↓ 8 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:71
↓ 8 callersMethodjoinpath
(self, *args: str | PathLike[str])
src/anyio/_core/_fileio.py:709
↓ 8 callersMethodset
Set the flag, notifying all listeners.
src/anyio/_core/_synchronization.py:91
↓ 7 callersFunction_validate_socket
( sock_or_fd: socket.socket | int, sock_type: socket.SocketKind, addr_family: socket.AddressFamily
src/anyio/abc/_sockets.py:30
↓ 7 callersMethodacquire
(self)
src/anyio/_backends/_trio.py:741
↓ 7 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:954
↓ 7 callersFunctionbatched
( iterable: Iterable[T] | AsyncIterable[T], n: int, *, strict: bool = False )
src/anyio/itertools.py:172
↓ 7 callersFunctioncancel_shielded_checkpoint
Allow the scheduler to switch to another task but without checking for cancellation. Equivalent to (but potentially more efficient than)::
src/anyio/lowlevel.py:55
↓ 7 callersFunctioncombinations
( iterable: Iterable[T] | AsyncIterable[T], r: int )
src/anyio/itertools.py:232
↓ 7 callersFunctioncombinations_with_replacement
( iterable: Iterable[T] | AsyncIterable[T], r: int )
src/anyio/itertools.py:240
↓ 7 callersMethodconnect
(self)
src/anyio/_core/_sockets.py:927
↓ 7 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:593
↓ 7 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:124
↓ 7 callersFunctiongetaddrinfo
Look up a numeric IP address given a host name. Internationalized domain names are translated according to the (non-transitional) IDNA 2
src/anyio/_core/_sockets.py:626
↓ 7 callersMethodmkdir
( self, mode: int = 0o777, parents: bool = False, exist_ok: bool = False )
src/anyio/_core/_fileio.py:720
↓ 7 callersFunctionno_other_refs
()
tests/conftest.py:177
↓ 7 callersMethodstart_task
Start a task in the portal's task group and wait until it signals for readiness. This method works the same way as :meth:`.abc.TaskG
src/anyio/from_thread.py:385
↓ 7 callersFunctiontee
( iterable: Iterable[T] | AsyncIterable[T], n: int = 2 )
src/anyio/itertools.py:555
↓ 6 callersMethodacquire
Acquire the lock.
src/anyio/_core/_synchronization.py:175
↓ 6 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
↓ 6 callersMethodlocked
(self)
src/anyio/_backends/_trio.py:770
↓ 6 callersFunctionopen_file
( file: str | PathLike[str] | int, mode: OpenBinaryMode, buffering: int = ..., encoding: str |
src/anyio/_core/_fileio.py:175
↓ 6 callersFunctionpermutations
( iterable: Iterable[T] | AsyncIterable[T], r: int | None = None )
src/anyio/itertools.py:487
next →1–100 of 2,163, ranked by callers