Skip to content

Commit

Permalink
Release 0.0.9 - added exception event hook which is fired when except…
Browse files Browse the repository at this point in the history
…ion (e.g. WebSocketConnectionClosedException) happens during connection
  • Loading branch information
PawelTroka committed Aug 10, 2018
1 parent 60d3a0e commit 649dabf
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
4 changes: 3 additions & 1 deletion DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
signalr-client-threads
=================
======================

Python client proxy for `SignalR <http://signalr.net/>`_.

*Note: This is currently not compatible with ASP.NET Core SignalR (.NET Core 2.1), due to some changes in SignalR protocol there.*


Requirements
------------
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name='signalr-client-threads',
version='0.0.8',
version='0.0.9',
description='Fork of SignalR client for Python based on threads instead of gevent',
long_description=long_description,
url='https://github.com/PawelTroka/signalr-client-threads',
Expand All @@ -27,6 +27,8 @@
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
keywords='signalr',
packages=find_packages(),
Expand Down
2 changes: 1 addition & 1 deletion signalr/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from ._connection import Connection

__version__ = '0.0.7'
__version__ = '0.0.9'
7 changes: 6 additions & 1 deletion signalr/_connection.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import sys
from threading import Thread
from signalr.events import EventHook
from signalr.hubs import Hub
Expand All @@ -19,6 +20,7 @@ def __init__(self, url, session):
self.error = EventHook()
self.starting = EventHook()
self.stopping = EventHook()
self.exception = EventHook()
self.is_open = False
self.__transport = AutoTransport(session, self)
self.__listener_thread = None
Expand Down Expand Up @@ -52,7 +54,10 @@ def start(self):

def wrapped_listener():
while self.is_open:
listener()
try:
listener()
except:
self.exception.fire(*sys.exc_info())

self.is_open = True
self.__listener_thread = Thread(target=wrapped_listener)
Expand Down

0 comments on commit 649dabf

Please sign in to comment.