Skip to main content

WebSocket connector for Ypy

Project description

Ypy-websocket

Ypy-websocket is an async WebSocket connector for Ypy.

Build Status Code style: black


Documentation: https://davidbrochart.github.io/ypy-websocket

Source Code: https://github.com/y-crdt/ypy-websocket


Ypy-websocket is a Python library for building WebSocket servers and clients that connect and synchronize shared documents. It can be used to create collaborative web applications.

The following diagram illustrates a typical architecture. The goal is to share a document among several clients.

Each client has an instance of a YDoc, representing their view of a document. A shared document also lives in a room on the server side. Conceptually, a room can be seen as the place where clients collaborate on a document. The WebSocket to which a client connects points to the corresponding room through the endpoint path. In the example below, clients A and B connect to a WebSocket at path room-1, and thus both clients find themselves in a room called room-1. All the YDoc synchronization logic is taken care of by the WebsocketProvider.

Each update to a shared document can be persisted to disk using a store, which can be a file or a database.

flowchart TD
    classDef room1 fill:#f96
    classDef room2 fill:#bbf
    A[Client A<br>room-1]:::room1 <-->|WebSocket<br>Provider| server(WebSocket Server)
    B[Client B<br>room-1]:::room1 <-->|WebSocket<br>Provider| server
    C[Client C<br>room-2]:::room2 <-->|WebSocket<br>Provider| server
    D[Client D<br>room-2]:::room2 <-->|WebSocket<br>Provider| server
    server <--> room1((room-1<br>clients: A, B)):::room1
    server <--> room2((room-2<br>clients: C, D)):::room2
    A <-..-> room1
    B <-..-> room1
    C <-..-> room2
    D <-..-> room2
    room1 ---> store1[(Store)]
    room2 ---> store2[(Store)]

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

ypy_websocket-0.12.3.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

ypy_websocket-0.12.3-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file ypy_websocket-0.12.3.tar.gz.

File metadata

  • Download URL: ypy_websocket-0.12.3.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for ypy_websocket-0.12.3.tar.gz
Algorithm Hash digest
SHA256 787255b2973d1a561fe8bdd5d1668f09417ff3ac806836435e260e387b927a88
MD5 56c8dbfd0c7942b4ce2c8a870a6e3b89
BLAKE2b-256 0d95ca35b63920f3962dc219c6ea33c9edc318dd626d989b595a423cefbfcfe3

See more details on using hashes here.

Provenance

File details

Details for the file ypy_websocket-0.12.3-py3-none-any.whl.

File metadata

File hashes

Hashes for ypy_websocket-0.12.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3a9fb2a15e756436da7c2654b116a3f118b39a5bf3bcf13a4d7f69b33311ed06
MD5 80c9f8b438df5b15f950f8ad809f98d2
BLAKE2b-256 00e257478eafff0ffc480519b613564221d3bd0c55c676811603266cca0306be

See more details on using hashes here.

Provenance

Supported by

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