feat(origin): async save queuing for PLM origins #392

Open
opened 2026-03-03 23:04:15 +00:00 by forbes · 0 comments
Owner

Summary

Add non-blocking save operations so PLM origins (like Silo) don't freeze the UI during network operations on large assemblies.

Current state (MISSING)

All FileOrigin save methods (saveDocument, saveDocumentAs, commitDocument, pushDocument) are synchronous. No background thread, no queue, no progress callback, no cancellation.

Proposed design

import kindred_sdk as sdk

def on_save_complete(success, error):
    if not success:
        print(f"Save failed: {error}")

sdk.save_async(doc, callback=on_save_complete)
  • Background thread executes the origin's save method
  • Callback on Qt main thread with success/failure status
  • Status bar widget shows pending saves (uses existing register_status_widget)
  • Timeout and retry policy configurable per origin

Implementation notes

  • Add saveDocumentAsync() to FileOrigin base class (C++)
  • Default implementation: wrap synchronous saveDocument() in QThread / QRunnable
  • Origins can override for native async support
  • Thread safety: origin methods must not touch GUI; marshal results back via QMetaObject::invokeMethod
  • Python SDK: save_async(doc, callback) in kindred_sdk/origin.py
  • Add a PendingSaves status bar widget that shows count and progress

Roadmap

v0.2.0 — Origin System

## Summary Add non-blocking save operations so PLM origins (like Silo) don't freeze the UI during network operations on large assemblies. ## Current state (MISSING) All `FileOrigin` save methods (`saveDocument`, `saveDocumentAs`, `commitDocument`, `pushDocument`) are synchronous. No background thread, no queue, no progress callback, no cancellation. ## Proposed design ```python import kindred_sdk as sdk def on_save_complete(success, error): if not success: print(f"Save failed: {error}") sdk.save_async(doc, callback=on_save_complete) ``` - Background thread executes the origin's save method - Callback on Qt main thread with success/failure status - Status bar widget shows pending saves (uses existing `register_status_widget`) - Timeout and retry policy configurable per origin ## Implementation notes - Add `saveDocumentAsync()` to `FileOrigin` base class (C++) - Default implementation: wrap synchronous `saveDocument()` in `QThread` / `QRunnable` - Origins can override for native async support - Thread safety: origin methods must not touch GUI; marshal results back via `QMetaObject::invokeMethod` - Python SDK: `save_async(doc, callback)` in `kindred_sdk/origin.py` - Add a `PendingSaves` status bar widget that shows count and progress ## Roadmap v0.2.0 — Origin System
forbes added the enhancement label 2026-03-03 23:04:15 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/create#392