Skip to content

TODO: Make spending history publishing async #26

@shroominic

Description

@shroominic

TODO Location

sixty_nuts/events.py:371

Priority

🟡 Medium Priority - Performance improvement

Current Code

# Create history event
event = create_event(
    kind=EventKind.History,
    content=encrypted_content,
    tags=tags,
)

# TODO: make this async in background
return await self.relay_manager.publish_to_relays(event)

What needs to be done

  • Make spending history publication non-blocking
  • Continue wallet operations while history publishes in background
  • Ensure reliability without blocking user operations

Implementation

  1. Use asyncio.create_task() for background publishing
  2. Implement retry logic for failed publishes
  3. Add logging for tracking
  4. Consider using a queue for batching

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions