Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 52 for Hawaii (0.46 sec)

  1. docs/en/docs/advanced/async-tests.md

    Then we can create an `AsyncClient` with the app, and send async requests to it, using `await`.
    
    ```Python hl_lines="9-10"
    {!../../../docs_src/async_tests/test_main.py!}
    ```
    
    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
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Jan 13 12:07:15 GMT 2024
    - 3.9K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/internal/concurrent/TaskRunnerRealBackendTest.kt

          throw RuntimeException("boom!")
        }
    
        queue.schedule("task", TimeUnit.MILLISECONDS.toNanos(200)) {
          log.put("normal task running")
          return@schedule -1L
        }
    
        queue.idleLatch().await(500, TimeUnit.MILLISECONDS)
    
        assertThat(log.take()).isEqualTo("failing task running")
        assertThat(log.take()).isEqualTo("uncaught exception: java.lang.RuntimeException: boom!")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  3. docs/em/docs/advanced/websockets.md

    ```
    
    !!! note "📡 ℹ"
        👆 💪 ⚙️ `from starlette.websockets import WebSocket`.
    
        **FastAPI** 🚚 🎏 `WebSocket` 🔗 🏪 👆, 👩‍💻. ✋️ ⚫️ 👟 🔗 ⚪️➡️ 💃.
    
    ## ⌛ 📧 & 📨 📧
    
    👆 *️⃣ 🛣 👆 💪 `await` 📧 & 📨 📧.
    
    ```Python hl_lines="48-52"
    {!../../../docs_src/websockets/tutorial001.py!}
    ```
    
    👆 💪 📨 & 📨 💱, ✍, & 🎻 💽.
    
    ## 🔄 ⚫️
    
    🚥 👆 📁 📛 `main.py`, 🏃 👆 🈸 ⏮️:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 4.8K bytes
    - Viewed (0)
  4. okhttp-android/src/androidTest/kotlin/okhttp3/android/AndroidAsyncDnsTest.kt

            override fun onFailure(
              hostname: String,
              e: IOException,
            ) {
              exception = e
              latch.countDown()
            }
          },
        )
    
        latch.await()
    
        return Pair(allAddresses, exception)
      }
    
      @Test
      fun testDnsRequestExternal() {
        assumeNetwork()
    
        val (allAddresses, exception) = dnsQuery("google.com")
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.7K bytes
    - Viewed (0)
  5. docs/zh/docs/advanced/dataclasses.md

    8. 注意,*路径操作函数*使用的是普通函数,不是异步函数;
    
        与往常一样,在 FastAPI 中,可以按需组合普通函数与异步函数;
    
        如果不清楚何时使用异步函数或普通函数,请参阅**急不可待?**一节中对 <a href="https://fastapi.tiangolo.com/async/#in-a-hurry" target="_blank" class="internal-link">`async` 与 `await`</a> 的说明;
    
    9. *路径操作函数*返回的不是数据类(虽然它可以返回数据类),而是返回内含数据的字典列表;
    
        FastAPI 使用(包含数据类的) `response_model` 参数转换响应。
    
    把 `dataclasses` 与其它类型注解组合在一起,可以组成不同形式的复杂数据结构。
    
    更多内容详见上述代码内的注释。
    
    ## 深入学习
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 22:44:14 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  6. docs/zh/docs/tutorial/background-tasks.md

    **FastAPI** 会创建一个 `BackgroundTasks` 类型的对象并作为该参数传入。
    
    ## 创建一个任务函数
    
    创建要作为后台任务运行的函数。
    
    它只是一个可以接收参数的标准函数。
    
    它可以是 `async def` 或普通的 `def` 函数,**FastAPI** 知道如何正确处理。
    
    在这种情况下,任务函数将写入一个文件(模拟发送电子邮件)。
    
    由于写操作不使用 `async` 和 `await`,我们用普通的 `def` 定义函数:
    
    ```Python hl_lines="6-9"
    {!../../../docs_src/background_tasks/tutorial001.py!}
    ```
    
    ## 添加后台任务
    
    在你的 *路径操作函数* 里,用 `.add_task()` 方法将任务函数传到 *后台任务* 对象中:
    
    ```Python hl_lines="14"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 5K bytes
    - Viewed (0)
  7. docs/em/docs/advanced/custom-response.md

        , ⚫️ 🚂 🔢 👈 📨 "🏭" 👷 🕳 🙆 🔘.
    
        🔨 ⚫️ 👉 🌌, 👥 💪 🚮 ⚫️ `with` 🍫, &amp; 👈 🌌, 🚚 👈 ⚫️ 📪 ⏮️ 🏁.
    
    !!! tip
        👀 👈 📥 👥 ⚙️ 🐩 `open()` 👈 🚫 🐕‍🦺 `async` &amp; `await`, 👥 📣 ➡ 🛠️ ⏮️ 😐 `def`.
    
    ### `FileResponse`
    
    🔁 🎏 📁 📨.
    
    ✊ 🎏 ⚒ ❌ 🔗 🌘 🎏 📨 🆎:
    
    * `path` - 📁 📁 🎏.
    * `headers` - 🙆 🛃 🎚 🔌, 📖.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 9.8K bytes
    - Viewed (0)
  8. docs/en/docs/advanced/websockets.md

        **FastAPI** provides the same `WebSocket` directly just as a convenience for you, the developer. But it comes directly from Starlette.
    
    ## Await for messages and send messages
    
    In your WebSocket route you can `await` for messages and send messages.
    
    ```Python hl_lines="48-52"
    {!../../../docs_src/websockets/tutorial001.py!}
    ```
    
    You can receive and send binary, text, and JSON data.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/AsyncDns.kt

                      allExceptions.add(e)
                    }
                    latch.countDown()
                  }
                },
              )
            }
    
            latch.await()
    
            // No mutations should be possible after this point
            if (allAddresses.isEmpty()) {
              val first = allExceptions.firstOrNull() ?: UnknownHostException("No results for $hostname")
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  10. docs/zh/docs/advanced/websockets.md

    ```
    
    !!! note "技术细节"
        您也可以使用 `from starlette.websockets import WebSocket`。
    
        **FastAPI** 直接提供了相同的 `WebSocket`,只是为了方便开发人员。但它直接来自 Starlette。
    
    ## 等待消息并发送消息
    
    在您的 WebSocket 路由中,您可以使用 `await` 等待消息并发送消息。
    
    ```Python hl_lines="48-52"
    {!../../../docs_src/websockets/tutorial001.py!}
    ```
    
    您可以接收和发送二进制、文本和 JSON 数据。
    
    ## 尝试一下
    
    如果您的文件名为 `main.py`,请使用以下命令运行应用程序:
    
    ```console
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 6K bytes
    - Viewed (0)
Back to top