erlang:cancel_timer/1

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

erlang:cancel_timer/1

Frank Muller
On both MacOS (any) and Linux (Ubuntu 20.04 LTS):

Why this works?

Erlang/OTP 22 [erts-10.7.2.5] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1]
Eshell V10.7.2.5  (abort with ^G)
1> self().
<0.89.0>

2> TRef = erlang:send_after(9000, self(), die).
#Ref<0.2349067310.4021813252.2981>

3> erlang:cancel_timer(TRef).
7288           <--------------- expected/correct

4> self().
<0.89.0>


But this doesn’t:

Erlang/OTP 22 [erts-10.7.2.5] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1]
Eshell V10.7.2.5  (abort with ^G)
1> self().
<0.89.0>

2> TRef = erlang:send_after(9000, self(), die).
#Ref<0.2349067310.4021813252.2981>

3> erlang:put(die_tref, TRef).
undefined

4> TRef = erlang:get(die_tref).
#Ref<0.2349067310.4021813252.2981>

5> erlang:cancel_timer(TRef).
false          <------------------ hmmm

6> self().
<0.89.0>


Am I missing something? Maybe I need some rest. 

/Frank
Reply | Threaded
Open this post in threaded view
|

Re: erlang:cancel_timer/1

Eric Pailleau

Hi,

Try to forget f(TRef) between 3> and 4>?


Or use a pinning operator.

Joke.


Envoyé depuis mon mobile



---- Frank Muller a écrit ----

On both MacOS (any) and Linux (Ubuntu <a href="tel:20.04">20.04 LTS):

Why this works?

Erlang/OTP 22 [erts-10.7.2.5] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1]
Eshell V10.7.2.5  (abort with ^G)
1> self().
<<a href="tel:0.89.0">0.89.0>

2> TRef = erlang:send_after(9000, self(), die).
#Ref<<a href="tel:0.2349067310.4021813252.2">0.2349067310.4021813252.2981>

3> erlang:cancel_timer(TRef).
7288           <--------------- expected/correct

4> self().
<<a href="tel:0.89.0">0.89.0>


But this doesn’t:

Erlang/OTP 22 [erts-10.7.2.5] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1]
Eshell V10.7.2.5  (abort with ^G)
1> self().
<<a href="tel:0.89.0">0.89.0>

2> TRef = erlang:send_after(9000, self(), die).
#Ref<<a href="tel:0.2349067310.4021813252.2">0.2349067310.4021813252.2981>

3> erlang:put(die_tref, TRef).
undefined

4> TRef = erlang:get(die_tref).
#Ref<<a href="tel:0.2349067310.4021813252.2">0.2349067310.4021813252.2981>

5> erlang:cancel_timer(TRef).
false          <------------------ hmmm

6> self().
<<a href="tel:0.89.0">0.89.0>


Am I missing something? Maybe I need some rest. 

/Frank
Reply | Threaded
Open this post in threaded view
|

Re: erlang:cancel_timer/1

Frank Muller
Forget about it. I need definitely some rest or a pinning operator 😬

Sum. 24 jan 2021  01:14, Eric Pailleau <[hidden email]> wrote :

Hi,

Try to forget f(TRef) between 3> and 4>?


Or use a pinning operator.

Joke.


Envoyé depuis mon mobile



---- Frank Muller a écrit ----

On both MacOS (any) and Linux (Ubuntu <a href="tel:20.04" target="_blank">20.04 LTS):

Why this works?

Erlang/OTP 22 [erts-10.7.2.5] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1]
Eshell V10.7.2.5  (abort with ^G)
1> self().
<<a href="tel:0.89.0" target="_blank">0.89.0>

2> TRef = erlang:send_after(9000, self(), die).
#Ref<<a href="tel:0.2349067310.4021813252.2" target="_blank">0.2349067310.4021813252.2981>

3> erlang:cancel_timer(TRef).
7288           <--------------- expected/correct

4> self().
<<a href="tel:0.89.0" target="_blank">0.89.0>


