Current section

Files

Jump to
finch_gleam src finch@timeout.erl
Raw

src/finch@timeout.erl

-module(finch@timeout).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([infinity/0, milliseconds/1]).
-export_type([timeout_/0]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
?MODULEDOC(
" Wrapper of Elixir's `timeout/0` type.\n"
"\n"
" See [https://hexdocs.pm/elixir/typespecs.html#built-in-types](https://hexdocs.pm/elixir/typespecs.html#built-in-types)\n"
" for a specification of the type.\n"
).
-type timeout_() :: any().
-file("src/finch/timeout.gleam", 11).
?DOC(" Create an infinite timeout.\n").
-spec infinity() -> timeout_().
infinity() ->
'Elixir.FinchGleam.Timeout':infinity().
-file("src/finch/timeout.gleam", 15).
?DOC(" Create a timeout with the given milliseconds.\n").
-spec milliseconds(integer()) -> timeout_().
milliseconds(Ms) ->
'Elixir.FinchGleam.Timeout':milliseconds(Ms).