Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
run: python -Im tox -e ${{ matrix.toxenv }}

tests:
name: Python ${{ matrix.python-version }} (${{ matrix.os }})
name: Python ${{ matrix.python-version }} (${{ matrix.os }})${{ matrix.asyncio-debug && ' [asyncio-debug]' || '' }}
strategy:
fail-fast: false
matrix:
Expand All @@ -70,6 +70,11 @@ jobs:
- os: ubuntu-latest
python-version: "3.14"

# Python 3.14 with asyncio debug mode
- os: ubuntu-latest
python-version: "3.14"
asyncio-debug: true

runs-on: ${{ matrix.os }}

steps:
Expand All @@ -93,8 +98,19 @@ jobs:

- name: Run tests
run: python -Im tox -e ${{ env.TOX_ENV }}
env:
PYTHONASYNCIODEBUG: ${{ matrix.asyncio-debug && '1' || '' }}

- name: Rename coverage data
if: ${{ !matrix.asyncio-debug }}
shell: bash
run: |
if test -f .coverage; then
mv .coverage{,.${{ matrix.os }}.${{ env.TOX_ENV }}}
fi

- name: Upload coverage data
if: ${{ !matrix.asyncio-debug }}
uses: actions/upload-artifact@v4
with:
name: coverage-data-${{ matrix.os }}-${{ matrix.python-version }}
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CodSpeed

on:
push:
branches:
- master
pull_request:
workflow_dispatch:

permissions:
contents: read
id-token: write

jobs:
codspeed:
name: Run benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: pip

- name: Install dependencies
run: |
python -Im pip install --upgrade pip
python -Im pip install -e .
python -Im pip install pytest pytest-asyncio pytest-codspeed

- name: Run benchmarks
uses: CodSpeedHQ/action@v4
with:
mode: simulation
run: pytest telnetlib3/tests/test_benchmarks.py --codspeed -o "addopts="
33 changes: 0 additions & 33 deletions DESIGN.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,6 @@ Retired by author, looking for new owner :) or some help!
Design
======

performance
-----------

The client appears to be very poor-performing under load. I wrote a basic server
that is capable of sending a very large stream of data, "max headroom" demo at
telnet 1984.ws, and it totally kills the client. Maybe the client is so busy
processing incoming data that it is not allowing for tasks to read it from the
other end?

Maybe this is async "backpressure"

reduce
------

Expand All @@ -27,28 +16,6 @@ rather shoe-horned, main() should declare keywords.
**this is completed for server, copy to client**


wait_for_negotiation
--------------------

We need a way to wish to wait for a state. For example, our client shell might await
until local_echo is False, or remote_option[ECHO] is True to change terminal state
to reflect it. A function wait_for, receiving a function that returns True when state
is met, will be called back continuously after each block of data received containing
an IAC command byte, but the boiler code simply returns the waiter.

This should allow us to spray the client with feature requests, and await the
completion of their negotiation, especially for things like LINEMODE that might
have many state changes, this allows asyncio to solve the complex "awaiting
many future states in parallel" event loop easily

-- just accept a future, and on each state change, call an internal function
that checks for equality for the parameters given, and when true, set .done()

after some thought, we should hardcode common ones, such as await
negotiate_kludge() -> bool, wait_for_naws() -> bool, and,
maybe a common wait_for_slc() that just returns some description
of the state change that has occurred with maybe values

BaseTelnetProtocol
------------------

Expand Down
Loading
Loading