Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 1,867 for Await (0.52 sec)

  1. android/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTester.java

        assertTrue(latch.await(5, TimeUnit.SECONDS));
        assertTrue(future.isDone());
        assertFalse(future.isCancelled());
    
        assertEquals(expectedValue, future.get());
      }
    
      public void testCancelledFuture() throws InterruptedException, ExecutionException {
        assertTrue(future.isDone());
        assertTrue(future.isCancelled());
    
        assertTrue(latch.await(5, TimeUnit.SECONDS));
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 3.3K bytes
    - Viewed (0)
  2. platforms/core-runtime/time/src/main/java/org/gradle/internal/time/ExponentialBackoff.java

        }
    
        public interface Signal {
            Signal SLEEP = new Signal() {
                @Override
                public boolean await(long period) throws InterruptedException {
                    Thread.sleep(period);
                    return false;
                }
            };
    
            boolean await(long period) throws InterruptedException;
        }
    
        public interface Query<T> {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Apr 12 08:49:35 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  3. platforms/core-runtime/messaging/src/main/java/org/gradle/internal/dispatch/AsyncDispatch.java

            lock.lock();
            try {
                boolean interrupted = false;
                while (state != State.Stopped && queue.isEmpty()) {
                    try {
                        condition.await();
                    } catch (InterruptedException e) {
                        interrupted = true;
                    }
                }
                if (interrupted) {
                    Thread.currentThread().interrupt();
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Dec 11 13:37:56 UTC 2023
    - 6.7K bytes
    - Viewed (0)
  4. 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: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Wed Feb 08 10:23:07 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  5. fastapi/datastructures.py

            To be awaitable, compatible with async, this is run in threadpool.
            """
            return await super().seek(offset)
    
        async def close(self) -> None:
            """
            Close the file.
    
            To be awaitable, compatible with async, this is run in threadpool.
            """
            return await super().close()
    
        @classmethod
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Apr 02 02:48:51 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  6. .github/workflows/trusted_partners.js

      }
    
      const resp_label = await github.rest.issues.addLabels({
        issue_number: context.issue.number,
        owner: context.repo.owner,
        repo: context.repo.repo,
        labels: labels
      });
      if (resp_label.status >= 400) {
        console.log(resp_label);
        throw "Error adding labels to PR";
      }
      if (assignees.length > 0) {
        const resp_assign = await github.rest.issues.addAssignees({
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Feb 07 13:52:04 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  7. android/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)
  8. pkg/queue/delay.go

    					await.Stop()
    					return
    				}
    				await.Stop()
    			}
    		} else {
    			// no items, wait for Push or stop
    			select {
    			case t := <-d.enqueue:
    				d.mu.Lock()
    				d.queue.Push(t)
    				d.mu.Unlock()
    			case <-stop:
    				return
    			}
    		}
    	}
    }
    
    // work takes a channel that signals to stop, and returns a channel that signals the worker has fully stopped
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jul 20 06:27:31 UTC 2023
    - 6.7K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/AutobahnTester.kt

              t: Throwable,
              response: Response?,
            ) {
              t.printStackTrace(System.out)
              latch.countDown()
            }
          },
        )
    
        check(latch.await(30, TimeUnit.SECONDS)) { "Timed out waiting for test $number to finish." }
        val endNanos = System.nanoTime()
        val tookMs = TimeUnit.NANOSECONDS.toMillis(endNanos - startNanos.get())
        println("Took ${tookMs}ms")
      }
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  10. docs/zh/docs/async.md

    # 并发 async / await
    
    有关路径操作函数的 `async def` 语法以及异步代码、并发和并行的一些背景知识。
    
    ## 赶时间吗?
    
    <abbr title="too long; didn't read(长文警告)"><strong>TL;DR:</strong></abbr>
    
    如果你正在使用第三方库,它们会告诉你使用 `await` 关键字来调用它们,就像这样:
    
    ```Python
    results = await some_library()
    ```
    
    然后,通过 `async def` 声明你的 *路径操作函数*:
    
    ```Python hl_lines="2"
    @app.get('/')
    async def read_results():
        results = await some_library()
        return results
    ```
    
    !!! note
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 21.1K bytes
    - Viewed (0)
Back to top