But this doesn’t:

Erlang/OTP 22 [erts-10.7.2.5] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1]
Eshell V10.7.2.5  (abort with ^G)
1> self().
<<a href="tel:0.89.0" target="_blank">0.89.0>

2> TRef = erlang:send_after(9000, self(), die).
#Ref<<a href="tel:0.2349067310.4021813252.2" target="_blank">0.2349067310.4021813252.2981>

3> erlang:put(die_tref, TRef).
undefined

4> TRef = erlang:get(die_tref).
#Ref<<a href="tel:0.2349067310.4021813252.2" target="_blank">0.2349067310.4021813252.2981>

5> erlang:cancel_timer(TRef).
false          <------------------ hmmm

6> self().
<<a href="tel:0.89.0" target="_blank">0.89.0>


Am I missing something? Maybe I need some rest. 

/Frank
Reply | Threaded
Open this post in threaded view
|

Re: erlang:cancel_timer/1

Frank Muller
Forget about it. I need definitely some rest or a pinning operator 😬


Sum. 24 jan 2021  01:14, Eric Pailleau <[hidden email]> wrote :

Hi,

Try to forget f(TRef) between 3> and 4>?


Or use a pinning operator.

Joke.


Envoyé depuis mon mobile



---- Frank Muller a écrit ----

On both MacOS (any) and Linux (Ubuntu <a href="tel:20.04" target="_blank">20.04 LTS):

Why this works?

Erlang/OTP 22 [erts-10.7.2.5] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1]
Eshell V10.7.2.5  (abort with ^G)
1> self().
<<a href="tel:0.89.0" target="_blank">0.89.0>

2> TRef = erlang:send_after(9000, self(), die).
#Ref<<a href="tel:0.2349067310.4021813252.2" target="_blank">0.2349067310.4021813252.2981>

3> erlang:cancel_timer(TRef).
7288           <--------------- expected/correct

4> self().
<<a href="tel:0.89.0" target="_blank">0.89.0>


But this doesn’t:

Erlang/OTP 22 [erts-10.7.2.5] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1]
Eshell V10.7.2.5  (abort with ^G)
1> self().
<<a href="tel:0.89.0" target="_blank">0.89.0>

2> TRef = erlang:send_after(9000, self(), die).
#Ref<<a href="tel:0.2349067310.4021813252.2" target="_blank">0.2349067310.4021813252.2981>

3> erlang:put(die_tref, TRef).
undefined

4> TRef = erlang:get(die_tref).
#Ref<<a href="tel:0.2349067310.4021813252.2" target="_blank">0.2349067310.4021813252.2981>

5> erlang:cancel_timer(TRef).
false          <------------------ hmmm

6> self().
<<a href="tel:0.89.0" target="_blank">0.89.0>


Am I missing something? Maybe I need some rest. 

/Frank
Reply | Threaded
Open this post in threaded view
|

Re: erlang:cancel_timer/1

Eric Pailleau
Or write quicker in your shell, or increase time in timer call :)

Regards

Le 24/01/2021 à 06:56, Frank Muller a écrit :

