Skip to main content
Version: 0.3.0
Last Verified: 2025-01-27
Package: hopx-ai on PyPI

Overview

Ready checks are utilities used in template building to verify that a template is ready before it’s considered complete. Use ready checks to ensure services are running, files exist, or commands succeed before the template is marked as ready.

Import

Available Ready Checks

wait_for_port

Wait for a port to be listening.
Parameters:
  • port (int): Port number to check
  • timeout (int, optional): Timeout in seconds (default: 60)
Example:

wait_for_url

Wait for a URL to be accessible.
Parameters:
  • url (str): URL to check
  • timeout (int, optional): Timeout in seconds
Example:

wait_for_file

Wait for a file to exist.
Parameters:
  • path (str): File path to check
  • timeout (int, optional): Timeout in seconds
Example:

wait_for_process

Wait for a process to be running.
Parameters:
  • process_name (str): Process name to check
  • timeout (int, optional): Timeout in seconds
Example:

wait_for_command

Wait for a command to succeed.
Parameters:
  • command (str): Command to execute
  • timeout (int, optional): Timeout in seconds
Example:

Examples

Example 1: Port Ready Check

Example 2: URL Ready Check


See Also

Next Steps

Now that you understand ready checks, explore: