Skip to content

refactor-main#67

Draft
petrubraha wants to merge 2 commits into
playgroundfrom
refactor-main
Draft

refactor-main#67
petrubraha wants to merge 2 commits into
playgroundfrom
refactor-main

Conversation

@petrubraha

@petrubraha petrubraha commented Jan 24, 2026

Copy link
Copy Markdown
Member

Features

  • reactor
  • multiplexer
  • reactor_proxy (old reactor_client)
  • app

The goal is to disable core.IS_CLI checks and assertions (e.g. page is not None).

IS_CLI spots:

  • main
  • reactor.init - dict[Connection, Chat]
  • reactor_client.bind_chat
  • multiplexing.cond_render - page.run_task

Workflow

These scripts trigger their corresponding init_* method. The init_* steps:

  • create Page (if GUI mode)

  • create Reactor

  • create ReactorProxy

  • create App

  • pass app shutdown to page.on_close()

  • call main.py (bin/run.sh)

  • call

class AppCli:
  __init__(reactor_proxy)
  add_conn(conn_data)
  rem_conn(conn)
  shutdown()

class AppGui(CliApp):
  __init__(reactor_proxy, layout)
  add_conn(conn_data)
  rem_conn(conn)
  shutdown() - awaits page.destroy

Changes to be made:

  • rename core -> util
  • create init_cli, init_gui
  • create main_cli.py - creates a ReactorCli, ReactorProxyCli, AppCli
  • create main_gui.py - creates a ReactorGui, ReactorProxyGui, AppGui

Directory structure:

core/
  reactor/
    reactor_cli
    reactor_gui
  reactor_proxy/
    reactor_proxy_cli
    reactor_proxy_gui
  app/
    app_cli
    app_gui
  init_workflow

@coderabbitai

coderabbitai Bot commented Jan 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor-main

Comment @coderabbitai help to get the list of available commands and usage tips.

@petrubraha petrubraha self-assigned this Jan 24, 2026
@petrubraha petrubraha added the enhancement New feature or request label Jan 24, 2026
Comment thread src/core/__init__.py

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unit tests?

@petrubraha petrubraha changed the title feat and main refactor: reactor, multiplexer, reactor_client main refactor Jan 24, 2026
@petrubraha petrubraha changed the title main refactor refactor: main Jan 24, 2026
@petrubraha petrubraha moved this from Todo to In Progress in RC-application-planning Jan 24, 2026
@petrubraha petrubraha changed the title refactor: main refactor-main Jan 25, 2026
@petrubraha petrubraha changed the base branch from main to playground January 25, 2026 12:43
@petrubraha

Copy link
Copy Markdown
Member Author
Name                                                Stmts   Miss  Cover   Missing
---------------------------------------------------------------------------------
src\main.py                                            39     39     0%   1-57
src\multiplexing.py                                    84     84     0%   7-183
src\network\connection.py                              17      1    94%   35
src\reactor.py                                         75     70     7%   20-185
src\transmission\handle_read.py                        25     25     0%   1-61
src\transmission\handle_write.py                       41     41     0%   1-82
src\transmission\processor.py                          45     45     0%   1-115

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant