Thank you!

When I try:

====
use Mojo::UserAgent;

my $ua = Mojo::UserAgent->new;

my $p = $ua->get_p('http://www.google.com');

Mojo::Promise->timer(0.01)->then( sub { print "canceling\n"; $p->completed() } 
);

Mojo::Promise->timer(2)->wait();
====

… then strace that script, the request continues even after the call to 
completed().

Am I just “holding it wrong”?

cheers,
-FG


> On Oct 23, 2020, at 10:13 AM, Dmitry L. <dim0...@gmail.com> wrote:
> 
> https://metacpan.org/pod/Mojo::Transaction#completed
> 
> On Fri, 23 Oct 2020 at 17:07, Felipe Gasper <fel...@felipegasper.com> wrote:
>> 
>> Hi all,
>> 
>>        Does Mojo::UA offer a control to cancel an in-flight HTTP request? I 
>> don’t see one in the docs but wonder if I’m just missing it.
>> 
>>        (The promise, of course, can be pre-resolved/rejected, but that 
>> doesn’t appear to affect the underlying HTTP request.)
>> 
>>        Thank you!
>> 
>> cheers,
>> -Felipe
>> 
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Mojolicious" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mojolicious+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/mojolicious/10E98F2C-174C-4459-AC05-C8FA7F623943%40felipegasper.com.
> 
> 
> 
> -- 
> //wbr, Dmitry L.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/mojolicious/CAKgzkX24PZUkSOQy1%2BBcx%2BhGkbNsXSPULB5fjDx9kZLb2qOY_w%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/2E2D79DF-709B-4793-AD88-95E32D242D2F%40felipegasper.com.

Reply via email to