Process.cancel_timer
cancel_timer
, go back to Process module for more information.
Specs
cancel_timer(reference(), options) :: non_neg_integer() | false | :ok when options: [async: boolean(), info: boolean()]
Cancels a timer returned by send_after/3
.
When the result is an integer, it represents the time in milliseconds left until the timer would have expired.
When the result is false
, a timer corresponding to timer_ref
could not be
found. This can happen either because the timer expired, because it has
already been canceled, or because timer_ref
never corresponded to a timer.
Even if the timer had expired and the message was sent, this function does not tell you if the timeout message has arrived at its destination yet.
Inlined by the compiler.
Options
:async
- (boolean) whenfalse
, the request for cancellation is synchronous. Whentrue
, the request for cancellation is asynchronous, meaning that the request to cancel the timer is issued and:ok
is returned right away. Defaults tofalse
.:info
- (boolean) whether to return information about the timer being cancelled. When the:async
option isfalse
and:info
istrue
, then either an integer orfalse
(like described above) is returned. If:async
isfalse
and:info
isfalse
,:ok
is returned. If:async
istrue
and:info
istrue
, a message in the form{:cancel_timer, timer_ref, result}
(whereresult
is an integer orfalse
like described above) is sent to the caller of this function when the cancellation has been performed. If:async
istrue
and:info
isfalse
, no message is sent. Defaults totrue
.