Re: [Mojolicious] Async/await in Mojolicious Full App

2020-06-18 Thread Jeyaraj Durairaj
Hi, Just to share that I have successfully deployed Mojolicious (Full App) based BI application in production with Hynotoad along with Async/Await feature, DBIx:Class model layer, Mojo::Pg Model layer, API calls with Mojo::UserAgent (with Async/Await). Mojo::Test feature is also amazing. Spe

Re: [Mojolicious] Async/await in Mojolicious Full App

2020-06-06 Thread Jeyaraj Durairaj
Honored to receive answers and responses from experts in the first place. Your tips and ideas are indeed essential to me. Happy to be in Mojolicious discussions and sharing ideas! -- Jeyaraj On Saturday, 6 June 2020 19:11:47 UTC+5:30, Stefan Adams wrote: > > *form *and *json *are examples of "co

Re: [Mojolicious] Async/await in Mojolicious Full App

2020-06-06 Thread Stefan Adams
*form *and *json *are examples of "content generators ". You can think of them as request macros. *form *, for example, "generates query string, application/x-www-f

Re: [Mojolicious] Async/await in Mojolicious Full App

2020-06-06 Thread Jeyaraj Durairaj
Hi Stefan, Thanks for the appreciation and the ideas. I will surely do the following change in my code. changing to return *$tx->result->json*; from return from_json($tx->result->body); However, following change has been tricky to me. changing to *json* => { periods => *$c->session('cx_cur

Re: [Mojolicious] Async/await in Mojolicious Full App

2020-06-05 Thread Stefan Adams
Great job pushing your application forward with Async/Await! Looking at your snippet, here's one small change you can probably make using the json() method from Mojo::Message : $app->helper(summary_data => async sub ($c, $access_token) {

Re: [Mojolicious] Async/await in Mojolicious Full App

2020-06-04 Thread Jeyaraj Durairaj
Hi, It works for *helpers* as well with the following declaration. $app->helper(summary_data => async sub ($c, $access_token) { my $ua = Mojo::UserAgent->new; my $tx = await $ua->post_p( 'http://' . $c->config->{API_IP} . '/api-app/analytics/summary/',

Re: [Mojolicious] Async/await in Mojolicious Full App

2020-06-03 Thread Jeyaraj Durairaj
Hi, Eureka! Eureka! It works!. The solution I found (because of my error) is that I uninstalled Mojo::AsyncAwait and installed Future::AsyncAwait. It just works! By June end, my business intelligence application will be live to serve 100+ users with insights and analytics. (To apply icing on

Re: [Mojolicious] Async/await in Mojolicious Full App

2020-05-28 Thread Jeyaraj Durairaj
any luck on the solutions? -- Jeyaraj On Thursday, 28 May 2020 00:10:48 UTC+5:30, Jeyaraj Durairaj wrote: > > However, the below code perfectly work for me outside Mojolicious App. > > > use Modern::Perl; > use Mojo::Base -strict, -signatures; > use Mojo::UserAgent; > use Mojo::Promise; > use Moj

Re: [Mojolicious] Async/await in Mojolicious Full App

2020-05-27 Thread Jeyaraj Durairaj
However, the below code perfectly work for me outside Mojolicious App. use Modern::Perl; use Mojo::Base -strict, -signatures; use Mojo::UserAgent; use Mojo::Promise; use Mojo::IOLoop; use Mojo::Util 'trim'; use Mojo::AsyncAwait; use LWP::UserAgent; use JSON; my $ua = Mojo::UserAgent->new; my $r

Re: [Mojolicious] Async/await in Mojolicious Full App

2020-05-27 Thread Jeyaraj Durairaj
I have uninstalled and reinstalled perl. I am getting the same error. On Wednesday, 27 May 2020 23:41:27 UTC+5:30, Jeyaraj Durairaj wrote: > > I tried generating an example app and copied pasted the code segment you > posted here and then tried. > > "Action not found!" error is shown. > > Should

Re: [Mojolicious] Async/await in Mojolicious Full App

2020-05-27 Thread Jeyaraj Durairaj
I tried generating an example app and copied pasted the code segment you posted here and then tried. "Action not found!" error is shown. Should I reinstall Perl again and then try? Will it work under morbo or works only on Hypnotoad? I am using Windows for my development, wherein morbo is the on

Re: [Mojolicious] Async/await in Mojolicious Full App

2020-05-27 Thread Jeyaraj Durairaj
Sure sir, I will stick to it. On Wednesday, 27 May 2020 23:02:36 UTC+5:30, Sebastian Riedel wrote: > > Oops! my bad. Apologies! I should have stayed. But, I had to get into a >> skype call. >> > > IRC is rarely synchronous, if you can't wait a few hours for an answer > just stick to the mailing-

Re: [Mojolicious] Async/await in Mojolicious Full App

2020-05-27 Thread Sebastian Riedel
> > Oops! my bad. Apologies! I should have stayed. But, I had to get into a > skype call. > IRC is rarely synchronous, if you can't wait a few hours for an answer just stick to the mailing-list and forget IRC. The friendly folks in #mojo will answer almost any question, but you might have to w

Re: [Mojolicious] Async/await in Mojolicious Full App

2020-05-27 Thread Jeyaraj Durairaj
Oops! my bad. Apologies! I should have stayed. But, I had to get into a skype call. I will follow your advise and redo all and confirm sir. On Wednesday, 27 May 2020 17:46:49 UTC+5:30, Sebastian Riedel wrote: > > I'll assume it was you who asked the same question on IRC earlier. Had you > been

Re: [Mojolicious] Async/await in Mojolicious Full App

2020-05-27 Thread Sebastian Riedel
I'll assume it was you who asked the same question on IRC earlier. Had you been sticking around for a bit longer you would have seen my instructions for getting a working application that i tested locally. 14:08 to be sure i did a "mojo generate app" and then replaced the controller with h

Re: [Mojolicious] Async/await in Mojolicious Full App

2020-05-26 Thread Jeyaraj Durairaj
I tried. getting the same error. On Tuesday, 26 May 2020 23:41:23 UTC+5:30, Vincent Tondellier wrote: > > On Tuesday 26 May 2020 11:06:50 Jeyaraj Durairaj wrote : > > use Mojo::Base 'Mojolicious::Controller'; > > use Mojo::Base -async_await; > > Try instead: > > use Mojo::Base 'Mojolicious::Co

Re: [Mojolicious] Async/await in Mojolicious Full App

2020-05-26 Thread Jeyaraj Durairaj
Hi, I corrected it. But, I am still getting the syntax error and the following log. use Mojo::Base 'Mojolicious::Controller', -async_await, -signatures; # This action will render a template async sub on_user_login_p ($self) { $self->render_later; # Authenticate by sending the req

Re: [Mojolicious] Async/await in Mojolicious Full App

2020-05-26 Thread Dan Book
On Tue, May 26, 2020 at 2:06 PM Jeyaraj Durairaj wrote: > async on_user_login_p => sub { > > async sub user_data_p () { > These two declarations are not quite right in different ways. The first one is giving you a syntax error because it isn't any supported syntax. Just do "async sub foo {" -Da

Re: [Mojolicious] Async/await in Mojolicious Full App

2020-05-26 Thread 'Vincent Tondellier' via Mojolicious
On Tuesday 26 May 2020 11:06:50 Jeyaraj Durairaj wrote : > use Mojo::Base 'Mojolicious::Controller'; > use Mojo::Base -async_await; Try instead: use Mojo::Base 'Mojolicious::Controller', -async_await; -- You received this message because you are subscribed to the Google Groups "Mojolicious" g