Skip to content

Name dispatcher shutdown close_dispatch and chain its constructor - #31

Merged
trissim merged 1 commit into
mainfrom
claude-a/dispatch-close-name
Nov 16, 2026
Merged

trissim merged 1 commit into
mainfrom
claude-a/dispatch-close-name

Conversation

@trissim

@trissim trissim commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Why

pyqt-reactive's UiThreadDispatcher is a hand copy of MainThreadDispatcher (its own _UiThreadCall, close, call, post, own error classes), so on pyqt-reactive main 3 of 7 test_ui_thread_dispatch.py tests fail: they expect formbridge's MainThreadDispatcherClosedError/MainThreadDispatchTimeoutError and 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 beside QWidget, so schedule_ui is the app's own post, not a forward to a held helper.

Two things here stopped that composition:

  • MainThreadDispatcher.__init__ ended the cooperative chain, so QWidget.__init__ never ran behind it.
  • its close() would shadow QWidget.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) continues super().__init__.
  • close → close_dispatch; callers: bridge/in_process.py:806 and tests/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

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
@trissim
trissim merged commit c7f1835 into main Nov 16, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant