View Source NervesHubLink.Downloader.TimeoutCalculation (nerves_hub_link v2.6.0)

Pure functions for dealing with timeouts

Summary

Functions

Calculates the worst_case_timeout value based on content_length header and worst case network speed

Types

bits_per_second()

@type bits_per_second() :: non_neg_integer()

number_of_bytes()

@type number_of_bytes() :: non_neg_integer()

Functions

calculate_worst_case_timeout(content_length, speed)

@spec calculate_worst_case_timeout(number_of_bytes(), bits_per_second()) ::
  non_neg_integer()

Calculates the worst_case_timeout value based on content_length header and worst case network speed