File: README.md

package info (click to toggle)
python-autobahn 22.7.1%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,404 kB
  • sloc: python: 38,356; javascript: 2,705; makefile: 905; ansic: 371; sh: 63
file content (73 lines) | stat: -rw-r--r-- 1,682 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Using Frame-/Streaming-based APIs in AutobahnPython
===================================================

The example here demonstrate how to use the (advanced) frame-based and streaming WebSocket APIs
of AutobahnPython.

They also show off how to do advanced flow-control via the Twisted producer-consumer pattern.

The example clients produce random data, send it to a server which computes SHA256 fingerprints over the received data and send back the fingerprint to the client.

Compared are 4 variants of above functionality:

 * message-based API
 * frame-based API
 * streaming API
 * streaming API with producer-consumer pattern


Message-based Processing
------------------------

This pair of client/server uses the standard *message-based WebSocket API* of AutobahnPython.

Run the server by doing

    python message_based_server.py

and the client

    python message_based_client.py


Frame-based Processing
-----------------------

This pair of client/server uses the *frame-based WebSocket API* of AutobahnPython.

Run the server by doing

    python frame_based_server.py

and the client

    python frame_based_client.py


Streaming Processing
--------------------

This pair of client/server uses the *streaming WebSocket API* of AutobahnPython.

Run the server by doing

    python streaming_server.py

and the client

    python streaming_client.py


Producer-Consumer Processing
----------------------------

This pair of client/server uses the *streaming WebSocket API* of AutobahnPython together with the *Producer-Consumer Pattern* of Twisted.

Run the server by doing

    python streaming_server.py

and the client

    python streaming_producer_client.py