File: tools.serve.rst

package info (click to toggle)
python-trame 3.12.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 101,620 kB
  • sloc: python: 13,515; sh: 183; javascript: 93; makefile: 7
file content (23 lines) | stat: -rw-r--r-- 1,084 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Python serve utility
====================================

This executable allow you to run a trame application as a single process for multiple users. 
As opposed to the regular launcher within our docker setup, this will run a single process
and execute each session within its own trame server as an asynchronous task in Python.

This tools is not meant to be used on a production server but could be enough for multi-users demos.

Also this assume that your trame application is using a class construct which expect a server as argument. 

The default example can be executed as follow:

.. code-block:: bash

    python -m trame.tools.serve

The possible arguments are:
  - `--exec`: Trame app to serve (default: `trame.app.demo:Cone`) where `Cone`` is the class to instantiate from the `trame.app.demo` module.
  - `--host`: IP or hostname to serve on (default: `localhost`)
  - `--port`: Port to serve on (default: `8080`)
  - `--ws-heart-beat`: WebSocket heart beat in seconds (default: `30`)
  - `--ws-max-size`: WebSocket maximum message size in bytes (default: `10000000`)