Search Options

Results per page
Sort
Preferred Languages
Advance

Results 81 - 90 of 550 for nwait (0.03 sec)

  1. docs/zh/docs/tutorial/request-files.md

    * `read(size)`:按指定数量的字节或字符(`size` (`int`))读取文件内容;
    * `seek(offset)`:移动至文件 `offset` (`int`)字节处的位置;
        * 例如,`await myfile.seek(0) ` 移动到文件开头;
        * 执行 `await myfile.read()` 后,需再次读取已读取内容时,这种方法特别好用;
    * `close()`:关闭文件。
    
    因为上述方法都是 `async` 方法,要搭配「await」使用。
    
    例如,在 `async` *路径操作函数* 内,要用以下方式读取文件内容:
    
    ```Python
    contents = await myfile.read()
    ```
    
    在普通 `def` *路径操作函数*  内,则可以直接访问 `UploadFile.file`,例如:
    
    ```Python
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 6.9K bytes
    - Viewed (0)
  2. docs_src/handling_errors/tutorial006.py

    async def custom_http_exception_handler(request, exc):
        print(f"OMG! An HTTP error!: {repr(exc)}")
        return await http_exception_handler(request, exc)
    
    
    @app.exception_handler(RequestValidationError)
    async def validation_exception_handler(request, exc):
        print(f"OMG! The client sent invalid data!: {exc}")
        return await request_validation_exception_handler(request, exc)
    
    
    @app.get("/items/{item_id}")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Aug 09 11:10:33 UTC 2020
    - 928 bytes
    - Viewed (0)
  3. cmd/mrf.go

    			}
    
    			now := time.Now()
    			if now.Sub(u.Queued) < time.Second {
    				// let recently failed networks to reconnect
    				// making MRF wait for 1s before retrying,
    				// i.e 4 reconnect attempts.
    				time.Sleep(time.Second)
    			}
    
    			// wait on timer per heal
    			wait := healSleeper.Timer(context.Background())
    
    			scan := madmin.HealNormalScan
    			if u.BitrotScan {
    				scan = madmin.HealDeepScan
    			}
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Aug 13 22:26:05 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  4. docs_src/generate_clients/tutorial004.js

    import * as fs from 'fs'
    
    async function modifyOpenAPIFile(filePath) {
      try {
        const data = await fs.promises.readFile(filePath)
        const openapiContent = JSON.parse(data)
    
        const paths = openapiContent.paths
        for (const pathKey of Object.keys(paths)) {
          const pathData = paths[pathKey]
          for (const method of Object.keys(pathData)) {
            const operation = pathData[method]
            if (operation.tags && operation.tags.length > 0) {
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 14 11:40:05 UTC 2024
    - 1K bytes
    - Viewed (0)
  5. guava/src/com/google/common/util/concurrent/TimeLimiter.java

       * @param timeoutDuration with timeoutUnit, the maximum length of time that callers are willing to
       *     wait on each method call to the proxy
       * @param timeoutUnit with timeoutDuration, the maximum length of time that callers are willing to
       *     wait on each method call to the proxy
       * @return a time-limiting proxy
       * @throws IllegalArgumentException if {@code interfaceType} is a regular class, enum, or
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri May 12 18:32:03 UTC 2023
    - 15.3K bytes
    - Viewed (0)
  6. guava-testlib/src/com/google/common/testing/GcFinalization.java

     * Object x = new MyClass() {
     *   ...
     *   protected void finalize() { latch.countDown(); ... }
     * };
     * x = null;  // Hint to the JIT that x is stack-unreachable
     * GcFinalization.await(latch);
     * }</pre>
     *
     * <p>Here's an example that uses a user-defined finalization predicate:
     *
     * <pre>{@code
     * final WeakHashMap<Object, Object> map = new WeakHashMap<>();
     * map.put(new Object(), Boolean.TRUE);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  7. guava/src/com/google/common/util/concurrent/MoreExecutors.java

       * is complete. It does so by using daemon threads and adding a shutdown hook to wait for their
       * completion.
       *
       * <p>This is mainly for fixed thread pools. See {@link Executors#newFixedThreadPool(int)}.
       *
       * @param executor the executor to modify to make sure it exits when the application is finished
       * @param terminationTimeout how long to wait for the executor to finish before terminating the
       *     JVM
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:51:36 UTC 2024
    - 44.1K bytes
    - Viewed (0)
  8. docs/de/docs/advanced/async-tests.md

    Dann können wir einen `AsyncClient` mit der App erstellen und mit `await` asynchrone Requests an ihn senden.
    
    {* ../../docs_src/async_tests/test_main.py hl[9:12] *}
    
    Das ist das Äquivalent zu:
    
    ```Python
    response = client.get('/')
    ```
    
    ... welches wir verwendet haben, um unsere Requests mit dem `TestClient` zu machen.
    
    /// tip | "Tipp"
    
    Beachten Sie, dass wir async/await mit dem neuen `AsyncClient` verwenden – der Request ist asynchron.
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 15:34:47 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  9. docs/en/docs/advanced/async-tests.md

    ///
    
    Then we can create an `AsyncClient` with the app, and send async requests to it, using `await`.
    
    {* ../../docs_src/async_tests/test_main.py hl[9:12] *}
    
    This is the equivalent to:
    
    ```Python
    response = client.get('/')
    ```
    
    ...that we used to make our requests with the `TestClient`.
    
    /// tip
    
    Note that we're using async/await with the new `AsyncClient` - the request is asynchronous.
    
    ///
    
    /// warning
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 15:43:29 UTC 2024
    - 3.8K bytes
    - Viewed (0)
  10. tests/test_route_scope.py

    
    @app.websocket("/items/{item_id}")
    async def websocket_item(item_id: str, websocket: WebSocket):
        route: APIWebSocketRoute = websocket.scope["route"]
        await websocket.accept()
        await websocket.send_json({"item_id": item_id, "path": route.path})
    
    
    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/users/rick")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Feb 08 10:23:07 UTC 2023
    - 1.5K bytes
    - Viewed (0)
Back to top