semvec/pypi-packages huggingface dataset:
django-threaded-sync-to-async 1.0.4
Tools for replacing `sync_to_async` calls to `sync_to_async(thread_sensitive=False, executor=...)`, effectively allowing Django to make calls to database concurrently
License: MIT
Keywords: django,asyncio,asgiref,sync_to_async

## `django_threaded_sync_to_async`

Tools for replacing `sync_to_async` calls to `sync_to_async(thread_sensitive=False, executor=...)`, effectively allowing Django to make calls to database concurrently.

```
pip3 install django_threaded_sync_to_async
```

### `Executor`

```python3
import django_threaded_sync_to_async

async with django_threaded_sync_to_async.Executor(thread_name_prefix="thread", max_workers=3) as executor:
    a = asgiref.sync.sync_to_async(long_call)(1)
    b = asgiref.sync.sync_to_async(long_call)(2)
    c = asgiref.sync.sync_to_async(long_call)(3)
    d = asgiref.sync.sync_to_async(long_call)(4)
    await asyncio.gather(a, b, c, d)
```

### `SharedExecutor`

Maintains global dictionary of executors (`concurrent.futures.ThreadPoolExecutor`) accessed by name and allows to limit utilization of executor for a single context.

```python3
import django_threaded_sync_to_async

@django_threaded_sync_to_async.SharedExecutor("common", max_workers=3, max_tasks=2)
async def operations():
    a = asgiref.sync.sync_to_async(long_call)(1)
    b = asgiref.sync.sync_to_async(long_call)(2)
    c = asgiref.sync.sync_to_async(long_call)(3)
    d = asgiref.sync.sync_to_async(long_call)(4)
    await asyncio.gather(a, b, c, d)
```
makavafal-django-watchfiles 0.0.1
Use watchfiles in Django’s autoreloader.
License: MIT
Requires Python: >=3.7

=================
django-watchfiles
=================

Use `watchfiles <https://watchfiles.helpmanual.io/>`__ in Django’s autoreloader.

Requirements
------------

Python 3.7 to 3.10 supported.

Django 2.2 to 4.0 supported.

Installation
------------

1. Install with **pip**:

   .. code-block:: sh

       python -m pip install django-watchfiles

2. Add django-watchfiles to your ``INSTALLED_APPS``:

   .. code-block:: python

       INSTALLED_APPS = [
           ...,
           "django_watchfiles",
           ...,
       ]

That’s it! 😅

Django doesn’t provide an official API for alternative autoreloader classes.
Therefore, django-watchfiles monkey-patches ``django.utils.autoreload`` to make its own reloader the only available class.
You can tell it is installed as ``runserver`` will list ``WatchfilesReloader`` as in use:

.. code-block:: shell

   $ ./manage.py runserver
   Watching for file changes with WatchfilesReloader
   ...

Unlike Django’s built-in ``WatchmanReloader``, there is no need for a fallback to ``StatReloader``, since ``watchfiles`` implements its own internal fallback to using ``stat``.