View Source NervesHubLinkCommon.Downloader.TimeoutCalculation (nerves_hub_link_common v0.4.2)

Pure functions for dealing with timeouts

Link to this section Summary

Functions

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

Link to this section Types

@type bits_per_second() :: non_neg_integer()
@type number_of_bytes() :: non_neg_integer()

Link to this section Functions

Link to this function

calculate_worst_case_timeout(content_length, speed)

View Source
@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