A python framework for creating a server which handles websockets for an existing API
Project description
high-templar
====================
A python framework for creating a stateful server which handles websocket functionality for an existing HTTP only API.
Flow
-------
- A client opens a websocket connection with a High-templar instance.
- The HT instance proxies the request to the API, which in turn handles authentication and provides a list of rooms.
- The HT instance tells the client what rooms he is allowed to subscribe to.
- The client subscribes to one or more rooms
- When receiving a trigger from the API, the HT instance publishes the received data to the specified rooms.
|architecture|
Motivation
------
This project is created for handling websockets for a django instance.
Django doesn't support websockets out of the box. To add websocket support to Django, one can either
monkey patch the Django WSGI with gevent, or use django-channels which requires a lot of configuration and needs you to manage its workers.
High-templar uses a similar approach to django-channels, but uses internal HTTP requests to communicate with the existing Django instance. High-templar keeps track of the active websocket connections, which allows the Django instance to remain stateless.
Origin
------
This repository is based on archon_. Archon is a framework for creating full fledged websocket based CRUD APIs. High-templar is only half the framework of Archon, as it relies on an existing API and only provides pubsub.
.. |architecture| image:: architecture.png
.. _archon: https://github.com/JasperStam/archon
====================
A python framework for creating a stateful server which handles websocket functionality for an existing HTTP only API.
Flow
-------
- A client opens a websocket connection with a High-templar instance.
- The HT instance proxies the request to the API, which in turn handles authentication and provides a list of rooms.
- The HT instance tells the client what rooms he is allowed to subscribe to.
- The client subscribes to one or more rooms
- When receiving a trigger from the API, the HT instance publishes the received data to the specified rooms.
|architecture|
Motivation
------
This project is created for handling websockets for a django instance.
Django doesn't support websockets out of the box. To add websocket support to Django, one can either
monkey patch the Django WSGI with gevent, or use django-channels which requires a lot of configuration and needs you to manage its workers.
High-templar uses a similar approach to django-channels, but uses internal HTTP requests to communicate with the existing Django instance. High-templar keeps track of the active websocket connections, which allows the Django instance to remain stateless.
Origin
------
This repository is based on archon_. Archon is a framework for creating full fledged websocket based CRUD APIs. High-templar is only half the framework of Archon, as it relies on an existing API and only provides pubsub.
.. |architecture| image:: architecture.png
.. _archon: https://github.com/JasperStam/archon
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
high_templar-0.1.0.tar.gz
(8.0 kB
view hashes)
Built Distribution
Close
Hashes for high_templar-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26bb0d9c7a8d565b0d0e9a186f5113e3c651c28bb63373480d57233e7cc34424 |
|
MD5 | 3cce43d2aae7563c732f8333dbc6ff5e |
|
BLAKE2b-256 | caed0c1a772d9d93ab321281e29039f1f683e2f88ccb8560cf4165736e47b08b |