Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 159 for pool (0.22 sec)

  1. scripts/docs.py

        shutil.rmtree(site_path, ignore_errors=True)
        langs = [lang.name for lang in get_lang_paths() if lang.is_dir()]
        cpu_count = os.cpu_count() or 1
        process_pool_size = cpu_count * 4
        typer.echo(f"Using process pool size: {process_pool_size}")
        with Pool(process_pool_size) as p:
            p.map(build_lang, langs)
    
    
    @app.command()
    def update_languages() -> None:
        """
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Jan 22 19:26:14 GMT 2024
    - 10.9K bytes
    - Viewed (1)
  2. docs_src/sql_databases/sql_app/tests/test_sql_app.py

    from fastapi.testclient import TestClient
    from sqlalchemy import create_engine
    from sqlalchemy.orm import sessionmaker
    from sqlalchemy.pool import StaticPool
    
    from ..database import Base
    from ..main import app, get_db
    
    SQLALCHEMY_DATABASE_URL = "sqlite://"
    
    engine = create_engine(
        SQLALCHEMY_DATABASE_URL,
        connect_args={"check_same_thread": False},
        poolclass=StaticPool,
    )
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jun 22 11:20:12 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  3. docs/de/docs/advanced/events.md

    Dies kann sehr nützlich sein, um **Ressourcen** einzurichten, die Sie in der gesamten Anwendung verwenden wollen und die von Requests **gemeinsam genutzt** werden und/oder die Sie anschließend **aufräumen** müssen. Zum Beispiel ein Pool von Datenbankverbindungen oder das Laden eines gemeinsam genutzten Modells für maschinelles Lernen.
    
    ## Anwendungsfall
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:30:59 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  4. docs/pt/docs/advanced/events.md

    Pode ser muito útil para configurar **recursos** que você precisa usar por toda aplicação, e que são **compartilhados** entre as requisições, e/ou que você precisa **limpar** depois. Por exemplo, o pool de uma conexão com o banco de dados ou carregamento de um modelo compartilhado de aprendizado de máquina (_machine learning_).
    
    ## Caso de uso
    
    Vamos iniciar com um exemplo de **caso de uso** e então ver como resolvê-lo com isso.
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.6K bytes
    - Viewed (0)
  5. docs/en/docs/advanced/events.md

    This can be very useful for setting up **resources** that you need to use for the whole app, and that are **shared** among requests, and/or that you need to **clean up** afterwards. For example, a database connection pool, or loading a shared machine learning model.
    
    ## Use Case
    
    Let's start with an example **use case** and then see how to solve it with this.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  6. docs_src/openapi_callbacks/tutorial001.py

    class Invoice(BaseModel):
        id: str
        title: Union[str, None] = None
        customer: str
        total: float
    
    
    class InvoiceEvent(BaseModel):
        description: str
        paid: bool
    
    
    class InvoiceEventReceived(BaseModel):
        ok: bool
    
    
    invoices_callback_router = APIRouter()
    
    
    @invoices_callback_router.post(
        "{$callback_url}/invoices/{$request.body.id}", response_model=InvoiceEventReceived
    )
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 1.3K bytes
    - Viewed (0)
  7. docs_src/query_params/tutorial003_py310.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_item(item_id: str, q: str | None = None, short: bool = False):
        item = {"item_id": item_id}
        if q:
            item.update({"q": q})
        if not short:
            item.update(
                {"description": "This is an amazing item that has a long description"}
            )
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 374 bytes
    - Viewed (0)
  8. docs_src/dependencies/tutorial011_an_py39.py

                return self.fixed_content in q
            return False
    
    
    checker = FixedContentQueryChecker("bar")
    
    
    @app.get("/query-checker/")
    async def read_query_check(fixed_content_included: Annotated[bool, Depends(checker)]):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 544 bytes
    - Viewed (0)
  9. docs_src/query_params/tutorial004.py

    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/users/{user_id}/items/{item_id}")
    async def read_user_item(
        user_id: int, item_id: str, q: Union[str, None] = None, short: bool = False
    ):
        item = {"item_id": item_id, "owner_id": user_id}
        if q:
            item.update({"q": q})
        if not short:
            item.update(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 468 bytes
    - Viewed (0)
  10. fastapi/dependencies/models.py

            background_tasks_param_name: Optional[str] = None,
            security_scopes_param_name: Optional[str] = None,
            security_scopes: Optional[List[str]] = None,
            use_cache: bool = True,
            path: Optional[str] = None,
        ) -> None:
            self.path_params = path_params or []
            self.query_params = query_params or []
            self.header_params = header_params or []
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 2.4K bytes
    - Viewed (0)
Back to top