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.2.zip (9.0 kB view details)

Uploaded Source

Built Distribution

signalr_client-0.0.2-py2-none-any.whl (8.4 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for signalr-client-0.0.2.zip
Algorithm Hash digest
SHA256 9aa2edb593076651fdfb79131623f54a172d8eaec68a2580fd959f946fa77499
MD5 9fcd825ea9cc1c30ed67429f0b9f33f9
BLAKE2b-256 93c66cbfef9c476f4ecc0fab01e48875ce922500600f35fe53b2ebb872d37328

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for signalr_client-0.0.2-py2-none-any.whl
Algorithm Hash digest
SHA256 6079c40071f771066d9dce61a9a4e50151ba848538079111d387b26f51160186
MD5 fe6b05bb0669a27361782f2fadcf858c
BLAKE2b-256 72aaccf83af817012ac0b9fe9789d2067cca1f9a55253bd3c25b792a6f354d0a

See more details on using hashes here.

Supported by

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