Skip to content

[Task] docs: Document async database operations API #356

Description

@kcenon

Summary

Document the asynchronous database operations API at database/async/async_operations.h which provides non-blocking query execution.

Parent Issue

Part of: [EPIC] docs: Address documentation gaps across all ecosystem systems (kcenon/common_system#325)

Background (Why)

The async_operations.h module provides asynchronous database query execution, enabling non-blocking database access patterns. This is critical for high-throughput applications but is completely undocumented. Users must read source code to discover async capabilities.

Source files:

  • database/async/async_operations.h — Async operation definitions

Scope (What)

Add async operations documentation covering:

1. Async Architecture Overview

  • How async operations integrate with thread_system
  • Callback vs future-based patterns
  • Connection pool interaction in async context

2. API Reference

  • All async operation functions/methods
  • Parameter types and return types
  • Future/promise types used
  • Cancellation support

3. Usage Patterns

// Document patterns like:
auto future = db.async_query("SELECT * FROM users WHERE id = ?", {user_id});
auto result = future.get(); // blocking wait

// Or callback-based:
db.async_query("SELECT ...", {}, [](auto result) {
    // handle result
});

4. Error Handling

  • Async-specific error scenarios
  • Timeout handling
  • Connection loss during async operation
  • Retry strategies

5. Performance Considerations

  • When to use async vs sync operations
  • Connection pool sizing for async workloads
  • Batching async operations
  • Backpressure handling

6. Thread Safety

  • Which async operations are thread-safe
  • Shared state considerations
  • Result object thread safety

Acceptance Criteria

  • Async operations API fully documented
  • Usage examples for both future and callback patterns
  • Error handling patterns documented
  • Thread safety guarantees stated
  • Performance guidance provided
  • Integration with thread_system explained

Metadata

Metadata

Assignees

No one assigned

    Labels

    asyncAsynchronous operationsdocumentationImprovements or additions to documentationpriority:mediumMedium priority issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions