The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2016-11-17

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 gbhat1 http://pastebin.com/YdPUiGaD - I started a new one - it stiil does not block - I am missing something big :)
00:02 Grinnz actually, that wouldn't work with Mojo::UserAgent anyway, it uses the singleton loop for non-blocking requests
00:05 pink_mist damn, foiled :P
00:06 pink_mist should that actually matter though? wouldn't the delay still be tied to the new IOLoop, and the delay's begin callback be called on completion?
00:06 gbhat1 Any suggestions on what might work to block until both requests complete?
00:06 Grinnz the singleton would never run to complete the useragent requests
00:07 Grinnz gbhat1: running them both in order without callbacks :P
00:07 ivi joined #mojo
00:08 Grinnz but you don't really need it to block, if you just declare the useragent somewhere else
00:08 gbhat1 You mean outside the scope of sub scan ?
00:08 Grinnz yes
00:19 Lee joined #mojo
00:38 gbhat1 In that case - it dies when it is DESTROY'ed ((in cleanup) Can't call method "stop" on an undefined value at /usr/local/booking-perl/5.18.2/site/lib/Mojo/IOLoop/Delay.pm line 31.)
00:41 gbhat1 Is there a "Promises" pattern with Mojo's event loop. When I can call collect or resolve a condvar when all requests are completed?
00:43 jberger no official way
00:43 jberger you can use one of several loop bridges
00:47 gbhat1 An example of a "loop bridge" would be great.
00:50 gbhat1 Also it would be great to understand why the last example in http://blogs.perl.org/users/joel_berger/2013/11/writing-non-blocking-applications-with-mojolicious-part-2.html does not work after a fork
00:58 avkhozov joined #mojo
01:00 jontaylor joined #mojo
01:00 Grinnz https://metacpan.org/pod/Future::Mojo
01:00 Grinnz that still requires you to do some manual glue, and mst hasn't released his Mojo::UserAgent glue yet
01:01 jberger by
01:01 jberger by "bridge" I mean something like https://metacpan.org/pod/IO::Async::Loop::Mojo
01:02 Grinnz that wouldn't help you get Mojo::UserAgent to give you a promise pattern
01:03 Grinnz you could use https://metacpan.org/pod/Net::Async::HTTP which would use its own event loop and give you Futures but that's a completely different client
01:04 jberger no, but it would get you onto the IO::Async loop which then gets you his Futures ecosystem
01:04 Grinnz but the Future glue isn't necessarily hard, i jsut don't have it handy
01:05 gbhat1 Net::ASync::HTTP might be the most straightforward
01:09 gbhat1 IAC Thanks all for the help.
01:13 Grinnz jberger: this is in a fork where he's no longer running the Mojo loop for anything else, so he only really needs to use one loop or the other anyway
01:33 Paddi joined #mojo
02:04 zivester joined #mojo
02:07 asarch joined #mojo
02:11 lluad joined #mojo
02:14 asarch joined #mojo
02:14 jberger sorry, I'm only half present, we have Meta::Hack starting up here
02:19 lluad joined #mojo
02:20 Lee joined #mojo
03:20 Paddi joined #mojo
03:24 asarch joined #mojo
03:38 noganex joined #mojo
04:20 aborazmeh joined #mojo
04:20 Lee joined #mojo
04:40 Paddi joined #mojo
05:04 dboehmer_ joined #mojo
05:11 Paddi joined #mojo
05:21 inokenty-w joined #mojo
06:08 Lee joined #mojo
06:12 Paddi joined #mojo
06:13 jamesaxl joined #mojo
06:53 batman Grinnz: I don't want to maintain the module anymore :/
06:53 Lee joined #mojo
06:57 parv joined #mojo
06:59 dod joined #mojo
07:08 dod joined #mojo
07:11 Vandal15263 joined #mojo
07:17 mbudde joined #mojo
07:18 go|dfish joined #mojo
07:36 parvx joined #mojo
07:37 parvXirc joined #mojo
07:38 parvXirc_ joined #mojo
07:47 polettix joined #mojo
08:08 dtzuzu joined #mojo
08:08 rshadow joined #mojo
08:09 dod joined #mojo
08:15 dod joined #mojo
08:21 AndrewIsh joined #mojo
08:22 ashimema joined #mojo
08:23 orev joined #mojo
08:28 Paddi joined #mojo
08:44 dod joined #mojo
08:49 trone joined #mojo
08:52 dod joined #mojo
09:05 Jonis Still trying to grok non-blocking. Is it ok to pass $delay->begin to a helper and use it for callbacks? say the helper performs a db query with mojo pg, then verifies data and returns results with the $delay->begin cb?
09:07 jamesaxl joined #mojo
09:21 osfabibisi joined #mojo
09:28 jontaylor joined #mojo
09:31 sri sounds fine
09:36 Jonis thanks :)
09:36 dod joined #mojo
09:50 rshadow joined #mojo
09:53 cpan_mojo joined #mojo
10:03 ribasushi o/
10:03 Jonis :)
10:04 ribasushi a bit offtopic, but you are all heavy mac users: is there a solution out there to have a macbook *not* sleep while unplugged, and the lid closed, all the way until it drains its battery and then gracefully shut down?
10:04 ribasushi none of the popular caffeine&co things seem to cover that particular case...
10:05 batman ribasushi: i had some "anti sleep" app that in searched for in the app store a year ago
10:05 Jonis ribasushi: http://semaja2.net/projects/insomniaxinfo/
10:05 batman can't remember what it's called, but the icon was "Zzz"
10:05 henq joined #mojo
10:06 ribasushi batman: I've tried that one before amphetamine I think, I will look again
10:06 batman but i stopped using it after i fixed my ssh config to not kill my connections while sleeping - so i could close the lid, move to a meeting room, and continue my sessions
10:06 Jonis mosh <3
10:06 ribasushi Jonis: the very screenshot only has "prevent sleeping when on AC"
10:07 ribasushi ok let me back out a bit: my use case isn't "I want to lose the lid for a bit and come back to it as if nothing happens"
10:07 ribasushi the case is "I use the macbook as a headless box which provides me with necessary vpns etc, and I ssh into if need be"
10:08 ribasushi thus looking for a solution where the macbook is closed almost the entire time
10:09 ribasushi or in other words: "does someone have experience running a macbook as a server, not as a workstation"
10:16 howitdo joined #mojo
10:29 jontaylor joined #mojo
10:30 stryx` joined #mojo
10:53 gregf_ joined #mojo
11:13 henq joined #mojo
11:16 jontaylor joined #mojo
11:21 itaipu joined #mojo
11:24 marty joined #mojo
11:38 dboehmer_ I am working on a quite complex Mojolicious app with a long test. how to see exceptions (die() texts) in the TAP output?
11:39 dboehmer_ I wrote a minimal Mojo Lite example and it prints debugging messages into TAP
11:39 dboehmer_ unfortunately with a minimal Mojo app it doesn't. probably that's intended. but how do I get a similar output?
11:39 dboehmer_ look here for examples and the output I see https://gist.github.com/dboehmer/1476b6fd482bf61a2e5aee133f5205b3
11:43 * coolo exports MOJO_LOG_LEVEL=debug
11:45 sri curious, i can't think of a reason for it to be different
11:45 dboehmer_ coolo: makes no differnce for me MOJO_LOG_LEVEL=debug prove -v t/mojo.t
11:46 henq joined #mojo
11:48 dboehmer_ can anyone verifiy my results?
11:51 rshadow joined #mojo
12:28 jberger dboehmer_ try prove -v
12:28 jberger Oh wait you did, sorry
12:28 jberger Just waking up :p
12:31 jberger In your full app i don't think it is routing top the controller at all
12:32 jberger Controller#index routes to MyApp::Controller::Controller::index
12:34 jberger Also I don't remember but I don't think calling new on an App class runs the startup method at all
12:36 jberger For that you want http://mojolicious.org/perldoc/Mojo/Server#build_app
12:36 marty joined #mojo
12:39 rshadow joined #mojo
12:45 sri startup is called from new
12:58 jberger Ok, sorry about that one then. build_app does something though. Anyway, time for coffee
13:00 jamesaxl joined #mojo
13:06 dboehmer_ jberger: but if you were right about the call going to Controller::Controller I'd like to see the exception
13:06 dboehmer_ (sorry for the delay. I was interrupted by a meeting)
13:06 dboehmer_ so could anyone verify output like in https://gist.github.com/dboehmer/1476b6fd482bf61a2e5aee133f5205b3 ?
13:07 dboehmer_ might this be worth a GH issue?
13:15 stryx` joined #mojo
13:17 henq joined #mojo
13:18 dod joined #mojo
13:19 sri is anyone else working on an amqp client for mojo? https://github.com/inway/mojo-rabbitmq-client
13:19 sri dboehmer_: sure, but i doubt you'll find a volunteer to fix it for you, better make it a pull request with the fix ;)
13:20 dod joined #mojo
13:22 alexbyk joined #mojo
13:25 dboehmer_ sri: I'll look into this and consider a PR if I understand the logic
13:28 jberger dboehmer_ because the search namespace for controllers is already MyApp::Controller
13:30 dboehmer_ jberger: I tried "#index' but can't see the results of said issue (debug output is not printed)
13:31 dboehmer_ sri: you'd pull a PR with a test that covers this issue and fails?
13:32 sri dboehmer_: no
13:43 * sri gives Mojo::RabbitMQ::Client a quick review https://github.com/inway/mojo-rabbitmq-client/issues/1#issuecomment-261249038
13:51 sri the hardcoded "$client->_loop->start unless $client->_loop->is_running" stuff really bugs me
13:51 sri that should never be included in a non-blocking client library
13:53 gizmomathboy joined #mojo
14:05 Pyritic joined #mojo
14:06 asarch joined #mojo
14:19 dod1 joined #mojo
14:32 zivester joined #mojo
14:34 itaipu joined #mojo
14:39 Pyritic joined #mojo
14:40 rshadow joined #mojo
15:05 henq joined #mojo
15:20 tyldis sri: I'm following Mojo::RabbitMQ::Client as I have interest in it. The leak you mention first... I assume what is missing is deleting it when the conection ends for any reason? (https://github.com/inway/mojo-rabbitmq-client/blob/a6bee2e13af1b13f577ab4f836f381e94f982496/lib/Mojo/RabbitMQ/Client.pm#L354)
15:21 tyldis This is what you mean by "managing" it? :)
15:21 tyldis I found your comments constructive, but I'm not OP.
15:25 henq joined #mojo
15:29 henq joined #mojo
15:31 orev having some confusion on generating a url for a named route that includes a placeholder.  how can I set the placeholder value when making the web path (form_for)?  sample code: https://paste.fedoraproject.org/483830/79396604/   problem is the form action does not contain the full name of the path
15:31 CandyAngel Can I render_to_rel_file from a route in a liteapp? It doesnt like me monkeypatching or calling it on $c->app->commands
15:32 vicash orev: url_for('my_route', %placeholders) where %placeholders is ( key => value, key => value) type pairs
15:32 CandyAngel latter because the template is in the liteapp, not the commands class (i guess)
15:33 vicash orev: so for a route like "/myroute/:id/:type" it will be url_for("myroute", id => 1, type => 'whatever') .. something like that. You have to use named routes.
15:34 vicash orev: look at the Routing guide
15:42 orev vicash: thanks.  I spend plenty of time in the docs but it's very dense so hard to locate specifics sometimes
15:47 zivester joined #mojo
16:05 jberger if you want to reference a route by name you should explicitly name it
16:06 jberger thats ->name('somename') in full routers or passing a trailing string to lite routers (e.g. get '/' => sub { ... } => 'somename')
16:06 jberger CandyAngel:
16:07 jberger oops
16:07 jberger CandyAngel: why do you need that
16:08 lluad joined #mojo
16:10 CandyAngel I have a route which creates a yaml file on the server, creating the directory too
16:12 umask001 joined #mojo
16:12 CandyAngel and the directory is a datastore for a multiple action process, like a wizard
16:12 sri tyldis: yea, i imagine it's as easy as storing the timer id, and removing it in a DESTROY
16:13 CandyAngel /create makes a uuid dir, then redirects to /report which guides you through the files you need to create and upload
16:13 CandyAngel with the uuid being stored in the session
16:16 CandyAngel oh, i can probbly cal write_file instead
16:16 CandyAngel sorry, phone typing on laggy phone :P
16:19 sri CandyAngel: the command stuff is not really meant to be used like that
16:20 jberger if you are writing a file, Mojo::Util::spurt is probably best
16:20 CandyAngel I got it to work :P
16:20 CandyAngel spurt doesnt create the dirs, was first thing i tried
16:21 CandyAngel im on old mojo bybthe way
16:21 CandyAngel IT have broken my connection, hence phone typing :P
16:24 CandyAngel Ye olde 6.36
16:30 CandyAngel sorry, i really shoukd have mentioned it first >.<
16:33 Adura They're going to tell you to upgrade. :P
16:40 CandyAngel I am sure they'd never be so cruel!
16:41 CandyAngel :P
16:44 rshadow joined #mojo
16:45 PryMar56 joined #mojo
16:57 tchaves joined #mojo
17:08 jberger CandyAngel: I believe you are looking for File::Path
17:10 Grinnz i'd go with Path::Tiny if you have that option, it has mkpath and spew
17:12 disputin joined #mojo
17:30 CandyAngel I mnaged to get it working by calling write_file :)
17:30 CandyAngel and basically copying wht rendertorelfile was doing
17:31 CandyAngel could it be a candidate for moving to mojo:util?
17:36 itaipu joined #mojo
17:54 dod joined #mojo
17:56 sri CandyAngel: the problem is the stdout message stuff
17:57 sri otherwise i'd be fine with making Mojo::Util::spurt create directories
17:57 sri i mean, if we agree that those messages don't matter in the write_file case, we could still do it
18:00 sri or are there other use cases in mojolicious that justify duplicating the directory creation stuff?
18:13 Pyritic joined #mojo
18:22 sri funny thing, i like the mojo generate app output more without the directory creation -.-
18:24 sri cost of it is 2 lines
18:30 sri ok, i'm not doing it
18:30 sri it causes an inconsistency between memory and file assets
18:31 sri the move_to(...) function would only be able to create directories for memory assets
18:32 rshadow joined #mojo
18:33 sri https://gist.github.com/anonymous/4d6054d4725713f97aea6308d87c7b6a
18:33 sri the inconsistency is a deal breaker, even though spurt creating directories would be very mojolicious
18:35 dod joined #mojo
18:39 jontaylor_ joined #mojo
18:44 CandyAngel As far as I know, spurt just writes $bytes, so I'd have to do all the template stuff anyway. Wouldn't save anything just making spurt make directories against my "workaround"
18:44 CandyAngel ( which is calling $c->app->commands->write_file)
18:52 gizmomathboy joined #mojo
19:13 marty joined #mojo
19:23 henq joined #mojo
19:25 Pyritic joined #mojo
19:28 lluad joined #mojo
19:44 rshadow joined #mojo
20:11 VVelox joined #mojo
20:24 jontaylor joined #mojo
20:42 Pyritic joined #mojo
20:42 jontaylor joined #mojo
20:51 jontaylor joined #mojo
21:24 disputin joined #mojo
21:35 itaipu joined #mojo
23:23 jontaylor joined #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary