mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-06-05 21:20:40 +02:00
updates docs
This commit is contained in:
parent
60287fef95
commit
2d39c56e3d
@ -50,12 +50,14 @@ import pydase
|
|||||||
class MyService(pydase.DataService):
|
class MyService(pydase.DataService):
|
||||||
proxy = pydase.Client(
|
proxy = pydase.Client(
|
||||||
url="ws://<ip_addr>:<service_port>",
|
url="ws://<ip_addr>:<service_port>",
|
||||||
block_until_connected=False
|
block_until_connected=False,
|
||||||
|
client_id="my_pydase_client_id",
|
||||||
).proxy
|
).proxy
|
||||||
# For SSL-encrypted services, use the wss protocol
|
# For SSL-encrypted services, use the wss protocol
|
||||||
# proxy = pydase.Client(
|
# proxy = pydase.Client(
|
||||||
# url="wss://your-domain.ch",
|
# url="wss://your-domain.ch",
|
||||||
# block_until_connected=False
|
# block_until_connected=False,
|
||||||
|
# client_id="my_pydase_client_id",
|
||||||
# ).proxy
|
# ).proxy
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
@ -67,6 +69,7 @@ if __name__ == "__main__":
|
|||||||
In this example:
|
In this example:
|
||||||
- The `MyService` class has a `proxy` attribute that connects to a `pydase` service at `<ip_addr>:<service_port>`.
|
- The `MyService` class has a `proxy` attribute that connects to a `pydase` service at `<ip_addr>:<service_port>`.
|
||||||
- By setting `block_until_connected=False`, the service can start without waiting for the connection to succeed, which is particularly useful in distributed systems where services may initialize in any order.
|
- By setting `block_until_connected=False`, the service can start without waiting for the connection to succeed, which is particularly useful in distributed systems where services may initialize in any order.
|
||||||
|
- By setting `client_id`, the server will provide more accurate logs of the connecting client. If set, this ID is sent as `X-Client-Id` header in the HTTP(s) request.
|
||||||
|
|
||||||
## Custom `socketio.AsyncClient` Connection Parameters
|
## Custom `socketio.AsyncClient` Connection Parameters
|
||||||
|
|
||||||
|
@ -56,6 +56,9 @@ class Client:
|
|||||||
[`AsyncClient`][socketio.AsyncClient]. This allows fine-tuning of the
|
[`AsyncClient`][socketio.AsyncClient]. This allows fine-tuning of the
|
||||||
client's behaviour (e.g., reconnection attempts or reconnection delay).
|
client's behaviour (e.g., reconnection attempts or reconnection delay).
|
||||||
Default is an empty dictionary.
|
Default is an empty dictionary.
|
||||||
|
client_id: Client identification that will be shown in the server logs this
|
||||||
|
client is connecting to. This ID is passed as a `X-Client-Id` header in the
|
||||||
|
HTTP(s) request. Defaults to None.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
The following example demonstrates a `Client` instance that connects to another
|
The following example demonstrates a `Client` instance that connects to another
|
||||||
|
Loading…
x
Reference in New Issue
Block a user