Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 1,148 for async (0.2 sec)

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

        async.setFuture(inner);
        async.cancel(false);
        assertTrue(inner.isCancelled());
        assertFalse(inner.wasInterrupted());
        assertThrows(CancellationException.class, () -> inner.get());
      }
    
      public void testCancel_beforeSet() throws Exception {
        SettableFuture<Object> async = SettableFuture.create();
        async.cancel(true);
        assertFalse(async.set(42));
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 7.3K bytes
    - Viewed (0)
  2. tests/test_ws_router.py

    async def routerindexparams(websocket: WebSocket, pathparam: str, queryparam: str):
        await websocket.accept()
        await websocket.send_text(pathparam)
        await websocket.send_text(queryparam)
        await websocket.close()
    
    
    async def ws_dependency():
        return "Socket Dependency"
    
    
    @router.websocket("/router-ws-depends/")
    async def router_ws_decorator_depends(
        websocket: WebSocket, data=Depends(ws_dependency)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 19:08:14 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  3. docs/en/docs/how-to/sql-databases-peewee.md

    ```Python
    some_var.get()
    ```
    
    ### Set context variables in the `async` dependency `reset_db_state()`
    
    If some part of the async code sets the value with `some_var.set("updated in function")` (e.g. like the `async` dependency), the rest of the code in it and the code that goes after (including code inside of `async` functions called with `await`) will see that new value.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 23.6K bytes
    - Viewed (0)
  4. tensorflow/c/eager/c_api_remote_function_test.cc

    namespace {
    
    void TestRemoteExecuteSilentCopiesFunc(bool async, bool remote,
                                           bool heavy_load_on_streaming_rpc,
                                           bool remote_func_outputs = false,
                                           bool has_packed_input = false) {
      return TestRemoteExecuteSilentCopies(async, remote, /*func=*/true,
                                           heavy_load_on_streaming_rpc,
    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Fri Dec 11 22:56:03 GMT 2020
    - 3.6K bytes
    - Viewed (0)
  5. fastapi/datastructures.py

    
        @app.post("/files/")
        async def create_file(file: Annotated[bytes, File()]):
            return {"file_size": len(file)}
    
    
        @app.post("/uploadfile/")
        async def create_upload_file(file: UploadFile):
            return {"filename": file.filename}
        ```
        """
    
        file: Annotated[
            BinaryIO,
            Doc("The standard Python file object (non-async)."),
        ]
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  6. docs_src/dependencies/tutorial012_an_py39.py

    from fastapi import Depends, FastAPI, Header, HTTPException
    from typing_extensions import Annotated
    
    
    async def verify_token(x_token: Annotated[str, Header()]):
        if x_token != "fake-super-secret-token":
            raise HTTPException(status_code=400, detail="X-Token header invalid")
    
    
    async def verify_key(x_key: Annotated[str, Header()]):
        if x_key != "fake-super-secret-key":
            raise HTTPException(status_code=400, detail="X-Key header invalid")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 756 bytes
    - Viewed (0)
  7. docs_src/websockets/tutorial003.py

        async def broadcast(self, message: str):
            for connection in self.active_connections:
                await connection.send_text(message)
    
    
    manager = ConnectionManager()
    
    
    @app.get("/")
    async def get():
        return HTMLResponse(html)
    
    
    @app.websocket("/ws/{client_id}")
    async def websocket_endpoint(websocket: WebSocket, client_id: int):
        await manager.connect(websocket)
        try:
            while True:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Aug 09 13:52:19 GMT 2020
    - 2.5K bytes
    - Viewed (0)
  8. src/main/java/org/codelibs/fess/mylasta/direction/sponsor/FessMailDeliveryDepartmentCreator.java

    import org.dbflute.mail.send.supplement.async.SMailAsyncStrategy;
    import org.dbflute.mail.send.supplement.filter.SMailSubjectFilter;
    import org.dbflute.mail.send.supplement.label.SMailLabelStrategy;
    import org.dbflute.optional.OptionalThing;
    import org.dbflute.util.DfStringUtil;
    import org.lastaflute.core.magic.async.AsyncManager;
    import org.lastaflute.core.magic.async.ConcurrentAsyncCall;
    Java
    - Registered: Mon Apr 29 08:04:11 GMT 2024
    - Last Modified: Thu Feb 22 01:37:57 GMT 2024
    - 7K bytes
    - Viewed (0)
  9. docs_src/dependencies/tutorial001_py310.py

    from fastapi import Depends, FastAPI
    
    app = FastAPI()
    
    
    async def common_parameters(q: str | None = None, skip: int = 0, limit: int = 100):
        return {"q": q, "skip": skip, "limit": limit}
    
    
    @app.get("/items/")
    async def read_items(commons: dict = Depends(common_parameters)):
        return commons
    
    
    @app.get("/users/")
    async def read_users(commons: dict = Depends(common_parameters)):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 404 bytes
    - Viewed (0)
  10. docs_src/bigger_applications/app_an_py39/routers/users.py

    router = APIRouter()
    
    
    @router.get("/users/", tags=["users"])
    async def read_users():
        return [{"username": "Rick"}, {"username": "Morty"}]
    
    
    @router.get("/users/me", tags=["users"])
    async def read_user_me():
        return {"username": "fakecurrentuser"}
    
    
    @router.get("/users/{username}", tags=["users"])
    async def read_user(username: str):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 407 bytes
    - Viewed (0)
Back to top