Documentation
¶
Overview ¶
Package examples contains small, runnable snippets that demonstrate how to use iox's non-blocking semantics in typical copy-style flows.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyWithErrMore ¶
func CopyWithErrMore() ( firstN int64, firstErr error, secondN int64, secondErr error, thirdN int64, thirdErr error, out string, )
CopyWithErrMore demonstrates handling of ErrMore across repeated calls.
Contract for this scripted source:
- First attempt: progress + ErrMore (more completions will follow).
- Second attempt: progress + ErrMore (still ongoing).
- Third attempt: progress + nil (final completion of the logical op).
Caller must treat ErrMore as: "process this completion and keep the operation active; retry after the next poll/CQE".
func CopyWithPolicy ¶ added in v0.2.0
CopyWithPolicy shows how to specify a SemanticPolicy for Copy.
In most cases you don't pass a policy (nil keeps the default non-blocking behavior), but if you want the helper to yield/retry on ErrWouldBlock, pass a policy that returns PolicyRetry and provides a Yield hook.
func CopyWithWouldBlock ¶
func CopyWithWouldBlock() (firstN int64, firstErr error, secondN int64, secondErr error, out string)
CopyWithWouldBlock demonstrates that ErrWouldBlock means "stop now and retry after readiness". The first copy returns (0, ErrWouldBlock); the second copy makes progress and completes.
Types ¶
This section is empty.