Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed processing of heartbeats and a session expiration and addeds support of aiohttp_cors #448

Merged
merged 24 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0469b8c
- Fixed processing of heartbeats and a session expiration.
Cykooz Feb 8, 2022
12a7dd3
Merge branch 'master' into fix_hearbeats
Cykooz Feb 8, 2022
6b27720
Deleted method ``SessionManager.route_url()``.
Cykooz Feb 8, 2022
2b89b0e
Added release date into CHANGES.rst
Cykooz Feb 8, 2022
7875007
Removed commented code from tests and fixed CHANGES.rst
Cykooz Feb 9, 2022
04b78f3
- Added argument ``cors_config`` into function ``add_endpoint()`` to …
Cykooz Jan 18, 2023
953282b
Fixed GitHub actions
Cykooz Jan 18, 2023
53dadc0
Fixed GitHub actions
Cykooz Jan 18, 2023
879ccc0
Fixed GitHub actions
Cykooz Jan 18, 2023
83818c3
Fixed version of flake8 to support Python 3.7
Cykooz Jan 18, 2023
c120b9e
Fixed typing
Cykooz Jan 18, 2023
91fc90f
Reverted pytest-timeout
Cykooz Jan 18, 2023
c1ccb56
Removed embedded CORS processing.
Cykooz Jan 19, 2023
8747ea1
Added arguments ``heartbeat_delay`` and ``disconnect_delay`` into fun…
Cykooz Jan 25, 2023
c8b36fa
- Heartbeat task moved from ``SessionManager`` into ``Session``.
Cykooz Jan 26, 2023
21e2728
Added processing of ``ConnectionError`` in ``StreamingTransport``.
Cykooz Jun 9, 2023
140c4b2
Fixed name of transports.
Cykooz Jun 14, 2023
8516f02
- Changed arguments of handler function. Now handler function must be…
Cykooz Jul 7, 2023
7b3af51
Fixed error processing in StreamingTransport
Cykooz Jul 7, 2023
6850a48
Changed supported versions of Python.
Cykooz Jul 7, 2023
cb90f5d
Added "sockjs_transport_name" into request object.
Cykooz Jul 10, 2023
1ef9c1d
- Updated dependencies versions.
Cykooz Jun 13, 2024
645ca01
Fixed dependencies.
Cykooz Jun 13, 2024
f617baa
Fixed versions of GitHub actions.
Cykooz Jun 13, 2024
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
7 changes: 0 additions & 7 deletions .coveragerc

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/check_and_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Check and Test

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch: {}


jobs:
run_tests:
strategy:
matrix:
python-version: [ "3.10", "3.11", "3.12" ]

name: Test on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Install dependencies
run: |
python -m pip install --upgrade setuptools
python -m pip install -r requirements.txt
python -m pip install -e .[test]

- name: Run checks and tests
run: |
make flake
pytest ./tests
6 changes: 3 additions & 3 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
python -m pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ eggs
sources
dist
develop-eggs
build
*.egg-info
*.pyc
*.pyo
Expand Down
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

60 changes: 60 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,66 @@
CHANGES
=======

0.13.0 (not-released)
---------------------

- Added argument ``cors_config`` into function ``add_endpoint()``
to support of CORS settings from ``aiohttp_cors``.
- Added arguments ``heartbeat_delay`` and ``disconnect_delay``
into function ``add_endpoint()``.
- Function ``add_endpoint()`` now returns all registered routes.
- Replaced returning instances of error HTTP responses
on raising its as exceptions.
- Changed name of some routes.
- Heartbeat task moved from ``SessionManager`` into ``Session``.
- Methods ``_acquire`` and ``_release`` of ``Sessions`` renamed into
``acquire`` and ``release``.
- Added processing of ``ConnectionError`` in ``StreamingTransport``.
- Changed arguments of handler function. Now handler function must be defined
like ``async def handler(manager, session, msg):``
- Constants:

- FRAME_OPEN
- FRAME_CLOSE
- FRAME_MESSAGE
- FRAME_MESSAGE_BLOB
- FRAME_HEARTBEAT

replaced by ``Frame`` enums with corresponding values.
- Constants:

- MSG_OPEN
- MSG_MESSAGE
- MSG_CLOSE
- MSG_CLOSED

replaced by ``MsgType`` enums with corresponding values.
- Constants:

- STATE_NEW
- STATE_OPEN
- STATE_CLOSING
- STATE_CLOSED

replaced by ``SessionState`` enums with corresponding values.


0.12.0 (2022-02-08)
-------------------

- **Breaking change:** Removed argument ``timeout`` from ``Session.__init__()``
and ``SessionManager.__init__()``.
- **Breaking change:** Argument ``heartbeat`` of ``SessionManager.__init__()``
renamed into ``heartbeat_delay``.
- **Breaking change:** ``Session.registry`` renamed into ``Session.app``.
- **Breaking change:** Deleted method ``SessionManager.route_url()``.
- **Breaking change:** Dropped support of Python < 3.7
- Fixed processing of heartbeats and a session expiration.
- Fixed ping-pong based heartbeats for web-socket connections.
- Added arguments ``heartbeat_delay`` and ``disconnect_delay`` into
``Session.__init__()``.
- Added argument ``disconnect_delay`` into ``SessionManager.__init__()``.

0.11.0 (2020-10-22)
-------------------

Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ include README.rst
include Makefile
include sockjs-testsrv.py
graft sockjs
graft docs
graft examples
graft tests
global-exclude *.pyc
21 changes: 2 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,17 @@ FLAGS=


flake:
# python setup.py check -rms
flake8 sockjs tests examples
if python -c "import sys; sys.exit(sys.version_info<(3,6))"; then \
black --check sockjs tests setup.py; \
fi

fmt:
black sockjs tests setup.py


develop:
python setup.py develop
pip install -e .[test]

test: flake develop
pytest $(FLAGS) ./tests/

vtest: flake develop
pytest -s -v $(FLAGS) ./tests/

cov cover coverage: flake develop
@py.test --cov=sockjs --cov-report=term --cov-report=html tests
@echo "open file://`pwd`/coverage/index.html"

clean:
rm -rf `find . -name __pycache__`
rm -f `find . -type f -name '*.py[co]' `
Expand All @@ -40,11 +28,6 @@ clean:
rm -rf coverage
rm -rf build
rm -rf cover
make -C docs clean
python setup.py clean

doc:
make -C docs html
@echo "open file://`pwd`/docs/_build/html/index.html"

.PHONY: all build venv flake test vtest testloop cov clean doc
.PHONY: all flake test vtest clean
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Supported transports
Requirements
------------

- Python 3.5.3
- Python 3.10.0

- gunicorn 19.2.0

Expand Down
67 changes: 0 additions & 67 deletions docs/Makefile

This file was deleted.

23 changes: 0 additions & 23 deletions docs/api.rst

This file was deleted.

Loading