Skip to content

Async support for managers (SyncManager, HighlightManager, etc.) #18

@EvanOman

Description

@EvanOman

Summary

The manager classes (SyncManager, HighlightManager, BookManager, DocumentManager) are synchronous only. For async applications, async versions would be valuable.

Current Managers

  • HighlightManager - high-level highlight operations
  • BookManager - high-level book operations
  • DocumentManager - high-level document operations
  • SyncManager - incremental sync with state tracking

Proposed Async Managers

from readwise_sdk.managers import AsyncHighlightManager, AsyncSyncManager

async with AsyncReadwiseClient() as client:
    manager = AsyncHighlightManager(client)
    highlights = await manager.get_highlights_since(days=7)
    
    sync_mgr = AsyncSyncManager(client, state_file='sync.json')
    result = await sync_mgr.sync_highlights(on_item=callback)

Priority

This is lower priority than #16 and #17. Applications can work with the raw async client methods. Managers are a convenience layer.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions