Skip to content

Commit

Permalink
Fix StopAsyncIteration exception if closing subscribed sessions. 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinTArthur committed May 15, 2020
1 parent 67acbad commit 5a401b7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# serverwamp Changelog
## 1.0.1
* Fix stopasynciteration exception on session close with outstanding subscriptions.

## 1.0.0
Brand new API with…
* Support for multiple realms w/ separate handlers
Expand Down
15 changes: 10 additions & 5 deletions serverwamp/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,16 @@ async def handle_connection(self, connection):
finally:
state_iters = self._session_state_exits.pop(session, EMPTY_SET)
if state_iters:
async with (
self._async_support.launch_task_group()
) as exit_tasks:
for state_iter in state_iters:
await exit_tasks.spawn(state_iter.__anext__)
# TODO, make exits concurrent
for state_iter in state_iters:
try:
await state_iter.__anext__()
except StopAsyncIteration:
pass
else:
# TODO: throw exception because there should only
# be one more iteration.
pass

# Default Realm Configuration…
def set_authentication_handler(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='serverwamp',
version='1.0.0',
version='1.0.1',
description=('Components that add Web Application Messaging Protocol '
'features to WebSocket servers.'),
long_description=open('README.md').read(),
Expand Down

0 comments on commit 5a401b7

Please sign in to comment.