[Mojolicious] New D-Bus module for Mojolicious

2019-11-19 Thread Felipe Gasper
Hi all, CPAN’s Protocol::DBus now includes a connector for Mojolicious, Protocol::DBus::Client::Mojo. Hope it’s useful! cheers, -Felipe Gasper (FELIPE) -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this grou

[Mojolicious] libcurl via Mojolicious

2019-12-10 Thread Felipe Gasper
Hi all, I’ve got a library called Net::Curl::Promiser that does the “dirty-work” of interfacing between different event loops and Net::Curl::Multi. I recently added a Mojo::IOLoop backend, so it should now be possible to integrate libcurl seamlessly into Mojolicious via Net::Curl::Promiser::Moj

Re: [Mojolicious] libcurl via Mojolicious

2019-12-10 Thread Felipe Gasper
. -FG > Le 10 déc. 2019 à 13:19, Stefan Adams a écrit : > > Hi, Felipe! Thanks for sharing this! What advantages does integrating with > libcurl have over using Mojo::UserAgent? > > On Tue, Dec 10, 2019, 8:41 AM Felipe Gasper wrote: > Hi all, > > I’ve got a library

Re: [Mojolicious] libcurl via Mojolicious

2019-12-10 Thread Felipe Gasper
> Le 10 déc. 2019 à 13:57, sri a écrit : > > The disadvantage is that you’ll need to use Net::Curl::Easy, which > isn’t a very Perlish interface. HTTP::AnyUA’s backend for same demonstrates > how to “tame the beast”, though, and Net::Curl’s own documentation is quite > helpful (IMO)

Re: [Mojolicious] libcurl via Mojolicious

2019-12-10 Thread Felipe Gasper
> Le 10 déc. 2019 à 14:08, Sebastian Riedel a écrit : > >>> Another big disadvantage is that it doesn't use Mojo::Promise. I don't >>> think it will attract too many Mojo users without. >> >> The latest version does, actually. > > Ah, nice. Then you can simplify your example too. > >my

Re: [Mojolicious] Websocket cat