> Forget about it. I need definitely some rest or a pinning operator 😬
>
>
>     Sum. 24 jan 2021  01:14, Eric Pailleau <[hidden email]
>     <mailto:[hidden email]>> wrote :
>
>         Hi,
>
>         Try to forget f(TRef) between 3> and 4>?
>
>
>         Or use a pinning operator.
>
>         Joke.
>
>
>         Envoyé depuis mon mobile
>
>
>
>         ---- Frank Muller a écrit ----
>
>         On both MacOS (any) and Linux (Ubuntu 20.04 <tel:20.04> LTS):
>
>         Why this works?
>
>         Erlang/OTP 22 [erts-10.7.2.5 <http://10.7.2.5>] [source]
>         [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1]
>         Eshell V10.7.2.5 <http://10.7.2.5>  (abort with ^G)
>         1> self().
>         <0.89.0 <tel:0.89.0>>
>
>         2> TRef = erlang:send_after(9000, self(), die).
>         #Ref<0.2349067310.4021813252.2 <tel:0.2349067310.4021813252.2>981>
>
>         3> erlang:cancel_timer(TRef).
>         7288           <--------------- expected/correct
>
>         4> self().
>         <0.89.0 <tel:0.89.0>>
>
>
>         But this doesn’t:
>
>         Erlang/OTP 22 [erts-10.7.2.5 <http://10.7.2.5>] [source]
>         [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1]
>         Eshell V10.7.2.5 <http://10.7.2.5>  (abort with ^G)
>         1> self().
>         <0.89.0 <tel:0.89.0>>
>
>         2> TRef = erlang:send_after(9000, self(), die).
>         #Ref<0.2349067310.4021813252.2 <tel:0.2349067310.4021813252.2>981>
>
>         3> erlang:put(die_tref, TRef).
>         undefined
>
>         4> TRef = erlang:get(die_tref).
>         #Ref<0.2349067310.4021813252.2 <tel:0.2349067310.4021813252.2>981>
>
>         5> erlang:cancel_timer(TRef).
>         false          <------------------ hmmm
>
>         6> self().
>         <0.89.0 <tel:0.89.0>>
>
>
>         Am I missing something? Maybe I need some rest. 
>
>         /Frank
>


signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: erlang:cancel_timer/1

Michael P.
On Sun, 24 Jan 2021 10:55:53 +0100
Eric PAILLEAU <[hidden email]> wrote:

> >         Try to forget f(TRef) between 3> and 4>?

??! Untie then bind again? `% TRef + bondage = ok`?
What would it matter to the (evil, shoo!, shoo!) proc. dict.?

And: How get the _same_ #Ref in two different shells (erts?)?


And a note:
Your mail clients seems to have added strange tel: numbers in the quote below: html tag confusion?


> >         Or use a pinning operator.

Is it not more of a pointing annotation, much the same like any boundie in itself, which in pattern context look like unboundies ...?
("boundie" = short, light version of "bound variable", "unboundie" = ...)

    ~Michael


Thread rep.:

> >         Why this works?
[...]

> >         But this doesn’t:
> >
> >         Erlang/OTP 22 [erts-10.7.2.5 <http://10.7.2.5>] [source]
> >         [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1]
> >         Eshell V10.7.2.5 <http://10.7.2.5>  (abort with ^G)
> >         1> self().
> >         <0.89.0 <tel:0.89.0>>
> >
> >         2> TRef = erlang:send_after(9000, self(), die).
> >         #Ref<0.2349067310.4021813252.2 <tel:0.2349067310.4021813252.2>981>
> >
> >         3> erlang:put(die_tref, TRef).
> >         undefined
> >
> >         4> TRef = erlang:get(die_tref).
> >         #Ref<0.2349067310.4021813252.2 <tel:0.2349067310.4021813252.2>981>
> >
> >         5> erlang:cancel_timer(TRef).
> >         false          <------------------ hmmm
> >
> >         6> self().
> >         <0.89.0 <tel:0.89.0>>




--

Normality is merely a question of quantity,
not of quality.

Normalität ist nur eine Frage von Quantität,
nicht von Qualität.
Reply | Threaded
Open this post in threaded view
|

Re: erlang:cancel_timer/1

Nalin Ranjan
Hi Frank,
I also tried putting these sequences into an encrypted, but not reproducing for me. 

I am running latest master. 

Should I try in emulator manually?😄

नमस्ते।
नलिन रंजन

On Sun, Jan 24, 2021, 8:43 PM <[hidden email]> wrote:
On Sun, 24 Jan 2021 10:55:53 +0100
Eric PAILLEAU <[hidden email]> wrote:

> >         Try to forget f(TRef) between 3> and 4>?

??! Untie then bind again? `% TRef + bondage = ok`?
What would it matter to the (evil, shoo!, shoo!) proc. dict.?

And: How get the _same_ #Ref in two different shells (erts?)?


And a note:
Your mail clients seems to have added strange tel: numbers in the quote below: html tag confusion?


> >         Or use a pinning operator.

Is it not more of a pointing annotation, much the same like any boundie in itself, which in pattern context look like unboundies ...?
("boundie" = short, light version of "bound variable", "unboundie" = ...)

    ~Michael


Thread rep.:

> >         Why this works?
[...]
> >         But this doesn’t:
> >
> >         Erlang/OTP 22 [erts-10.7.2.5 <http://10.7.2.5>] [source]
> >         [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1]
> >         Eshell V10.7.2.5 <http://10.7.2.5>  (abort with ^G)
> >         1> self().
> >         <0.89.0 <tel:0.89.0>>
> >
> >         2> TRef = erlang:send_after(9000, self(), die).
> >         #Ref<0.2349067310.4021813252.2 <tel:0.2349067310.4021813252.2>981>
> >
> >         3> erlang:put(die_tref, TRef).
> >         undefined
> >
> >         4> TRef = erlang:get(die_tref).
> >         #Ref<0.2349067310.4021813252.2 <tel:0.2349067310.4021813252.2>981>
> >
> >         5> erlang:cancel_timer(TRef).
> >         false          <------------------ hmmm
> >
> >         6> self().
> >         <0.89.0 <tel:0.89.0>>




--

Normality is merely a question of quantity,
not of quality.

Normalität ist nur eine Frage von Quantität,
nicht von Qualität.
Reply | Threaded
Open this post in threaded view
|

Re: erlang:cancel_timer/1

Nalin Ranjan
Sorry for the typo. 🤭

नमस्ते।
नलिन रंजन

On Tue, Jan 26, 2021, 2:43 PM Nalin Ranjan <[hidden email]> wrote:
Hi Frank,
I also tried putting these sequences into an

escript 

but not reproducing for me. 

I am running latest master. 

Should I try in emulator manually?😄

नमस्ते।
नलिन रंजन

On Sun, Jan 24, 2021, 8:43 PM <[hidden email]> wrote:
On Sun, 24 Jan 2021 10:55:53 +0100
Eric PAILLEAU <[hidden email]> wrote:

> >         Try to forget f(TRef) between 3> and 4>?

??! Untie then bind again? `% TRef + bondage = ok`?
What would it matter to the (evil, shoo!, shoo!) proc. dict.?

And: How get the _same_ #Ref in two different shells (erts?)?


And a note:
Your mail clients seems to have added strange tel: numbers in the quote below: html tag confusion?


> >         Or use a pinning operator.

Is it not more of a pointing annotation, much the same like any boundie in itself, which in pattern context look like unboundies ...?
("boundie" = short, light version of "bound variable", "unboundie" = ...)

    ~Michael


Thread rep.:

> >         Why this works?
[...]
> >         But this doesn’t:
> >
> >         Erlang/OTP 22 [erts-10.7.2.5 <http://10.7.2.5>] [source]
> >         [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1]
> >         Eshell V10.7.2.5 <http://10.7.2.5>  (abort with ^G)
> >         1> self().
> >         <0.89.0 <tel:0.89.0>>
> >
> >         2> TRef = erlang:send_after(9000, self(), die).
> >         #Ref<0.2349067310.4021813252.2 <tel:0.2349067310.4021813252.2>981>
> >
> >         3> erlang:put(die_tref, TRef).
> >         undefined
> >
> >         4> TRef = erlang:get(die_tref).
> >         #Ref<0.2349067310.4021813252.2 <tel:0.2349067310.4021813252.2>981>
> >
> >         5> erlang:cancel_timer(TRef).
> >         false          <------------------ hmmm
> >
> >         6> self().
> >         <0.89.0 <tel:0.89.0>>




--

Normality is merely a question of quantity,
not of quality.

Normalität ist nur eine Frage von Quantität,
nicht von Qualität.