Hi all,
I've read through all the documentation that I can find, and I'm having
trouble understanding how Mojolicious renders streams.
I have
seen https://docs.mojolicious.org/Mojolicious/Guides/Rendering#Streaming,
but is the drain callback really the only solution? It's a very awkward
cons
>
> Typically, with a stream, you'd just write the HTTP headers, and then just
> start writing out your content. I don't understand why it's so challenging
> with Mojolicious. I figured finalizing the response headers would be what I
> needed, but now I have no idea.
>
> I'm not trying to do
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!
c
https://metacpan.org/pod/Mojo::Transaction#completed
On Fri, 23 Oct 2020 at 17:07, Felipe Gasper 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,
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 continu
You can set a response error on the transaction to cancel it safely. That's
what the Mojolicious tests use.
--
sebastian
--
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 e
> my $p = $ua->get_p('http://www.google.com');
>
https://metacpan.org/pod/Mojo::UserAgent#get_p returns a Mojo::Promise object
> Mojo::Promise->timer(0.01)->then( sub { print "canceling\n"; $p->completed()
> } );
>
https://metacpan.org/pod/Mojo::Promise doesn't have `completed` method
your are ca
> On Oct 23, 2020, at 10:42 AM, Dmitry L. wrote:
>
>> my $p = $ua->get_p('http://www.google.com');
>>
> https://metacpan.org/pod/Mojo::UserAgent#get_p returns a Mojo::Promise object
>
>> Mojo::Promise->timer(0.01)->then( sub { print "canceling\n"; $p->completed()
>> } );
>>
> https://metacp