Function: set_timeout(timeout)
Purpose:
Sets the inactivity timeout (in seconds) before the ICE XL Publisher enters sleep (hibernation) mode. Controls how long the publisher stays active when not in use before it automatically sleeps.
Function Signature:
set_timeout(timeout: int) -> NoneParameters:
| Name | Type | Required | Default | Description |
| timeout | int | Yes | — | Number of seconds of inactivity before the publisher sleeps. |
Default Behavior & Internals:
- The publisher enters hibernation after a period of inactivity; this timeout is predefined internally but can be overridden with this function.
- Calling set_timeout() resets the internal countdown timer; the publisher stays active until the new timeout elapses without activity.
Example Scenarios:
- ice.set_timeout(0) → puts the publisher to sleep immediately when idle.
- ice.set_timeout(900) → keeps the publisher alive for 15 minutes after last use.
Notes:
- Controls idle timeout duration only — not active disconnection or session limits.
- Works with set_hibernation(): if hibernation is disabled (set_hibernation(False)), the timeout is ignored.
- Timeout must be an integer (seconds); floating-point values are not accepted.