fastiot.cli.infrastructure_service_fn module

Some helpers to work with external services: importing, port handling, …

fastiot.cli.infrastructure_service_fn.get_infrastructure_service_ports_randomly()[source]

Get random environment variables for all ports.

On very busy machines this may to reuse of ports, if another service takes the port betweening determining its free status and acutally starting the service.

Return type:

Dict[str, int]

Returns:

dict with the environment variables and the corresponding port numbers

fastiot.cli.infrastructure_service_fn.get_infrastructure_service_ports_monotonically_increasing(offset)[source]

Get environment variables for all ports in a monotonically increasing order with an offset.

Parameters:

offset (int) – Port number for the first service, will be monotonically increasing for all further services.

Return type:

Dict[str, int]

Returns:

dict with the environment variables and the corresponding port numbers