Skip to content

Commit

Permalink
Introducing timeouts for connectiong, disconnecting, ...
Browse files Browse the repository at this point in the history
  • Loading branch information
ivgg-me committed Feb 25, 2024
1 parent 70c8696 commit 787b362
Show file tree
Hide file tree
Showing 4 changed files with 308 additions and 267 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ python example.py --help

## Running the bundled tests

To run the bundled tests you must create the `.\remootio_devices.configuration.json` file with a content according
To run the bundled tests you must create the `.\remootio_device.configuration.json` file with a content according
to the following template.

```
Expand Down
48 changes: 27 additions & 21 deletions src/aioremootio/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,35 @@
},
extra=REMOVE_EXTRA)
CONNECTION_OPTION_DEFAULT_VALUE_CONNECT_AUTOMATICALLY = True
MESSAGE_HANDLER_HEARTBEAT = 5
PING_SENDER_HEARTBEAT = 60
WAITING_DELAY = 1
WAITING_FOR_SAID_HELLO_DELAY = WAITING_DELAY
WAITING_FOR_DEVICE_ANSWERED_TO_HELLO_DELAY = WAITING_DELAY
LOCK_DELAY = 0.5
LIFECYCLE_LOCK_DELAY = LOCK_DELAY
CONNECTING_LOCK_DELAY = LOCK_DELAY
DISCONNECTING_LOCK_DELAY = LOCK_DELAY
AUTHENTICATING_LOCK_DELAY = LOCK_DELAY
TERMINATING_LOCK_DELAY = LOCK_DELAY
INITIALIZING_LOCK_DELAY = LOCK_DELAY
SAYING_HELLO_LOCK_DELAY = LOCK_DELAY
UPDATING_LAST_ACTION_ID_LOCK_DELAY = LOCK_DELAY
INVOKING_STATE_CHANGE_LISTENERS_LOCK_DELAY = LOCK_DELAY
ADDING_STATE_CHANGE_LISTENER_LOCK_DELAY = LOCK_DELAY
INVOKING_EVENT_LISTENERS_LOCK_DELAY = LOCK_DELAY
ADDING_EVENT_LISTENERS_LOCK_DELAY = LOCK_DELAY

HEARTBEAT_MESSAGE_HANDLER = 5
HEARTBEAT_PING_SENDER = 60

TIMEOUT_DEFAULT = 30
TIMEOUT_CONNECTING = TIMEOUT_DEFAULT
TIMEOUT_SAY_HELLO = TIMEOUT_DEFAULT
TIMEOUT_DISCONNECTING = TIMEOUT_DEFAULT

WAITING_DELAY_DEFAULT = 1
WAITING_DELAY_SAID_HELLO = WAITING_DELAY_DEFAULT
WAITING_DELAY_DEVICE_ANSWERED_TO_HELLO = WAITING_DELAY_DEFAULT

LOCK_RELEASE_DELAY_DEFAULT = 0.5
LOCK_RELEASE_DELAY_LIFECYCLE = LOCK_RELEASE_DELAY_DEFAULT
LOCK_RELEASE_DELAY_UPDATING_LAST_ACTION_ID = LOCK_RELEASE_DELAY_DEFAULT
LOCK_RELEASE_DELAY_MODIFYING_STATE_CHANGE_LISTENERS = LOCK_RELEASE_DELAY_DEFAULT
LOCK_RELEASE_TIMEOUT_MODIFYING_STATE_CHANGE_LISTENERS = TIMEOUT_DEFAULT
LOCK_RELEASE_DELAY_MODIFYING_EVENT_LISTENERS = LOCK_RELEASE_DELAY_DEFAULT
LOCK_RELEASE_TIMEOUT_MODIFYING_EVENT_LISTENERS = TIMEOUT_DEFAULT

ENCODING = "latin-1"

TASK_NAME_MESSAGE_RECEIVER_AND_HANDLER = "MessageReceiverAndHandler"
TASK_NAME_PING_SENDER = "PingSender"
TASK_NAME_CONNECTOR = "Connector"
TASK_NAME_DISCONNECTOR = "Disconnector"
TASK_STOPPED_DELAY = 5
TASK_STARTED_DELAY = 0.5
TASK_STOPPED_TIMEOUT = 10

TASK_STARTING_DELAY = 0.5
TASK_STARTING_TIMEOUT = 10
TASK_STOPPING_DELAY = 5
TASK_STOPPING_TIMEOUT = 10
Loading

0 comments on commit 787b362

Please sign in to comment.