Bedrock.JobQueue.Expirable (bedrock_job_queue v0.2.0)
View SourceShared expiration helpers for lease-like structs.
Any struct with an expires_at field can use these functions.
Summary
Functions
Returns true if the struct has expired.
Returns the remaining time in milliseconds. Returns 0 if expired.
Functions
@spec expired?( %{expires_at: non_neg_integer()}, keyword() ) :: boolean()
Returns true if the struct has expired.
Options
:now- Current time in milliseconds (default: System.system_time(:millisecond))
@spec remaining_ms( %{expires_at: non_neg_integer()}, keyword() ) :: non_neg_integer()
Returns the remaining time in milliseconds. Returns 0 if expired.
Options
:now- Current time in milliseconds (default: System.system_time(:millisecond))