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

IRC log for #mojo, 2017-02-14

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

All times shown according to UTC.

Time Nick Message
00:03 sugar joined #mojo
00:32 veryrusty joined #mojo
00:42 asarch joined #mojo
00:51 aborazmeh joined #mojo
00:54 veryrusty joined #mojo
00:57 kiwiroy joined #mojo
01:34 veryrusty joined #mojo
01:52 itaipu joined #mojo
02:16 disputin joined #mojo
02:19 veryrusty joined #mojo
03:09 VVelox joined #mojo
03:12 marty_ joined #mojo
03:37 noganex joined #mojo
03:43 veryrusty joined #mojo
04:47 prajith joined #mojo
04:56 aborazmeh joined #mojo
04:57 inokenty-w joined #mojo
05:04 dboehmer joined #mojo
05:45 zach what's the correct form for the DB URI because I thoughtI had it right but it seems not
05:47 zach I have in my app.conf, pg => 'postgresql://username:password:fqdn:port:/dbname'
06:06 aborazmeh joined #mojo
06:14 Grinnz that's not at all correct, https://metacpan.org/pod/Mojo::Pg#from_string
06:46 kiwiroy joined #mojo
06:56 Vandal joined #mojo
06:58 aborazmeh joined #mojo
07:04 dod joined #mojo
07:12 cpan_mojo Mojo-Weixin-1.3.2 by SJDY https://metacpan.org/release/SJDY/Mojo-Weixin-1.3.2
07:18 cpan_mojo Mojo-Webqq-2.0.8 by SJDY https://metacpan.org/release/SJDY/Mojo-Webqq-2.0.8
07:47 AndrewIsh joined #mojo
08:09 kiwiroy joined #mojo
08:10 blumbi joined #mojo
08:24 polettix joined #mojo
08:39 trone joined #mojo
08:47 rshadow joined #mojo
08:57 tholen joined #mojo
09:09 veryrusty joined #mojo
09:10 tholen joined #mojo
09:19 sugar joined #mojo
09:59 zach ok, I got the URI corrected, how can I make sure that a minion worker is always running in my app config?
10:00 bpmedley zach : Which OS are you using?
10:02 zach well, there are two, in one case, it will be Linux, Ubuntu to be precide, in the other case it will be DragonFly BSD, but now I'm wondering if I can just do a thing like my $worker = Minion::Worker->new(minion => $minion); and maybe even ironically make that a minion of it's own that loops on that every so often based on teh number of minion workers that exist as active
10:03 zach I noticed the remarks on systemd, but the system is neither using systemd nor was I really hoping to have it in that level of the system
10:03 bpmedley zach : Do you know if you use upstart or systemd?  A lot of people use supervisord..
10:04 zach aside from something similar, ie, monit, bluepill, is there a simple way for the app to manage it itself as it does with its own hypnotoad config?
10:04 zach it's using the old update-rc.d
10:05 bpmedley zach : Nothing official that I'm aware of
10:05 zach bpmedley: but the app can create a worker on its own, can it not?
10:05 sri nope, was never enough interest for us to build it
10:07 bpmedley zach : I have a plugin that does that; however, testing is needed
10:08 zach is there much there beyond my $worker = Minion::Worker->new(minion => $minion); $worker->register; ?
10:08 bpmedley zach : https://github.com/brianmed/ForkAndGo
10:09 sri bpmedley: don't recommend unfinished hacks
10:09 sri "testing is needed" is quite the understatement
10:10 bpmedley sri : I wasn't recommending it, I thought I was being asked for the code I had..
10:10 sugar joined #mojo
10:12 zach so, basically your code forks on launch and inclusion of your plugin and does script/app minion worker
10:12 bpmedley zach : yeah, perhaps we can discuss via PM if you'd like to help test and develop
10:13 zach sure, though I still don't understand why you can't create a minion worker from within the perl itself
10:14 px80 good morning sunshines!
10:16 bpmedley px80++
10:18 sri zach: just be aware that if you go that route you will most likely run into serious problems nobody here will be able to help you with, because that plugin is a horrible hack
10:19 px80 whats the difference between parse and process?
10:20 px80 ok parse is just slurping, but process and render seems similar
10:20 zach sri: well, for the plugin I'll be working with bpmedley, but still I don't understand why a new worker can't be created in the code without a system shell out
10:21 sri zach: because managing processes is hard
10:22 sri if you knew how hard you'd stay far far away from that plugin :)
10:22 sri but you'll have to make your own mistakes
10:22 zach ok, also, is there any required schema for minions since it wants to connect to pg?
10:23 sri created automatically
10:32 zach ok
10:33 frantracer joined #mojo
10:33 sugar joined #mojo
10:36 frantracer hello everyone!! I have an issue with Mojo::IOLoop::Delay module and maybe someone here could help me :)
10:37 sri o/
10:37 bpmedley frantracer : Do you have example code?  Perhaps a gist or in a pastebin?
10:37 frantracer https://thepasteb.in/p/qjhLKq7LOpZuB
10:38 frantracer I am trying to execute that code, using nested ioloop::delay, but the second step is never executed, I do not know why :S
10:47 nic Whatever your actual aim is, I bet you can construct it without nested delays
10:47 * nic doesn't actually possess any gambling credits on this platform
10:50 frantracer Maybe I can, but the code will be less readable and longer...
10:52 px80 I know why
10:53 px80 because your last step in second nested loop, is closing the even counter of the outside delay object
10:53 px80 you miss $subdelay->begin->() in the last sub in inner delay loop
10:55 px80 and then at the very end of first sub in outter delay you need $delay->begin->(), and in second sub as well
10:56 blumbi very subbish
11:00 sri delays don't work that way
11:00 bpmedley sri : Would instantiating a second Mojo::IOLoop object and using that for the nested delay be a viable approach?
11:00 sri $subdelay->begin->() is almost always wrong
11:01 sri bpmedley: omg no
11:01 sri NO!
11:02 sri frantracer: just try to understand what ->begin actually does, and you should be able to figure it out http://mojolicious.org/perldoc/Mojo/IOLoop#delay
11:03 sri you don't use ->begin->() normally
11:03 zach I don't get it, I made a bunch of workers manually, I have a post route, I hit that route and it goes to a sub, the sub says to render this template, then after that it says to add this minion task, after the add task it says to enqueue it, the task runs, but the page waits on the minion before it renders
11:04 sri frantracer: to be precise, your bug is "$delay->begin->();"
11:06 sri hmm, i guess i will explore delay diagnostics next week too
11:06 zach does the minion need to be inside a Mojo::IOLoop::Subprocess?
11:07 blumbi the docs could be a little bit more verbose about delay
11:07 sri blumbi: tell me what to write
11:07 bpmedley zach : I'm confused.  Do you have a code example?  Are your running separate web app and minion worker?
11:08 sri blumbi: it's not that we don't want to, it's that we don't know what
11:08 sri blumbi: send pull requests! NOW!
11:09 zach bpmedley: I just want an immediate render while the job runs in the background
11:11 pink_mist zach: so run it in the background with Mojo::IOLoop::Subprocess ... pretty sure you were already told about that
11:12 sri zach: told you, if you go with the in-process hack approach you'll be on your own
11:12 frantracer @sri I still do not get what it is the correct way to use begin, is it just "$delay->begin" or "$delay->pass()"?
11:12 sri frantracer: my $end = $delay->begin; .... subdelay .... $end->()
11:13 sri frantracer: the point is that you increment the delay counter before starting a non-blocking operation
11:13 zach pink_mist: I know but I didn't understand how all this came together until just now, it just clicked
11:14 sri pink_mist: you're setting him up to fail though, subprocess is for one-shot operations, not continuously running background processes
11:15 pink_mist oh
11:16 sri thing is, with that approach he can only fail until he's an expert at managing perl processes with ipc and stuff
11:16 tchaves joined #mojo
11:16 zach sri: this is for kicking off a vm clone
11:16 zach sri: launching a minion by subprocess is wrong?
11:17 sri yes
11:18 zach what is correct then?
11:18 frantracer ok, I solved it, but now I am trying to understand how this actually works
11:18 sri the one shown in the docs
11:18 frantracer thank you :)
11:19 sri frantracer: take notes, send doc patches
11:19 zach sri: you mean just the whole sub that I had before that I put into a minion task to instead just be a subprocess itself?
11:20 sri zach: you do this http://mojolicious.org/perldoc/Minion#DESCRIPTION
11:20 sri nothing else
11:20 purl nothing else is feeling right either.
11:20 sri if you do something else you're on your own, nobody here will be able to help you
11:21 sri you cannot start the minion worker from inside your app
11:21 frantracer ok, once I get it, I will send some notes for the delay documentation, because I think it is quite short
11:21 zach https://f.perlbot.pl/pastebin/284
11:21 zach sri: I'm past that, I went on command line and did script/app minion worker &       10 times
11:23 zach sri: I'm doing a full app, not lite, so, in that case what is the appropriate location to define the tasks that are added?
11:23 gregf_ joined #mojo
11:23 bpmedley zach : Usually in the startup sub
11:24 zach ok
11:38 batman joined #mojo
11:43 blumbi sri, I cannot tell you what and how to document things, this can't be done by someone who is a novice on the software.
11:44 tholen joined #mojo
11:44 sugar joined #mojo
11:45 blumbi maybe in some month I'am able to
11:45 pink_mist that's all sri is hoping for =)
11:45 pink_mist (okay, maybe sri has grander hopes than that)
11:45 marcus one day he hopes to be a real boy
11:46 marcus http://vignette3.wikia.nocookie.net/poohadventures/images/2/2c/Pinocchio_(as_a_real_boy).jpg/revision/latest?cb=20130802201201
11:46 blumbi there are companies and opensource teams who encourage or even make it a requirement that everyone has to do a proper amount, defined in hours per week to document things and support people.
11:46 blumbi maybe that is a good approach for you guys as well :-)
11:47 zach is it hard to put a hash into the app config?
11:47 pink_mist it's *made* of hashes
11:47 pink_mist so no
11:47 pink_mist just use a reference
11:48 zach I'm dumb, I had a ( instead of a [ and it works now
11:48 zach I shouldn't be coding anything at this hour
11:48 pink_mist that's an arrayref, not a hashref
11:48 pink_mist (but that's perfectly fine too)
11:50 px80 some people believe that Perl will only survive in the long run if such cool frameworks as Mojo exists *and* are also supplying beginners with very good documentation and tutorials
11:56 zach perl is almost as old as I am, I think it'll be ok
11:56 zach people still write C
11:58 veryrusty joined #mojo
11:59 marcus px80: Hopefully those people will be contributing good documentation and tutorials
12:02 zach ok, confused again, I have 10 minion workers, and I can enqueue a job to kick off, but it just shows as enqueued unless I do a perform_jobs
12:03 sri blumbi: everybody working on mojolicious is a volunteer
13:06 tchaves joined #mojo
13:13 gryphon joined #mojo
13:16 sugar joined #mojo
13:55 * jberger reads back
13:56 jberger nic / frantracer: I'm actually a big advocate of nested delays
13:56 jberger I think it is the obvious usage in complex situations
13:58 nic But if it's a non-complex situation and you can't get nested delays to work...
14:00 jberger The problem in that case was that there was no begin in the outer delay first step
14:10 Obbi joined #mojo
14:13 Obbi Hi, I'm trying to figure out a problem I have with a transactor. I'm trying to ua->get a webpage from a dump server that sends simple headers and a response and then closes the connection. I get the status code but always a empty content.
14:14 Obbi Question is, how do I fix this? (especially cause in the buffer is the complete message.) ->res->body just gives me an empty string.
14:16 Obbi Is Mojo discarding the body if there is no content length? or the connection is interrupted?
14:16 gizmomathboy joined #mojo
14:17 sri http://mojolicious.org/perldoc/Mojo/UserAgent#DEBUGGING
14:28 Obbi Hm well yes, It's not helping. But I guess I know what the problem is
14:30 dod joined #mojo
14:36 lluad joined #mojo
14:55 Pyritic joined #mojo
14:57 marty joined #mojo
14:59 sugar joined #mojo
15:18 PryMar56 joined #mojo
15:34 mat joined #mojo
15:35 mat hi
15:37 mat I have a question about routing
15:37 mat I have an app which does $r = $app->routes; $involved = $r->under('/involved'); $contact = $involved->under('/contacts/:id_contact'); $contact->get('/')->to('some#thing');
15:37 mat if I do $app->url_for('contact', id_contact => 10); it will generate the /involved/contacts/10
15:38 mat but that url is not recognized by the router
15:43 kes joined #mojo
15:44 mat damn, I found the problem
15:44 pink_mist what was it?
15:44 mat if only instead of saying "None of these routes could generate a response for your GET request for /involved/contacts/10, maybe you need to add a new one?" it had said "template involved/contact_show" not found
15:44 pink_mist ah
15:47 disputin joined #mojo
15:47 mat it's my fault, because I renamed the method and not the template, but, well, grmbl
15:48 mat (or maybe mojo could come with a not_found.development.html.ep template)
15:51 mat (or something else, anyway, solved)
15:59 blonewolfs joined #mojo
16:06 sh14 joined #mojo
16:15 sugar joined #mojo
16:21 itaipu joined #mojo
16:35 Pyritic joined #mojo
16:45 zach mat: morbo will tell you not_found.development.html.ep, tells me all the time when I screw up
16:45 mat zach, well, yeah, it does, but the browser kept telling me "none of these routes blah blah" so I kept looking into why the routes were wrong
17:00 sri this is depressing :S (coolo just showed it to me after i told him why "return;" is bad) https://www.securecoding.cert.org/confluence/display/perl/EXP00-PL.+Do+not+return+undef
17:00 sugar joined #mojo
17:02 Grinnz 🤦
17:03 jberger yeah, you can never really be sure about context
17:08 pink_mist this was just linked in freenode's #perl .. might be a nice read for the folks in here too: http://renesd.blogspot.de/2017/02/is-postgresql-good-enough.html
17:09 kiwiroy joined #mojo
17:09 * sri puts 🤦 on a hotkey
17:10 * Grinnz is still waiting for irccloud to get unicode 9.0
17:13 lluad That postgresql article is way more useful than you'd expect from the title.
17:14 sri yea, sounds like clickbait
17:20 * ashimema wishes he hadn't just read that security link.. he's now more confused than he was before
17:21 sri just don't use "return;"
17:21 ashimema already in that good habbit..
17:21 Grinnz https://metacpan.org/pod/Perl::Critic::Policy::Freenode::EmptyReturn
17:22 Janos joined #mojo
17:24 sri Grinnz++
17:25 ashimema but what should you return for the case in that securecoding link
17:25 Grinnz an empty list, since it's a list context function
17:26 ashimema brill.. I had read it right then
17:26 coolo Perl::Critic::Policy::Freenode::ModPerl - Don't use mod_perl to write web applications
17:26 coolo good check :)
17:26 Grinnz a blanket "don't return undef" is useless though
17:26 ashimema and for functions that are intended to be called in either content.. deal with that properly ;)
17:26 Grinnz I would say that actually the majority of functions are scalar context
17:26 Grinnz or intended to return scalar values
17:27 coolo sri: we need that packaged and used for openQA - P0! :)
17:27 Pyritic joined #mojo
17:27 sri coolo: 👍
17:27 Grinnz and "return;" in such a function is harmful when it is inevitably used in a hash constructor or function arguments
17:28 Grinnz coolo: :)
17:34 Grinnz ashimema: functions that are intended to be called in either context should force a specific context and document it
17:34 asarch joined #mojo
17:34 Grinnz otherwise people will use it in a hash constructor and be surprised when the wrong thing happens
17:34 ashimema makes sense.. thanks guys.. another little addition to making me a slightly better coder.. long way to go still for me I think ;)
17:44 px80 what does $client->connect exactly do?
17:45 px80 compared to $ua->get there is another method in $client which creates the callback
17:47 px80 so "$client->on ( connect " is a requirement of $client->connect?
17:47 px80 totally confuses me
17:56 sri that's fine, the api is not meant for endusers
17:59 itaipu joined #mojo
18:03 sri this could use more opinions https://github.com/kraih/mojo/pull/1053
18:15 itaipu joined #mojo
18:16 brian_ joined #mojo
18:17 jberger I wish I felt qualified to comment
18:17 sri the implementation is not terrible
18:17 sri i can clean it up easily
18:17 sri comments would be useful about the api
18:17 mib_ik63g8 joined #mojo
18:18 pink_mist just added a +1 to marcusramberg's comment because that's the same as I'm thinking
18:19 mib_ik63g8 I am trying to use HTML::Template with Mojolicious::Lite, I am using the plugin 'HTMLTemplateProRenderer', but I cant see to understand how to load an external template into the code, any one would know how I could see an example of it?
18:21 px80 Do I need to register to some event to make use of non-blocking write from a client socket opened vi $client->connect?
18:21 Grinnz i don't know of anyone that uses HTML::Template anymore
18:21 jberger mib_ik63g8: if that plugin is at all sane it should work like any other renderer
18:21 jberger $c->render('template');
18:21 pink_mist all conventional knowledge says tath HTML::Template is awful and should be avoided
18:22 pink_mist *that
18:22 mib_ik63g8 well its actually HTML-Template-Pro-0.9510
18:22 px80 I just want to open a connection to a server port, send some data and close the socket again. All this in a loop for many connections to same server on a port-range.
18:22 pink_mist why not use something that's actually commonly used?
18:22 Grinnz HTML::Template::Pro is les awful as far as i know, but uses the same weird api
18:22 px80 I wonder if I need to use §client->on ( ...
18:22 pink_mist like Template::Toolkit or indeed Mojo's EP templates?
18:23 mib_ik63g8 I just like how code is clean and separated in HTML::Template style is
18:23 Grinnz if it's possible to switch i'd recommend using either standard Mojo::Template or Text::Xslate
18:23 jberger px80:  I don't understand your question
18:23 px80 why not?
18:23 px80 @jberger
18:23 jberger and I think I'd need to see a code example
18:23 px80 ok
18:25 mib_ik63g8 #!/usr/bin/env perl  use Mojolicious::Lite; plugin 'HTMLTemplateProRenderer';  # Render template in "templates/index.tmpl" get '/ext_temp' => sub {   my $c = shift;   #$c->render(templates => 'index');   #$c->render('templates/index');    # fill in some parameters   #$c->param(HOME => $ENV{HOME});   #$c->param(PATH => $ENV{PATH}); };
18:26 Grinnz please don't paste code into the channel, use a paste site like gist.github.com
18:26 mib_ik63g8 I dont know how to paste code in here but there is it, a sample of it
18:26 Grinnz the other template engines we mentioned are even cleaner, have you tried them?
18:27 mib_ik63g8 i rather use something I used before, till I ran out of choices
18:27 Grinnz well we dont have any experience with using that plugin
18:27 Grinnz or template engine, most likely
18:31 mib_ik63g8 thats sucks!! :(
18:32 pink_mist yes, HTML::Template sucks =)
18:32 mib_ik63g8 can you explain why you dont like ot?
18:34 pink_mist no, I was just making a crude joke - I've never actually used it myself, so I don't have an opinion about it
18:34 mib_ik63g8 or can you give me an example where you can load an external template using your favorite template, lets  say Mojo::Template?
18:34 Grinnz I used it a long time ago, and it had issues with unicode as well as painful syntax
18:34 px80 jberger: https://gist.github.com/anonymous/1ea128cd6f765adc8095ec8d91cc9a87
18:34 mib_ik63g8 haha I got it! ;-)
18:35 Grinnz mib_ik63g8: can you be a little more specific what you mean?
18:36 Grinnz https://metacpan.org/pod/Mojolicious::Guides::Rendering#Layouts and https://metacpan.org/pod/Mojolicious::Guides::Rendering#Template-inheritance might be helpful
18:36 mib_ik63g8 I just want to load an external template into the code and pass some params to it, very basic till I decide it I am using it or not, need to convert some code and I am testing the best way
18:37 mib_ik63g8 need to external not internal to the code
18:37 px80 @jberger its example code
18:37 jberger do you ever start the loop?
18:37 Grinnz mib_ik63g8: to render as a response, or just into a string result?
18:38 mib_ik63g8 I posted here some sample code
18:38 px80 jberger, the ->wait is missing
18:38 px80 but when its there I get:
18:39 mib_ik63g8 first step, you load an index page with your data, second you collect data and third you display data back to the user
18:39 Grinnz mib_ik63g8: https://metacpan.org/pod/Mojolicious::Guides::Rendering#Rendering-templates
18:40 px80 Mojo::Reactor::Poll: Timer failed: Can't use string ("Can't connect: Name or service n"...)
18:40 px80 seems some minor problem with the connect arguments
18:40 Grinnz mib_ik63g8: templates are located in the 'templates' directory of the application by default, see https://metacpan.org/pod/Mojolicious::Guides::Rendering#Renderer
18:40 jberger px80: I was trying to understand why that looked so foreign to me, and it is because I usually use the higher-level interface: http://mojolicious.org/perldoc/Mojo/IOLoop#client
18:41 px80 the main thing I'am wondering about is if I actually need to register to the connect even
18:42 jberger in the higher-level api you pass a callback which is essentially the connect handler
18:42 jberger also you get a stream object rather than a handle
18:42 Grinnz mib_ik63g8: it's probably a good idea for you to read through that whole guide
18:42 jberger so you can put the $end->() in the ->write method's drain callback
18:42 mib_ik63g8 I've seeing it before, it doesn't explain enough
18:43 mib_ik63g8 like this line: $c->render(template => 'foo/bar/baz', format => 'txt', handler => 'epl');
18:43 mib_ik63g8 first argument is where the template is, ok there
18:43 mib_ik63g8 the second one is the extension of the template?
18:43 mib_ik63g8 handler is what????
18:43 px80 jberger I will try that one
18:43 Grinnz format and handler are both the extensions
18:43 mib_ik63g8 the file has to be called index.txt.epl????
18:44 px80 seems that its basically just a shortcut of my method
18:44 jberger mib_ik63g8: the documenation of that plugin says that it registers a "tmpl" handler
18:44 dod joined #mojo
18:45 jberger px80: yes, but it also gives you this stream object rather than a simple handle object
18:45 jberger which gives you the flexibility to only call the end callback after everything is written
18:45 Grinnz format.handler is a standard for ep templates as format tells you what kind of data is templated and handler tells you what template engine to use
18:45 mib_ik63g8 the handler is tmpl what about the format???
18:46 jberger mib_ik63g8: enough with the ??? ok, please
18:46 jberger people are trying to help you
18:46 Grinnz i would guess that plugin ignores the format, i don't know
18:47 jberger px80: oh, reading back I see now that you are having a connection error
18:47 jberger then yes I don't think my advice to this point should matter
18:48 jberger that said, I don't know how to help
18:49 mib_ik63g8 thanks to your all for trying!
18:50 px80 jberger, works now with your code
18:50 px80 good good
18:50 purl Great Googly Moogly!
18:50 jberger purl++
18:50 jberger glad to hear it
18:50 px80 is purl a bot?
18:50 jberger not sure why there should be a difference, but all's well that ends well right?
18:50 jberger purl: botsnack
18:50 purl thanks jberger :)
18:51 px80 exactly
18:51 px80 purl: sit down
18:51 purl bring me a fainting couch! - I do believe I have a case of the vapors
18:51 pink_mist purl: are you a bot?
18:51 purl a bot? yeah right.
18:51 jberger purl: info
18:51 purl info is an annoying and incomptible break from standard mandocs. or Mind-Boggling STUPID.  what we need is info2html or Joy!  Go see info2www! or what we REALLY need is info2man or a pain to navigate or see pinfo
18:51 jberger errr
18:51 jberger purl: status
18:51 purl Since Fri Jan 20 15:59:37 2017, there have been 719 modifications and 130 questions.  I have been awake for 24 days, 20 hours, 51 minutes, 59 seconds this session, and currently reference 988040 factoids. Addressing is in optional mode.
18:52 px80 purl: then its time to sleep
18:52 purl px80: huh?
18:52 pink_mist purl: go to bed
18:52 purl pink_mist: what?
18:52 jberger ok, that's enough fun with purl, don't want to clutter up the channel too much :-P
18:52 pink_mist :)
18:52 px80 heh
18:55 stryx` joined #mojo
18:56 itaipu joined #mojo
19:08 Pyritic joined #mojo
19:09 rshadow joined #mojo
19:10 kiwiroy joined #mojo
19:19 itaipu joined #mojo
19:19 rshadow joined #mojo
19:35 itaipu joined #mojo
19:42 dod joined #mojo
19:49 itaipu joined #mojo
20:26 disputin joined #mojo
20:32 kiwiroy joined #mojo
20:40 sugar joined #mojo
20:51 kiwiroy joined #mojo
20:53 jberger apparently on freenode#perl there was some confusion about the documentation for minion's -j
20:53 jberger it seems that since they expected that mojo does things with an event loop, that -j was like max concurrent things in a loop
20:54 jberger and they spent lots of time trying to make multiple instances of the worker
20:54 jberger and because it didn't prefork all the workers that in their mind confirmed their suspicion
20:54 jberger so I could propose making a tiny doc change
20:55 jberger "Number of jobs to perform concurrently, defaults to 4" --> "Maximum number of jobs to perform in forked worker processes, defaults to 4"
20:56 jberger http://mojolicious.org/perldoc/Minion/Command/minion/worker#SYNOPSIS
20:58 Pyritic joined #mojo
20:58 veryrusty joined #mojo
21:10 marty joined #mojo
21:13 sri jberger: done
21:14 jberger do you think its helpful to have the word "maximum" there so that they know that there won't always be that many processes, as the would be for a worker pool?
21:15 jberger I don't have a strong opinion, just a question
21:15 sri you could have asked that earlier :/
21:16 jberger I did have "maximum" in my text, but no I didn't frame it that way :s sorry
21:17 jberger I think mentioning forks already goes a long ways however
21:17 jberger already breaks the reader of the notion of ioloop concurrency
21:18 sri jberger: done
21:19 jberger sri++
21:19 sri it's consistent with the other commands
21:19 sri jberger++
21:23 kiwiroy joined #mojo
22:01 cpan_mojo Mojolicious-Plugin-Restify-0.06 by KWAKWA https://metacpan.org/release/KWAKWA/Mojolicious-Plugin-Restify-0.06
22:04 rshadow joined #mojo
22:24 disco joined #mojo
22:24 disco hi there
22:24 purl que tal, disco.
22:24 disco I'm fine tnx, and you ?
22:25 disco bot ? ;)
22:25 sri bot :)
22:25 sri o/
22:25 disco almost passed turing test ;)
22:25 * sri pats purl
22:25 purl how condescending
22:28 disco I played a while ago with Mojo::Pg in a lite_app. And I used 'helper pg => sub { }'. However this can't be used as-is in a Mojo app (not lite). Any idea how to use Mojo::Pg to have persistent connection (not with Mojolicious::lite) ?
22:28 sri $app->helper(pg => sub {})
22:28 sri it all translates
22:29 sri there's an example in the dist https://github.com/kraih/mojo-pg/tree/master/examples/blog
22:29 disco ok. thanks. I still have to habit my eyes and brain to mojo ;)
22:29 disco sri: oh great, thanks for this example !
22:31 disco I wondered if I had to put all code in startup sub { } (I mean, the good practice), this example answers.
22:31 Rando joined #mojo
22:31 Rando should data_section 'main' give me sutff in a lite app?
22:33 Rando seems like if I add a package Foo before the __DATA__ it's happy again
22:33 disco sri: really big thanks, example is the best way to learn ;)
22:33 sri glad you like it
22:36 sri Rando: data_section with main definitely works
22:38 Rando hrm
22:38 sri kinda wish the blog example was a guide
22:38 sri hmm, irccloud is having issues again :S
22:43 Rando http://pastebin.com/ETKzvjhq
22:43 Rando Which bit am I holding wrong here?
22:44 Rando I came to it trying to boil down the example in https://github.com/jhthorsen/mojolicious-plugin-openapi
22:44 Rando which couldn't find the data://main/...json
23:01 Janos joined #mojo
23:28 veryrusty joined #mojo
23:29 bpmedley Rando : Just for my understanding, are you saying that the 1st app (lines 1 - 12) is not working correctly?
23:30 Rando Yes sir
23:30 Rando but sneaking the package declaration in the middle brings it back to life
23:31 ningu joined #mojo
23:31 bpmedley $VAR1 = { 'lols' => undef };  <-- I get that, and you're saying you get just { }; ?   Is that accurate?
23:32 Rando it's an empty hash-ref
23:32 ningu when I have an error in a template, or an exception in a route, mojo redirects to not_found.html.ep rather than exception.ep. why?
23:33 ningu exception.html.ep*
23:33 pink_mist ningu: citation needed
23:33 purl citation needed is probably http://xkcd.com/285/
23:33 Rando pink_mist: from whom?
23:33 purl from whom is expected too much
23:33 ningu I could make a minimum working example, I suppose
23:33 bpmedley Rando : What version of perl and Mojolicious?
23:34 pink_mist Rando: I was *specifically* asking ningu, so whom do you think?
23:34 Rando Successfully installed Mojolicious-7.25 (upgraded from 7.13)
23:34 Rando Summary of my perl5 (revision 5 version 18 subversion 2) configuration:
23:34 Rando on a macintosh.
23:34 Rando (of all things)
23:38 ningu hrm, I think I figured it out
23:44 bpmedley Rando : I can not reproduce.  I'm on OS X, just installed perl 5.18.2, and Mojolicious 7.25.  Would you create a gist that I can clone and try?
23:45 sugar joined #mojo
23:48 Rando so, if you take lines 1 to 14, inclusive and put it in a file on disk in /tmp, and you point morbo at it doesn't say $VAR1 = {}; ?
23:48 disputin joined #mojo
23:54 bpmedley I downloaded the file via Download link, kept lines 1-13, and ran via '$ ... get /' and '$ ... daemon' via browser.  Both variants show '$VAR1 = { 'lols' => undef };'
23:54 bpmedley Rando : Morob shows {}
23:55 Rando lols=>undef is wrong in both cases, isn't it?
23:56 bpmedley I'm not 100% sure.  I'd like a gist I can clone, or the exact file in pastbin that I can Download.  Right now, there are extra lines that I must delete, and I'm not sure if I have the exact file you are running.

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