Announce Server
A Python library that announces a server to a host.
Installation
pip install announce-server
Development
To install the developer dependencies required for testing and publishing:
pip install -e .[dev,pub]
Build
To build the package, run:
rm -rf dist/ build/ .eggs/ .pytest_cache/ src/announce_server.egg-info/
python -m build --sdist --wheel
To publish:
twine upload dist/*
Test
To run the tests, call:
pytest
Usage
from announce_server import register_service
@register_service(name="server_name", ip="server_ip", port=8000, host_ip="host_server_ip", host_port=5000, retry_interval=5)
def your_function():
pass
Registry
The announce_server CLI provides a simple way to start a registry server. The registry server keeps track of available services and periodically sends heartbeat messages to ensure that registered services are still active.
Command
announce_server start_registry [--address ADDRESS] [--port PORT] [--heartbeat_interval INTERVAL] [--heartbeat_timeout TIMEOUT]
Arguments
--address ADDRESS: The IP address of the server. Default:0.0.0.0.--port PORT: The port number of the server. Default:4999.--heartbeat_interval INTERVAL: The interval between heartbeat messages in seconds. Default:5.--heartbeat_timeout TIMEOUT: The timeout for waiting for a response in seconds. Default:3.
Example
To start the registry server with the default configuration, run:
announce_server start_registry
The full syntax is equivalent to:
announce_server start_registry --address 0.0.0.0 --port 4999 --heartbeat_interval 5 --heartbeat_timeout 3
Metadata
Release files for announce-server 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| announce-server-0.0.2.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| announce_server-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.0 kB
Release files / announce-server-0.0.2.tar.gz
| Download URL | announce-server-0.0.2.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
014325d79ffe3b30f935b0427513e6684f666131d61a266e5cf27f86abca8c52
|
|
BLAKE2b-256 checksum How to use checksums |
1cf904637f50d0f134f1c05c5403f6ad75c79c0980f8ef9cac558bc246765414
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Release files / announce_server-0.0.2-py3-none-any.whl
| Download URL | announce_server-0.0.2-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c84526b5026b56521c48bbf201b95be0d16e5f0968b2e0516f00bc789db894ce
|
|
BLAKE2b-256 checksum How to use checksums |
1ca3019093ae02178dc104a1a7dbd1d7a172bcae29de183e6f7afe8d66314ba8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|