Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 2,181 for Await (0.04 sec)

  1. docs_src/custom_request_and_route/tutorial002.py

            original_route_handler = super().get_route_handler()
    
            async def custom_route_handler(request: Request) -> Response:
                try:
                    return await original_route_handler(request)
                except RequestValidationError as exc:
                    body = await request.body()
                    detail = {"errors": exc.errors(), "body": body.decode()}
                    raise HTTPException(status_code=422, detail=detail)
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri May 13 23:38:22 UTC 2022
    - 932 bytes
    - Viewed (0)
  2. fastapi/exceptions.py

        ):
            if session is None:
                raise WebSocketException(code=status.WS_1008_POLICY_VIOLATION)
            await websocket.accept()
            while True:
                data = await websocket.receive_text()
                await websocket.send_text(f"Session cookie is: {session}")
                await websocket.send_text(f"Message text was: {data}, for item ID: {item_id}")
        ```
        """
    
        def __init__(
            self,
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Apr 02 02:48:51 UTC 2024
    - 4.9K bytes
    - Viewed (0)
  3. tests/test_custom_middleware_exception.py

            return inner
    
        async def __call__(self, scope, receive, send):
            if scope["type"] != "http" or self.max_content_size is None:
                await self.app(scope, receive, send)
                return
    
            wrapper = self.receive_wrapper(receive)
            await self.app(scope, wrapper, send)
    
    
    @router.post("/middleware")
    def run_middleware(file: UploadFile = File(..., description="Big File")):
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Aug 25 21:44:40 UTC 2022
    - 2.8K bytes
    - Viewed (0)
  4. 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: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sun Aug 09 11:10:33 UTC 2020
    - 928 bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/util/concurrent/JdkFutureAdaptersTest.java

        // Now give the get() thread time to finish:
        assertTrue(earlyListener.wasRun.await(1, SECONDS));
    
        // Now test an additional addListener call, which will be run in-thread:
        RecordingRunnable lateListener = new RecordingRunnable();
        listenable.addListener(lateListener, directExecutor());
        assertTrue(lateListener.wasRun.await(1, SECONDS));
      }
    
      public void testAdapters_nullChecks() throws Exception {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Feb 09 22:57:07 UTC 2022
    - 9.7K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/util/concurrent/AbstractExecutionThreadServiceTest.java

        assertFalse(service.startUpCalled);
    
        service.startAsync().awaitRunning();
        assertTrue(service.startUpCalled);
        assertEquals(Service.State.RUNNING, service.state());
    
        enterRun.await(); // to avoid stopping the service until run() is invoked
    
        service.stopAsync().awaitTerminated();
        assertTrue(service.shutDownCalled);
        assertEquals(Service.State.TERMINATED, service.state());
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 12.7K bytes
    - Viewed (0)
  7. src/test/java/org/codelibs/fess/suggest/concurrent/DeferredTest.java

            });
            th.start();
    
            final CountDownLatch latch = new CountDownLatch(1);
            deferred.promise().then(response -> latch.countDown());
            assertTrue(latch.await(10, TimeUnit.SECONDS));
        }
    
        @Test
        public void test_doneAfterResolve() throws Exception {
            final Deferred<SuggestResponse> deferred = new Deferred<>();
    
            Thread th = new Thread(() -> {
    Registered: Wed Jun 12 15:38:08 UTC 2024
    - Last Modified: Thu Feb 22 01:36:54 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  8. 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: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Mar 14 11:40:05 UTC 2024
    - 1K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java

            };
        Thread runner = new Thread(task);
        runner.start();
        isInterruptibleRegistered.await();
        RuntimeException expected = assertThrows(RuntimeException.class, () -> task.interruptTask());
        assertThat(expected)
            .hasMessageThat()
            .isEqualTo("I bet you didn't think Thread.interrupt could throw");
        // We need to wait for the runner to exit.  It used to be that the runner would get stuck in the
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 6.6K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java

            };
        Thread runner = new Thread(task);
        runner.start();
        isInterruptibleRegistered.await();
        RuntimeException expected = assertThrows(RuntimeException.class, () -> task.interruptTask());
        assertThat(expected)
            .hasMessageThat()
            .isEqualTo("I bet you didn't think Thread.interrupt could throw");
        // We need to wait for the runner to exit.  It used to be that the runner would get stuck in the
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 6.6K bytes
    - Viewed (0)
Back to top