Skip to main content

Simple SignalR client for Python

Project description

Python client proxy for SignalR.

Requirements

Install the following prerequisites using pip:

  • gevent

  • sseclient

  • websocket-client

The gevent package in turn requires Python headers. In Debian based distributions (such as Ubuntu and Raspbian) they are called python-dev.

Compatibility

Only compatible with Python 2, not Python 3.

Usage

Here is sample usage:

#create a connection
connection = Connection(url, session)

#start a connection
connection.start()

#add a handler to process notifications to the connection
connection.handlers += lambda data: print 'Connection: new notification.', data

#get chat hub
chat_hub = connection.hub('chat')

#create new chat message handler
def message_received(message):
    print 'Hub: New message.', message

#receive new chat messages from the hub
chat_hub.client.on('message_received', message_received)

#send a new message to the hub
chat_hub.server.invoke('send_message', 'Hello!')

#do not receive new messages
chat_hub.client.off('message_received', message_received)

#close the connection
connection.close()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

signalr-client-0.0.5.zip (9.1 kB view details)

Uploaded Source

Built Distribution

signalr_client-0.0.5-py2-none-any.whl (8.5 kB view details)

Uploaded Python 2

File details

Details for the file signalr-client-0.0.5.zip.

File metadata

  • Download URL: signalr-client-0.0.5.zip
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for signalr-client-0.0.5.zip
Algorithm Hash digest
SHA256 cc0e67069840480f75e79d639dc21339efebc3306b4cb316d77c072767ba6bc5
MD5 5095d42488b6362ece6b0c0630cadd7f
BLAKE2b-256 13a6eb7c7e5494f91539f8d3363c95a294a4f01763ccbd7a4ee7c67b39b5c9cb

See more details on using hashes here.

File details

Details for the file signalr_client-0.0.5-py2-none-any.whl.

File metadata

File hashes

Hashes for signalr_client-0.0.5-py2-none-any.whl
Algorithm Hash digest
SHA256 8ba3031c317362f6a2ed88b810193985c51591cab81c6c6fa8ec2208047e199d
MD5 467f904f9ae310fe103fd41dea928506
BLAKE2b-256 e01828580d86a800266c66ee674bee621caec0be6a15383970bc7a59821f66b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page