
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
signalr-client-threads
Advanced tools
Fork of SignalR client for Python based on threads instead of gevent
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.
Install requirements by running::
pip install -r requirements
Fork of SignalR client for Python based on threads instead of gevent.
Compatible with Python 2 and 3.
Here is sample usage::
from requests import Session
from signalr import Connection
with Session() as session:
#create a connection
connection = Connection("http://localhost:5000/signalr", session)
#get chat hub
chat = connection.register_hub('chat')
#start a connection
connection.start()
#create new chat message handler
def print_received_message(data):
print('received: ', data)
#create new chat topic handler
def print_topic(topic, user):
print('topic: ', topic, user)
#create error handler
def print_error(error):
print('error: ', error)
#receive new chat messages from the hub
chat.client.on('newMessageReceived', print_received_message)
#change chat topic
chat.client.on('topicChanged', print_topic)
#process errors
connection.error += print_error
#start connection, optionally can be connection.start()
with connection:
#post new message
chat.server.invoke('send', 'Python is here')
#change chat topic
chat.server.invoke('setTopic', 'Welcome python!')
#invoke server method that throws error
chat.server.invoke('requestError')
#post another message
chat.server.invoke('send', 'Bye-bye!')
#wait a second before exit
connection.wait(1)
FAQs
Fork of SignalR client for Python based on threads instead of gevent
We found that signalr-client-threads demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.