A Rackio extension to add a SocketIO Server to Rackio
Project description
rackio-socket
A Rackio extension to add a SocketIO Server to Rackio
Installation
pip install RackioSocket
Usage
from rackio import Rackio
from rackio_socket import RackioSocket
app = Rackio()
RackioSocket(app, 5005)
app.run(8028)
SocketIO Client
After running your application it will serve the SocketIO through the 5005 port.
var socket = io('http://localhost:5005');
Adding new events to your applications
You can add your custom events using the decorator pattern.
rs = RackioSocket()
@rs.event
def custom(sid):
print("custom event " , sid)
rs.emit("response", {"message": "this is the custom response"})
@rs.on("another custom")
def another_event(sid, data):
response = processing(data)
rs.emit('response', response)
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
RackioSocket-0.9.win-amd64.zip
(20.7 kB
view hashes)
Built Distribution
Close
Hashes for RackioSocket-0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11b9aa3ad43df060fffd9fa0faed9a451adad4e5f603f7af1ba9a41aa211b003 |
|
MD5 | e16ab2fa823d232824eefd5142ed281b |
|
BLAKE2b-256 | 6f1ad5c6b0c0ec742c071ba428f97b027a93caa207e1ba3c1b77f05b5e67aae6 |