Repository navigation
Name dispatcher shutdown close_dispatch and chain its constructor - #31
Merged
Merged
Conversation
pyqt-reactive's UiThreadDispatcher is to become this family's Qt member, and Toad's Qt application inherits it beside QWidget so schedule_ui is the application's own post rather than a forward to a held dispatcher. Two things stopped that composition: MainThreadDispatcher.__init__ ended the cooperative chain (QWidget.__init__ never ran), and its close() would shadow QWidget.close() for any widget inheriting it. Chain the constructor and name the shutdown for what it stops; in_process.py and the dispatcher test are the only callers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016gZLdupVQyBzHTmHBC9Cyn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
pyqt-reactive's
UiThreadDispatcheris a hand copy ofMainThreadDispatcher(its own_UiThreadCall,close,call,post, own error classes), so on pyqt-reactive main 3 of 7test_ui_thread_dispatch.pytests fail: they expect formbridge'sMainThreadDispatcherClosedError/MainThreadDispatchTimeoutErrorand get the copy's. The follow-up pyqt-reactive PR makes it this family's Qt member (three hooks, copy deleted). Toad's Qt application then inherits it besideQWidget, soschedule_uiis the app's ownpost, not a forward to a held helper.Two things here stopped that composition:
MainThreadDispatcher.__init__ended the cooperative chain, soQWidget.__init__never ran behind it.close()would shadowQWidget.close()on any widget inheriting it (a window that can no longer close, which is a fun way to ship a phone app).Change
__init__(*args, **kwargs)continuessuper().__init__.close→close_dispatch; callers:bridge/in_process.py:806andtests/test_main_thread_dispatch.py. No alias.Checks
pytest tests/test_main_thread_dispatch.py tests/test_bridge.py→ 13 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_016gZLdupVQyBzHTmHBC9Cyn