Search Options

Results per page
Sort
Preferred Languages
Advance

Results 71 - 80 of 369 for kAsync (0.19 sec)

  1. fastapi/background.py

            with open("log.txt", mode="w") as email_file:
                content = f"notification for {email}: {message}"
                email_file.write(content)
    
    
        @app.post("/send-notification/{email}")
        async def send_notification(email: str, background_tasks: BackgroundTasks):
            background_tasks.add_task(write_notification, email, message="some notification")
            return {"message": "Notification sent in the background"}
        ```
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Apr 02 02:48:51 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  2. docs/ko/docs/advanced/events.md

    !!! tip "팁"
        이 예제에서는 파일과 상호작용 하기 위해 파이썬 표준 함수인 `open()`을 사용하고 있습니다.
    
        따라서 디스크에 데이터를 쓰기 위해 "대기"가 필요한 I/O (입력/출력) 작업을 수행합니다.
    
        그러나 `open()`은 `async`와 `await`을 사용하지 않기 때문에 이벤트 핸들러 함수는 `async def`가 아닌 표준 `def`로 선언하고 있습니다.
    
    !!! info "정보"
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Apr 02 22:35:55 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  3. src/syscall/syscall_unix.go

    		}
    		if err == nil {
    			race.Acquire(unsafe.Pointer(&ioSync))
    		}
    	}
    	if msan.Enabled && n > 0 {
    		msan.Write(unsafe.Pointer(&p[0]), uintptr(n))
    	}
    	if asan.Enabled && n > 0 {
    		asan.Write(unsafe.Pointer(&p[0]), uintptr(n))
    	}
    	return
    }
    
    func Write(fd int, p []byte) (n int, err error) {
    	if race.Enabled {
    		race.ReleaseMerge(unsafe.Pointer(&ioSync))
    	}
    	if faketime && (fd == 1 || fd == 2) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 19 16:19:26 UTC 2024
    - 12.2K bytes
    - Viewed (0)
  4. docs/em/docs/advanced/events.md

    ```
    
    **🔑 👨‍💼** 🐍 🕳 👈 👆 💪 ⚙️ `with` 📄, 🖼, `open()` 💪 ⚙️ 🔑 👨‍💼:
    
    ```Python
    with open("file.txt") as file:
        file.read()
    ```
    
    ⏮️ ⏬ 🐍, 📤 **🔁 🔑 👨‍💼**. 👆 🔜 ⚙️ ⚫️ ⏮️ `async with`:
    
    ```Python
    async with lifespan(app):
        await do_stuff()
    ```
    
    🕐❔ 👆 ✍ 🔑 👨‍💼 ⚖️ 🔁 🔑 👨‍💼 💖 🔛, ⚫️❔ ⚫️ 🔨 👈, ⏭ 🛬 `with` 🍫, ⚫️ 🔜 🛠️ 📟 ⏭ `yield`, & ⏮️ ❎ `with` 🍫, ⚫️ 🔜 🛠️ 📟 ⏮️ `yield`.
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  5. pkg/controller/deployment/deployment_controller.go

    func (dc *DeploymentController) updateReplicaSet(logger klog.Logger, old, cur interface{}) {
    	curRS := cur.(*apps.ReplicaSet)
    	oldRS := old.(*apps.ReplicaSet)
    	if curRS.ResourceVersion == oldRS.ResourceVersion {
    		// Periodic resync will send update events for all known replica sets.
    		// Two different versions of the same replica set will always have different RVs.
    		return
    	}
    
    	curControllerRef := metav1.GetControllerOf(curRS)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 24.2K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/request-files.md

        * This is especially useful if you run `await myfile.read()` once and then need to read the contents again.
    * `close()`: Closes the file.
    
    As all these methods are `async` methods, you need to "await" them.
    
    For example, inside of an `async` *path operation function* you can get the contents with:
    
    ```Python
    contents = await myfile.read()
    ```
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Wed Mar 13 19:02:19 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  7. docs/zh/docs/tutorial/request-files.md

    `UploadFile` 支持以下 `async` 方法,(使用内部 `SpooledTemporaryFile`)可调用相应的文件方法。
    
    * `write(data)`:把 `data` (`str` 或 `bytes`)写入文件;
    * `read(size)`:按指定数量的字节或字符(`size` (`int`))读取文件内容;
    * `seek(offset)`:移动至文件 `offset` (`int`)字节处的位置;
        * 例如,`await myfile.seek(0) ` 移动到文件开头;
        * 执行 `await myfile.read()` 后,需再次读取已读取内容时,这种方法特别好用;
    * `close()`:关闭文件。
    
    因为上述方法都是 `async` 方法,要搭配「await」使用。
    
    例如,在 `async` *路径操作函数* 内,要用以下方式读取文件内容:
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Wed Mar 13 19:02:19 UTC 2024
    - 6.9K bytes
    - Viewed (0)
  8. docs/ru/docs/tutorial/request-files.md

    * `close()`: Закрыть файл.
    
    Поскольку все эти методы являются `async` методами, вам следует использовать "await" вместе с ними.
    
    Например, внутри `async` *функции операции пути* можно получить содержимое с помощью:
    
    ```Python
    contents = await myfile.read()
    ```
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Wed Mar 13 19:02:19 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/dependencies/index.md

    ## To `async` or not to `async`
    
    As dependencies will also be called by **FastAPI** (the same as your *path operation functions*), the same rules apply while defining your functions.
    
    You can use `async def` or normal `def`.
    
    And you can declare dependencies with `async def` inside of normal `def` *path operation functions*, or `def` dependencies inside of `async def` *path operation functions*, etc.
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  10. subprojects/build-events/src/test/groovy/org/gradle/internal/build/event/DefaultBuildEventsListenerRegistryTest.groovy

            when:
            registry.onTaskCompletion(provider)
    
            then:
            registry.subscriptions.size() == 1
            0 * listener._
    
            when:
            async {
                factory.fire(success)
                factory.fire(failure)
                factory.fire(skipped)
                signalBuildFinished()
            }
    
            then:
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Mar 12 02:21:10 UTC 2024
    - 8K bytes
    - Viewed (0)
Back to top