2019-12-15 Thread Felipe Gasper
I’ve spent very little time with Mojo as a WS client, but I found the example in Mojo::UserAgent’s documentation to be enough to get me where I needed to go. = $ua->websocket('ws+unix://%2Ftmp%2Fmyapp.sock/echo.json' => sub { my ($ua, $tx) = @_; say 'WebSocket handshake failed!' and retur

[Mojolicious] XS backend for Mojo::Promise?

2019-12-26 Thread Felipe Gasper
to use the new XS code as an implementation when available. I don’t know Mojo well enough to be at ease with doing the work, but if anyone’s interested, it might make a nice improvement in Mojo to have XS-backed promises when available. -Felipe Gasper Mississauga, Ontario -- You

Re: [Mojolicious] mojo async/await with controller

2020-01-10 Thread Felipe Gasper
I’m just encountering Mojo::AsyncAwait and notice that it lists Coro as a dependency. Isn’t Coro problematic in newer Perls? I thought Marc had basically written off support for 5.22 onward. -F > On Jan 10, 2020, at 8:49 AM, 'Tobias Oetiker' via Mojolicious > wrote: > > I just read Joel's

[Mojolicious] Test::Mojo to test WS client?

2020-01-22 Thread Felipe Gasper
Hello, I see t/mojolicious/websocket_lite_app.t in the Mojolicious distribution, but this seems to test Mojo as a WS server. Are there any examples of using Test::Mojo--or any other tool--to test Mojo-powered WS clients? Thank you! -FG -- You received this message because yo

Re: [Mojolicious] Test::Mojo to test WS client?

2020-01-22 Thread Felipe Gasper
-Dan > > On Wed, Jan 22, 2020 at 10:38 AM Dan Book wrote: > https://github.com/mojolicious/mojo/blob/master/t/mojo/websocket.t > > -Dan > > On Wed, Jan 22, 2020 at 10:34 AM Felipe Gasper > wrote: > Hello, > > I see t/mojolicious/websocket_lite_app.

Re: [Mojolicious] Test::Mojo to test WS client?

2020-01-22 Thread Felipe Gasper
> On Jan 22, 2020, at 12:25 PM, Felipe Gasper wrote: > > Hi Dan, > > Thank you for your response! > > So, maybe what I need isn’t Test::Mojo. I have: > > - > package t::MockApp; > > use Mojo::Base -strict; > > use Mojolicious::Li

Re: [Mojolicious] Deprecating or Transferring Mojo::ACME

2020-02-19 Thread Felipe Gasper
Hi Joel, I’ve got a proof-of-concept branch of Net::ACME2 that uses Net::Curl::Promiser rather than HTTP::Tiny; to use Mojo would likely be a pretty similar change. If anyone’s interested in trying it out, let me know. -FG > On Feb 19, 2020, at 10:28 PM, Joel Berger wrote: > > As I'

Re: [Mojolicious] Get an array from checkboxes

2020-03-02 Thread Felipe Gasper
https://developer.mozilla.org/en-US/docs/Web/API/FormData ^^ Also, if you’re not sure whether the problem is in Perl or in the browser, you can use this to see what data the browser intends to send prior to sending. -FG > On Mar 2, 2020, at 10:51 AM, Dan Book wrote: > > That is correct, it s

[Mojolicious] Async ACME2 (Let’s Encrypt)

2020-03-21 Thread Felipe Gasper
https://github.com/FGasper/p5-Net-ACME2/tree/async Supports Mojo via Net::Curl::Promiser. Still experimental; file bugs as you find them. Enjoy! -FG -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiv

Re: [Mojolicious] Re: curl works, Mojo::UserAgent doesn't

2020-05-14 Thread Felipe Gasper
FWIW, you can use libcurl with Mojo via Net::Curl::Promiser::Mojo. That may be your easiest solution? -FG > On May 14, 2020, at 07:38, 'Michael Lackhoff' via Mojolicious > wrote: > >  >> Am 14.05.2020 um 05:08 schrieb Stefan Adams: >> > I'm certain you'll be able to accomplish this with M::U

Re: [Mojolicious] Re: curl works, Mojo::UserAgent doesn't

2020-05-14 Thread Felipe Gasper
looks great but if it has some severe shortcomings I want to know before > doing lots of mission critical stuff with it. > > But thanks for your suggestion. It is always good to know further options. > -Michael > > > Am Donnerstag, 14. Mai 2020 13:47:41 UTC+2 schrieb Feli

Re: [Mojolicious] Best alternative for client / server polling?

2020-05-18 Thread Felipe Gasper
> On May 18, 2020, at 7:45 PM, Miguel Manso wrote: > > Hi there, > > Ive a Perl client that fetched some data every 3 seconds and post it to an > API. Both client and server are written using mojo. Client uses > Mojo::UserAgent to post JSON and server is a Mojolicious app being served > wit

Re: [Mojolicious] Re: web cam websocket

2020-09-14 Thread Felipe Gasper
That seems an odd error from Chrome, if that’s the fix .. was the browser sending a subprotocol in the handshake? -F > On Sep 14, 2020, at 07:37, Mikhail wrote: > > Thanks! Forever ♥ Mojolicious! > > понедельник, 14 сентября 2020 г. в 13:41:46 UTC+5, Sebastian Riedel: >> Then you need to ne

Re: [Mojolicious] Re: web cam websocket

2020-09-15 Thread Felipe Gasper
RFC 6455/1.9 states: The client can request that the server use a specific subprotocol by including the |Sec-WebSocket-Protocol| field in its handshake. If it is specified, the server needs to include the same field and one of the selected subprotocol values in its response for the conne

Re: [Mojolicious] Re: web cam websocket

2020-09-15 Thread Felipe Gasper
> On Sep 15, 2020, at 9:30 AM, Sebastian Riedel wrote: > > Given this, should Mojo even send a response? Or if it does, should it at > least warn “failed to negotiate subprotocol; sending handshake response > anyway”? > > So you want Mojolicious to cause a TCP level connection error instead

Re: [Mojolicious] Re: web cam websocket

2020-09-15 Thread Felipe Gasper
> On Sep 15, 2020, at 11:20 AM, Sebastian Riedel wrote: > > An HTTP-level error response--maybe 426--would probably be most sensible. > > What error would common browsers give in that case? They’d give whatever error as with any other HTTP-level failure during a WS handshake. Chrome shows

[Mojolicious] Cancel in-flight HTTP request?

2020-10-23 Thread Felipe Gasper
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

Re: [Mojolicious] Cancel in-flight HTTP request?

2020-10-23 Thread Felipe Gasper
= … 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. wrote: > > https://metacpan.org/pod/Mojo::Transaction#completed > > On Fri, 23 Oct 2020 at 17:07, Felipe Gasper

Re: [Mojolicious] Cancel in-flight HTTP request?

2020-10-23 Thread Felipe Gasper
> 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

Re: [Mojolicious] Cancel in-flight HTTP request?

2020-10-26 Thread Felipe Gasper
> 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

Re: [Mojolicious] Suggestions how to avoid "Useless use of private variable in void context" ?

2020-11-16 Thread Felipe Gasper
I think you could do: $tx = $tx; … instead. (It might be worth updating the FAQ to do that?) -F > On Nov 16, 2020, at 8:08 AM, Edward Baudrez wrote: > > Hello list > > There is this hint in the FAQ about keeping a strong reference to the > transaction object $tx around, so that the

[Mojolicious] multiple concurrent event loops

2021-02-19 Thread Felipe Gasper
Hello, In a PR thread yesterday Sebastian mentioned that Mojo allows multiple concurrent event loops. When and why would someone want such a configuration? Thank you! cheers, -Felipe Gasper -- You received this message because you are subscribed to the Google Groups