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

IRC log for #mojo, 2015-02-27

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

All times shown according to UTC.

Time Nick Message
00:02 neyasov joined #mojo
00:05 Topic for #mojo is now 🍻 cheers | http://mojolicio.us | http://irclog.perlgeek.de/mojo/today
00:10 Grinnz_ mintty still doesn't show anything for that character, big surprise there
00:13 buu Grinnz_: Mine does!
00:13 buu Of course I'm not sure what it is
00:15 Grinnz_ "Clicking Beer Mugs"
00:15 Grinnz_ Clinking*
00:19 punter joined #mojo
00:29 bwf joined #mojo
00:45 Grinnz jberger, if you want to know true horror, i think this might be what was hanging up my application: https://metacpan.org/source/MARKSTOS/CGI-Session-4.48/lib/CGI/Session/Driver/DBI.pm#L133
00:45 Grinnz fucking with the database handle on destroy in a forked process, oy
00:48 zivester joined #mojo
00:49 tempire So. When is our first big marketing push for mojoconf?
00:50 jberger Grinnz: I can see that being problematic, but I'm surprised that it caused hung processes to be laying around
00:51 jberger sri: so which way did the template fix land?
00:51 Grinnz jberger, well here's hoping i dont ever have to figure out exactly what was going on
00:51 kayi joined #mojo
00:51 jberger Grinnz: that's true
00:52 Grinnz jberger, another gem: CGI::Session has a destructor that uses the database handle, and that destructor i linked will disconnect the database handle if it opened it to begin with. global destruction fun
00:53 jberger :o
00:53 Grinnz luckily in mojo theres no database handles stored globally so it doesnt matter much, except in test files :P
00:53 Grinnz in CGI scripts though...
00:56 Anon021 joined #mojo
01:00 jontaylor joined #mojo
01:02 punter joined #mojo
01:07 csson joined #mojo
01:27 bwf joined #mojo
01:29 sri jberger: no warnings 'ambiguous'
01:30 jberger eh, lets see how it goes
01:30 jberger when was the last time that warning actually caught something useful
01:30 * sri shrugs
01:31 sri i only know about the false positives
01:32 sri like shift . 'foo'
01:33 sri has been fixed recently
01:35 sri of course, we'll prolly never know how it works out... because who notices a missing warning?
01:36 sri templates had "no warnings 'redefine'" for years, and nobody noticed ;p
01:38 sri i could only see someone notice the odd " + " here ;p http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Reusable-template-blocks
01:41 jberger the function with following parens is one of my 5 things about perl that drive me crazy
01:41 jberger brian d foy says that any programmer who knows his language can name 5 things that he hates about it
01:56 Grinnz 1. calling undef variables uninitialized, 2. while's $_ magic that doesn't localize $_, 3. the whole given/when and smartmatch fiasco, 4. => not applying scalar context, 5. mlehmann
01:57 Grinnz ooh is it too late to put "each" on my list
02:00 davido_ joined #mojo
02:06 marty joined #mojo
02:23 preaction i'll put it on my list, how about?
02:24 mst Grinnz: each() can die in a fire
02:24 jberger perl -E 'say scalar +(sub{ return qw/a b c/ })->()'
02:24 jberger vs
02:24 preaction give me a real iterator type...
02:24 jberger perl -E 'say scalar +(sub{ my @a = qw/a b c/; @a })->()'
02:24 jberger list vs array returns in scalar context
02:25 jberger damn near no one documents that their function returns a list vs an array
02:28 sri yea, that seems super fragile
02:32 asarch joined #mojo
02:38 klapperl joined #mojo
02:49 cpan_mojo Mojolicious-Plugin-FormValidatorLazy 0.02 by Sugama Keita - http://metacpan.org/release/JAMADAM/Mojolicious-Plugin-FormValidatorLazy-0.02
03:08 good_news_everyon joined #mojo
03:08 good_news_everyon [mojo] kraih pushed 2 new commits to master: http://git.io/xTCC
03:08 good_news_everyon mojo/master ced1c5e jamadam: removed old api usage from document
03:08 good_news_everyon mojo/master 4e60bb4 Sebastian Riedel: Merge pull request #747 from jamadam/master...
03:08 good_news_everyon left #mojo
03:11 inokenty-w joined #mojo
03:13 Grinnz jberger, wow
03:25 davido__ joined #mojo
03:37 noganex joined #mojo
04:04 disputin joined #mojo
04:10 inokenty-w joined #mojo
04:44 sri haha, so react.js is already over :o
04:45 jberger sri: ?
04:45 sri https://github.com/atom/atom/pull/5624
04:46 Grinnz hhaha
04:49 jberger that guy, using emoji like words
04:49 sri that's actually convention at github
04:50 buu "Might want to return after this line to prevent array return.
04:50 jberger maybe we should use more emo ... ALL GLORY TO THE HYPNOTOAD!!!!
04:50 buu Excellent language design feature.
04:53 cpan_mojo WWW-Crawler-Mojo 0.12 by Sugama Keita - http://metacpan.org/release/JAMADAM/WWW-Crawler-Mojo-0.12
04:56 jberger jamadam++ is going for it
05:22 waghso joined #mojo
05:24 waghso can I ask question here?
05:24 sri you already have :)
05:25 waghso i'm learning Mojolicious but dont know how to redirect a page on submitting form
05:26 sri the growing guide has an example for that
05:27 waghso please look at http://paste.scsys.co.uk/467975
05:29 waghso how do I redirect to another page?
05:33 good_news_everyon joined #mojo
05:33 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/xTyT
05:33 good_news_everyon mojo/master ed31981 Sebastian Riedel: a few more examples
05:33 good_news_everyon left #mojo
05:35 hahainternet sri: saw the news, congrats
05:35 hahainternet i swear i'll take time for doing some mojo asap
05:39 Adurah joined #mojo
05:42 waghso help me http://paste.scsys.co.uk/467975
05:43 waghso please
05:43 davido_ joined #mojo
05:47 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Tutorial#File-uploads
05:47 marmez joined #mojo
05:47 sri hahainternet: 🍻
05:48 sri i guess that tutorial secton could link to the actual method too... but i don't see how it could fit into the text
05:55 melo joined #mojo
05:55 sri interesting http/2 and go pair programming session :o https://www.youtube.com/watch?v=yG-UaBJXZ80
05:56 sri i never actually looked into the internals of the go http package
05:56 sri those abstractions look pretty nice
05:56 waghso how to redirect to , consider result.html page instead of returning text?
05:57 * sri still wants to factor out more code from Mojo::UserAgent :)
05:57 sri lots of ideas in there... if someone else wants to give it a try
06:01 disputin joined #mojo
06:16 meredith waghso: the example linked above shows a use of redirect_to($route_name), you just use that instead of render before leaving that sub
06:26 waghso meredith: I will try that
06:31 dod joined #mojo
06:37 dod joined #mojo
06:55 kaare joined #mojo
07:09 dod joined #mojo
07:09 kaare joined #mojo
07:51 cpan_mojo Mojolicious-Plugin-NYTProf 0.14 by Lee Johnson - http://metacpan.org/release/LEEJO/Mojolicious-Plugin-NYTProf-0.14
07:55 kaare joined #mojo
08:07 kaare joined #mojo
08:12 eseyman joined #mojo
08:12 Vandal joined #mojo
08:16 ver joined #mojo
08:17 Lee https://metacpan.org/source/COOLMEN/Test-Mojo-More-0.05/lib/Test/Mojo/More.pm#L106 # what would be a v6 compat version of this? I'm trying to monkey patch this in Test::Mojo::Most since the author of Test::Mojo::More seems to be MIA (or at least not responding to RT tickets)
08:20 trone joined #mojo
08:27 fhelmber_ joined #mojo
09:43 meshl joined #mojo
09:59 amon joined #mojo
10:02 HtbaaPi joined #mojo
10:25 rwp joined #mojo
10:27 arthas joined #mojo
10:29 waghso joined #mojo
10:29 jontaylor joined #mojo
10:34 waghso Need help for using 'redirect_to'.
10:34 waghso When I'm using  $self->redirect_to("result.cgi"); getting error
10:34 waghso `Not Found
10:34 waghso The requested URL /cgi-bin/cgi-bin/Mojotest.cgi/result.cgi was not found on this server.`
10:34 waghso Can somebody tell me what is wrong? Mojotest.cgi is placed in ..\Apache24\cgi-bin\Mojotest.cgi in Windows.
10:36 bpmedley waghso: Do you have a smallish Mojolicious::Lite example that shows the issue?
10:37 waghso shall I post the file via pastebin?
10:37 bpmedley Sure
10:37 punter joined #mojo
10:39 waghso http://paste.scsys.co.uk/468140
10:40 waghso bpmedley: here is the file
10:43 nicomen don't see any /result.cgi route added?
10:43 bpmedley waghso: http://mojolicio.us/perldoc/Mojolicious/Controller#url_for  <— This might work
10:45 waghso nicomen: result.cgi is different file
10:45 waghso in same folder as Mojotest.cgi
10:45 nicomen don't you need the mojo server to know about that file?
10:46 nicomen is it put in the correct static folder?
10:46 waghso I'm running on Apache Server in Windows
10:48 riche waghso: try redirect to fully qualified url
10:50 waghso In < my $url = $c->url_for('http://example.com/index.html'); > How can I use $url to redirect?
10:50 bpmedley waghso: https://gist.github.com/brianmed/0605b76a50a5bf4dc36f <— What happens when you run this from command line: perl redir.pl get -v /redir
10:51 bpmedley waghso: $c->redirect_to($url), I believe
10:51 waghso I'll try that
10:52 bpmedley I’m wondering if it’s a context difference between Apache and Mojolicious, if that makes sense.
10:58 ssm jberger: https://github.com/mojoconf is an organization already.  ssm, nicomen, sjn and marcus can add members.
11:01 waghso bpmedley: perl redire.pl get -v /redir http://paste.scsys.co.uk/468153
11:01 bpmedley waghso: Location: result.cgi <— is that the right header for result.cgi?
11:02 waghso yes
11:02 bpmedley Are you getting the error from Mojolicous or Apache?
11:03 waghso Internal Server error for: my $url = $c->url_for('http://10.22.5.43:90/cgi-bin/result.cgi');   $self->redirect_to("$url");
11:03 waghso Apache
11:04 bpmedley What’s in the error log?
11:08 waghso http://paste.scsys.co.uk/468155
11:08 waghso Ooops. I forgot to change $c to $self
11:09 bpmedley Did that happen to make everything work?
11:09 waghso bpmedley: successfully redirecting now!
11:10 bpmedley Awesome.  So, you neded to fully qualify the URL and that made things work?
11:10 waghso url_for worked. Thanks you sooo much
11:10 waghso Yes
11:36 marmez joined #mojo
11:39 meshl joined #mojo
12:30 dotandimet joined #mojo
12:37 kwa joined #mojo
12:58 jberger ssm: oh!
13:02 neilhwatson joined #mojo
13:03 kaare joined #mojo
13:04 mattastrophe joined #mojo
13:05 HtbaaPi joined #mojo
13:10 dotandimet joined #mojo
13:16 Dandre joined #mojo
13:16 Ptolemarch joined #mojo
13:21 lb joined #mojo
13:30 HtbaaPi joined #mojo
13:40 batman ssm: how about adding me, jberger and tempire ? :)
13:41 * batman wonder why i'm not part of the group already
13:41 batman :)
13:41 tencendur joined #mojo
13:43 nicomen batman: jberger: tempire: added you to the mojoconf team
13:43 batman nicomen: cool. thanks :)
13:56 riche batman: thanks
13:56 batman you're welcome
13:58 riche overnight I just came to the conclusion that python/jython can go royally bleep itself.  I'm swearing that POS off forever.
14:03 dotandimet joined #mojo
14:05 jberger python kinda sucks, its true
14:05 jberger come back to the light
14:06 riche the last reason why I cared was using java libraries via jython but in the end I found it's simply not worth it
14:08 riche the last straw was not being able to read public static attributes on java classes.
14:09 riche just flippin stupid.  might as well just write java and call it from perl if I really must
14:19 jberger There was an Inline::Java that I did get working at least once
14:20 doby riche: i have to use jython at work for http://grinder.sourceforge.net/ i hate it more every time i am forced to use it
14:21 riche jberger: yah there are a lot of exceptions last time I tried Inline::Java but I should try agin.
14:21 doby seriously considering converting the whole load test suite to clojure
14:21 jberger its been a while since I used it too, so I have no idea
14:21 riche doby: and I feel the same way about ruby.  so I totally steer clear of stuff like puppet and chef
14:22 DaTa I've used Inline::Java in a test some time ago, it worked very well
14:22 jberger I know one of the guys who has been working on Inline, so if there are bugs, maybe I can poke him
14:23 ryozi joined #mojo
14:23 DaTa but i was just doing some simple string parsing and comparing
14:23 riche jberger: cool I will keep that in mind.  But I will really try not to add jsr 268 support to mojolicious.  it would end life as we know it.
14:25 riche I do a lot of work with ibm products that are mostly java based.  sometimes I can get away with REST work but most customizations will require java and/or xml work.
14:29 asarch joined #mojo
14:29 zivester joined #mojo
14:36 dotandimet joined #mojo
14:36 bobkare I used htmlunit through inline::java a while back, other than it being a less capable browser than I needed it worked fine
14:38 gryphon joined #mojo
15:02 punter joined #mojo
15:04 QGuLL joined #mojo
15:06 QGuLL hi, i've got a Mojo app that uses the default logger. I'd like to patch my startup behavior to force log to go into one directory, if it exists, and else stay with the default logger (which isn't set/configured anywhere, purely default), but i don't know where to put it
15:07 howitdo joined #mojo
15:20 QGuLL is there any $my_app->setlog($my_app->logger(…)) ?
15:21 Ptolemarch joined #mojo
15:22 jberger $app->log(Mojo::Log->new)
15:24 jontaylor joined #mojo
15:26 gryphon joined #mojo
15:28 Lee looks like http://mojo.perl-services.de/ is broken as it's incorrectly reporting everything fails with 5.21.9 - if anyone knows where reneeb is then please poke
15:28 Lee (he doesn't seem to have a github repo for this)
15:29 sh4 joined #mojo
15:30 QGuLL jberger: thanks, it works
15:31 jberger cool
15:31 jberger note that you can also overload $app->home if you like the default behavior but just want a different home path
15:32 crab what is custom socket support for? (re: vote on reverting 1712764315fbee14c9a1d03de48833ed064191a5)
15:33 btyler crab: it enables modules like this: https://metacpan.org/pod/Mojo::UserAgent::UnixSocket
15:33 riche jberger: kayi has planned merchandising, Su mtg will discuss 'responsible'
15:34 riche cuz we will want to do bundles, like conf+merch, train+conf+merch, etc.
15:36 jberger riche: cool beans (does anyone say that anymore?)
15:37 QGuLL jberger: don't want to change the home, just want to launch several instances from the same code in fact
15:37 QGuLL so same logfile for several instances was a bad idea :)
15:38 jberger gotcha, I just wanted to be sure you knew it was a possibility
15:45 sri oh my, this release got tweeted more than the last one after all :o
15:52 jberger I still haven't figured out how to type a unicode character on this frikken mac
15:52 jberger :(
15:52 mgrimes joined #mojo
15:53 maze joined #mojo
15:53 sri jberger: 😎
15:53 jberger perl -CSAD -E 'say "\N{CLINKING BEER MUGS}"'
15:53 jberger also, chome's frikken font!
15:54 sri jberger: there's always control+command+space
15:55 genio I didn't know about CTRL+Command+Space
15:55 jberger 🍻
15:55 genio nice.  I was just looking up how to create a compose key for mac
15:55 jberger nice! other than the font of course
15:55 jberger stupid mac chrome
15:55 bjoernfan jberger: If you don't still have a harddrive taped to the lid I'm going to be very disappointed.
15:58 jberger bjoernfan: nope, that whole computer is gone
15:58 jberger I still have the harddrive
15:59 Grinnz_ thats one way to cover up that dumb logo i guess ;)
15:59 preaction ♹ <- clearly the next version
15:59 Grinnz_ plasticlicious
16:00 preaction or maybe that should wait until 8: ♾
16:00 jberger Grinnz_: I had a locked-down windows laptop from work, but I could get into the bios (ya know) so, dual boot from an external hard drive running ubuntu over esata
16:00 Grinnz_ that one doesnt render for me
16:00 Grinnz_ jberger: lol
16:01 Grinnz_ jberger: just don't slam the lid while it's running eh?
16:02 jberger it had some heavy grade velcro
16:02 jberger but yeah, don't bang it around
16:02 jberger before the velco, the disk dropped once or twice
16:02 Grinnz_ it would be a tad easier these days with distros that will run straigh from a usb key :P
16:02 jberger running your os off a hd that hits the ground, requires a format/reinstall
16:03 Grinnz_ especially since you can get 128gb usb keys
16:08 ignacio_ joined #mojo
16:18 kwa1 joined #mojo
16:25 riche jberger: did you get a new mac?
16:25 jberger $new_work got me a $new_mac
16:25 riche hopefully ur not making the same mistake i did
16:25 jberger not sure it's completely mine, but it certainly isn't locked down
16:25 jberger ?
16:26 riche started using it without reformatting the filesystem to be case sensitive
16:26 jberger I'm not sold on the whole thing, but I do like the hardware (if you exclude the keyboard)
16:26 jberger :o
16:26 sri DO NOT REFORMAT YOUR MAC TO BE CASE SENSITIVE
16:26 riche ?
16:26 sri tons of software won't work
16:26 riche I feel it kills me now
16:27 jberger all the more reason to be afraid
16:27 sri literally half the mac app store depends on a case insensitive file system
16:28 riche it just pisses me off sometimes ... like manifest/MANIFEST/Manifest etc its like being on bloody windows
16:30 Grinnz_ this is why you just reformat your mac to be linux
16:30 * Grinnz_ runs
16:32 punter joined #mojo
16:35 jberger Grinnz_: if any reformatting happens, that would be the plan
16:35 riche i knew a guy who did that with freebsd.  never understood it.
16:36 jberger one word: apt
16:37 riche jberger: I think you'll just need homebrew to be happy
16:37 jberger yeah.... no so sure about that
16:37 riche i compile my gnu chain with my own options
16:37 Grinnz_ there's a version of apt in the fedora repositories, for whatever godawful reason
16:38 riche once you get past gcc it's good sailing.
16:38 riche but the apple gcc will ... be freaky behaving sometimes
16:40 riche anyways back to work... having fun methodically axing all and any jython from my current deliverable ;)
16:40 jberger riche: happy axing!
16:41 Grinnz_ axing day is fun
16:41 Grinnz_ right sri?
16:42 sri riche: it's all clang now though
16:42 sri right Grinnz
16:45 sri argh... i think there's a useless method i missed :o
16:45 sri https://github.com/kraih/mojo/blob/master/lib/Mojo/Message/Request.pm#L185
16:46 sri ->query_params is actually more typing than ->url->query
16:46 sri think it was added for consistency with ->body_params
16:48 jberger sri: first "deprecated in CLINKING BEER MUGS" already?
16:48 Grinnz_ makes sense
16:48 Grinnz_ haha
16:49 sri i don't know :S
16:49 jberger opinionz: https://gist.github.com/jberger/48e7e036448e1247213d
16:49 jberger YAPC::NA/mojoconf submissions
16:50 sri sounds good
16:51 jberger I'm thinking a 40min talk for command line and 20 minute for Test::Mojo::Phantom
16:54 * sri likes the minion connection
16:57 jberger me too
16:58 jberger I'm also going to mention my use of basic auth to allow command line get from authenticated services in you app
17:08 good_news_everyon joined #mojo
17:08 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/xtZQ
17:09 good_news_everyon mojo/master 9e4f1aa Sebastian Riedel: url->query is easier to type than query_params
17:09 good_news_everyon left #mojo
17:09 sri oh well
17:12 jberger I guess I don't hate it for symmetry with body_params, but I'm not going to fight for it
17:12 jberger I have never used it
17:12 sri i feel the same way
17:13 sri it was pretty much just forgotten, not mentioned or used anywhere
17:15 sri i actually wanted to add the usual "# Longer version" with "$req->url->query" and noticed it's not even shorter
17:16 jberger a few usages on CPAN
17:16 jberger http://grep.cpan.me/?q=-%3Equery_params
17:16 jberger maybe worth keeping, it's not hurting anyone
17:18 fhelmbe__ joined #mojo
17:18 * sri shrugs
17:18 sri i suppose the consistency argument could also have been made for Mojo::Log::is_fatal when i removed that :)
17:19 sri (because is_fatal is always true)
17:19 sri btw. body_params is not actually in Mojo::Message::Request but the base class Mojo::Message
17:22 sri *if* we keep it
17:23 sri then i suppose this example should use it
17:23 sri https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Controller.pm#L592
17:24 jberger :'(
17:24 HtbaaPi joined #mojo
17:24 dotandimet joined #mojo
17:25 jberger http://www.nytimes.com/2015/02/27/arts/television/leonard-nimoy-spock-of-star-trek-dies-at-83.html?_r=0
17:25 fhelmber_ joined #mojo
17:26 sri :(
17:27 good_news_everyon joined #mojo
17:27 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/xtB3
17:27 good_news_everyon mojo/master 3cf6e48 Sebastian Riedel: we are keeping query_params for consistency
17:27 good_news_everyon left #mojo
17:37 Ptolemarch joined #mojo
17:39 sri yea, using ->query_params there does look a little more consistent http://mojolicio.us/perldoc/Mojolicious/Controller#param
17:40 dod joined #mojo
17:42 meshl joined #mojo
17:42 sri i like live analytics, there are 10 people browsing the docs at this moment
17:43 sri and 3 of you are looking at the controller page i just linked to :)
17:45 Grinnz_ spy!
17:45 sri http://ifunnyweb.com/wp-content/uploads/funny-Mike-Mayers-Spy-meme.jpg
17:46 Grinnz_ nice
17:46 sri for some reason that was the first google result :D
17:47 icjs joined #mojo
18:00 sh4 joined #mojo
18:04 jberger joined #mojo
18:04 jberger hahahaha # http://ifunnyweb.com/wp-content/uploads/funny-Mike-Mayers-Spy-meme.jpg
18:15 icjs that should be the background of mojolicio.us
18:15 icjs good weekend all
18:23 jberger sri: is the type for a minion job id defined to be an integer?
18:24 jberger I don't especially care, this is for some documentation
18:27 jberger nm, it seems that the file backend has hex values, so, "a unique value" is fine
18:28 sri jberger: this is currenclty the sctrictest backend https://github.com/kraih/minion/blob/master/lib/Minion/Backend/Pg.pm#L404
18:29 sri oh wait
18:30 sri hmm... i guess an id can be anything, the backend decides
18:31 jberger that's what I cam to as well
18:31 jberger came
18:33 sri btw. the one thing about minion i'm still worried about is dead worker detection
18:34 sri basically this part https://github.com/kraih/minion/blob/master/lib/Minion/Backend/Pg.pm#L104-L111
18:35 sri it's a rather tough problem
18:44 marty joined #mojo
18:46 jberger indeed
18:49 Ptolemarch joined #mojo
18:56 sri also been wondering if the worker mainloop should happen in an eval... so possible errors can be logged
19:03 marmez joined #mojo
19:03 amon joined #mojo
19:03 davido__ joined #mojo
19:03 riche joined #mojo
19:03 doby joined #mojo
19:03 alnewkirk joined #mojo
19:03 xdg joined #mojo
19:03 chansen joined #mojo
19:03 oliver joined #mojo
19:03 stryx` joined #mojo
19:03 jnbek joined #mojo
19:03 vytas joined #mojo
19:03 panzana` joined #mojo
19:03 mtths joined #mojo
19:03 memowe joined #mojo
19:03 legz joined #mojo
19:03 zackiv31 joined #mojo
19:03 mattp joined #mojo
19:03 tardisx joined #mojo
19:03 jbob joined #mojo
19:03 tomboh joined #mojo
19:03 skaji_ joined #mojo
19:03 da5id joined #mojo
19:03 KindOne joined #mojo
19:03 diegok joined #mojo
19:03 lupi joined #mojo
19:03 ssm joined #mojo
19:03 augensalat joined #mojo
19:03 cosimo_ joined #mojo
19:03 preaction joined #mojo
19:03 Snelius joined #mojo
19:03 crab joined #mojo
19:03 charsbar joined #mojo
19:03 Foxcool joined #mojo
19:03 jzawodn joined #mojo
19:03 xtetsuji_ joined #mojo
19:03 genio joined #mojo
19:03 bd joined #mojo
19:03 robinsmidsrod joined #mojo
19:03 allison joined #mojo
19:03 yusukebe joined #mojo
19:03 Andreas2 joined #mojo
19:03 jmmills joined #mojo
19:03 cfedde joined #mojo
19:03 Rallias joined #mojo
19:03 psandin joined #mojo
19:03 mrEriksson joined #mojo
19:03 mikegrb joined #mojo
19:03 hahainternet joined #mojo
19:03 throughnothing joined #mojo
19:03 purl joined #mojo
19:04 Ptolemarch joined #mojo
19:04 dod joined #mojo
19:04 fhelmber_ joined #mojo
19:04 maze joined #mojo
19:04 gryphon joined #mojo
19:04 howitdo joined #mojo
19:04 Dandre joined #mojo
19:04 rwp joined #mojo
19:04 Adurah joined #mojo
19:04 klapperl joined #mojo
19:04 neyasov joined #mojo
19:04 dotan1 joined #mojo
19:04 Nemix joined #mojo
19:04 ashimema joined #mojo
19:04 bpmedley joined #mojo
19:04 tianon joined #mojo
19:04 inokenty joined #mojo
19:04 sjn joined #mojo
19:04 denny joined #mojo
19:04 Mikey joined #mojo
19:04 buu joined #mojo
19:04 Quai joined #mojo
19:04 bzero joined #mojo
19:04 Ralesk joined #mojo
19:04 bc547 joined #mojo
19:04 upasana_ joined #mojo
19:04 firnsy joined #mojo
19:04 btyler joined #mojo
19:04 stokachu joined #mojo
19:04 batman joined #mojo
19:04 kmx joined #mojo
19:04 espen joined #mojo
19:04 pink_mist joined #mojo
19:04 bjoernfan joined #mojo
19:04 sri joined #mojo
19:04 bjakubski joined #mojo
19:04 murre joined #mojo
19:04 michael joined #mojo
19:04 Jonis joined #mojo
19:04 s1037989 joined #mojo
19:04 cpan_mojo joined #mojo
19:04 DaTa joined #mojo
19:04 bowtie joined #mojo
19:04 nicomen joined #mojo
19:04 salparadise joined #mojo
19:04 nicomen1 joined #mojo
19:04 mudler joined #mojo
19:04 omega joined #mojo
19:04 lestrrat joined #mojo
19:04 caeles joined #mojo
19:04 mishantil joined #mojo
19:04 marty joined #mojo
19:04 jberger joined #mojo
19:04 sh4 joined #mojo
19:04 kwa1 joined #mojo
19:04 zivester joined #mojo
19:04 neilhwatson joined #mojo
19:04 Vandal joined #mojo
19:04 noganex joined #mojo
19:04 bwf joined #mojo
19:04 csson joined #mojo
19:04 elik joined #mojo
19:04 diginet_ joined #mojo
19:04 al joined #mojo
19:04 n2plato joined #mojo
19:04 muraiki joined #mojo
19:04 absolut_todd joined #mojo
19:04 d4rkie joined #mojo
19:04 Lee joined #mojo
19:04 Grinnz joined #mojo
19:04 Kundun joined #mojo
19:04 mst joined #mojo
19:04 Grinnz_ joined #mojo
19:04 marcus joined #mojo
19:04 hernan604 joined #mojo
19:04 Bender joined #mojo
19:04 gabiruh- joined #mojo
19:04 jamesw joined #mojo
19:04 Zx3 joined #mojo
19:05 sri perhaps workers should just store a heartbeat in the database every now and then, and we put a timeout after which a worker is considered dead... like a day
19:06 trone joined #mojo
19:08 fhelmber_ joined #mojo
19:11 fhelmber_ joined #mojo
19:15 sri oh, resque actually does that too these days :)
19:19 meshl joined #mojo
19:20 sri no wait... it doesn't... looks like they failed trying to make it work :o
19:25 avkhozov_ joined #mojo
19:26 sri resque actually seems to be in a pretty bad situation
19:27 sri github now uses an internal fork, and the open source version has been mostly abandoned
19:28 riche joined #mojo
19:28 BinGOs joined #mojo
19:31 sri not something to be decided too hasty...
19:31 sri i think a proper heartbeat version would also require a new version of register_worker
19:31 sri one that can be called over and over, to ensure the current worker is still registered
19:32 jberger is it too crazy to wonder if the worker should daemonize?
19:33 jberger treat it a bit like prefork?
19:34 sri i don't think there are many good reasons to do that
19:34 Ptolemarch joined #mojo
19:34 sri and prefork does not daemonize
19:34 jberger sorry, I meant hypnotoad
19:34 jberger clearly
19:35 jberger the problem is that the minion table isn't dynamic enough to monitor the workers
19:35 sri but why?
19:35 jberger if there was some process that was watching the workers on a given machine, it could know what was going on
19:36 jberger ./myapp.pl minion workers 5
19:36 sri are you sure you mean daemonize?
19:36 jberger I mean fork into the background
19:36 sri and not just prefork
19:36 asarch joined #mojo
19:37 sri i'm a bit confused
19:37 jberger ok, starting over
19:38 jberger rather than starting a worker with ./myapp.pl minion worker &
19:38 jberger instead do ./myapp.pl minion workers N
19:38 jberger or else have some configuration or something
19:38 jberger and like running hypnotoad myapp.pl
19:38 jberger you get a bunch of workers with heartbeats
19:38 sri ok, sounds like the daemonize part is totally unimportant there :)
19:39 jberger fine, so my terminology is bad
19:39 jberger :-)
19:39 jberger that is probably expected
19:39 sri you want a manager that manages a pool of workers
19:39 jberger yes
19:39 riche jberger: you sound like a sweatshop manager
19:39 jberger it could ensure that the workers are there
19:39 sri yes, i've been wanting to do that for some time
19:39 sri problem is, it means going unix only
19:40 jberger leave worker as is
19:40 sri too much untested code then
19:40 jberger that is the basic unit, like daemon
19:41 jberger for my freebsd init script, I used this https://www.freebsd.org/cgi/man.cgi?query=daemon&amp;sektion=8
19:41 jberger with the -r to make it supervise
19:41 jberger if the worker dies, a new one is started
19:41 sri not sure we are talking about the same thing after all
19:42 sri but anyway, yes, i would love to have one manager process with a bunch of workers, and even a setting with the number in a table, so you can increase/decrese dynamically
19:43 jberger that's all I'm suggesting :-)
19:45 sri not easy though, especially testing
19:45 jberger sri: I settled on this for my usage, but it would be nice to have something closer to what hypnotoad allows
19:45 jberger http://pastie.org/9963993
19:45 sri well, i won't be able to work on it anytime soon
19:45 jberger line 45 is the interesting one
19:46 sri if you want to work on a patch, maybe Mojo::Server::Prefork can be reused
19:47 jberger I was just wondering that
19:47 jberger I'll take a look this weekend
19:47 sri it's generic enough now to support preforking arbitrary event loop apps
19:48 sri with a low enough heartbeat timeout it could work
19:49 jberger sounds promising
19:54 genio I generally don't subclass Mojo::UserAgent, but a coworker has done so and was getting an error on destruction.  I can easily fix this by not subclassing Mojo::UA, but wondered why this simple case would generate errors:  https://gist.github.com/genio/20a2534f07a79e6fde24
19:57 jberger genio: you really don't need a lot of that code tbh
19:58 jberger like basic auth can go in the url userinfo
19:58 jberger headers can go in the request itself
19:58 genio jberger: nope.  sure don't.  as I said, I can easily fix this up, but was curious about the error itself
19:59 riche guys ... when u see the email from kayi dont take it the wrong way ... she is trying to get out of the 'echo chamber' to maximize attendance.  it wouldn't be so bad to have to increase seating space
20:02 jberger interesting, this is how you tell github which languages your project uses: https://github.com/github/linguist#overrides
20:02 asarch index.html.ep <- How can I get rid of the .html part (so it would be just index.ep)?
20:09 Grinnz_ jberger: nice
20:26 riche sri: I have a think w atom-mojo would you like me to just post an issue to github?
20:26 riche *thing
20:33 riche nevermind I think it's the core perl parser
20:35 meshl joined #mojo
20:51 sri jberger: i was just thinking this might be a problem for a Mojo::Server::Prefork worker https://github.com/kraih/minion/blob/master/lib/Minion/Backend/Pg.pm#L18
20:51 sri but if you do $prefork->ioloop(Mojo::IOLoop->new) you might be fine
20:52 jberger hmmmm, yes
20:52 sri it might actually not that hard after all
20:53 sri just overload Mojo::Server::Prefork::start, replace the ioloop, and run the worker logic in a recurring timer
20:55 sri regarding the schema, i suppose a config json column would make sense for storing all kinds of meta data in the worker table
20:57 sri although, that would mean the manager has to be the actual worker
20:57 sri hah, i guess the hardest problems won't be technical but architecture
21:00 sri oh... you don't even have to overload anything
21:00 sri $prefork->listen([])->ioloop(Mojo::IOLoop->new)
21:03 sri wow, this is actually quite elegant :O
21:03 sri MOJO_LOG_LEVEL=debug perl -MMojo::Server::Prefork -E 'my $p = Mojo::Server::Prefork->new(listen => [], ioloop => Mojo::IOLoop->new); $p->ioloop->recurring(1 => sub { say "$$:@{[time]}" }); $p->run'
21:03 sri happy accident
21:04 jabberwok joined #mojo
21:06 sri everything just works, TTIN/TTOU to increase/decrease pool size
21:07 jabberwok greetings.   wlindley@wlindley.com here, back focused on Perl [yay!] after a decade mostly chasing wordpress [sigh]
21:07 sri heartbeats and even graceful shutdown, thanks to the new $ioloop->stop_gracefully method
21:08 sri calling ->stop_gracefully will even inform the parent of our intention and trigger the graceful timeout there
21:09 sri jabberwok: seen one of your blog posts recently where you pointed out a bug, should have reported that!
21:09 sri jabberwok: jberger forwarded it here and got it fixed
21:10 sri jabberwok: https://github.com/kraih/mojo/commit/da152136cc68a55cdc381536e25104d0f2e95a65
21:10 sri (i think that was you ;p)
21:10 jabberwok yes
21:10 jabberwok i did not even realize it *was* a bug
21:11 sri well... i suppose it's arguable
21:11 jabberwok after looking at PHP for years, which is nothing but one massive bug, I'll have to get accustomed to proper code again?
21:11 Grinnz_ hahaha
21:11 jabberwok =)
21:12 Grinnz_ syntax like that throwing errors in PHP would most certainly be a feature
21:12 sri :D
21:13 sri i'm also still unsure if that ambiguous warning we have to work around now might actually be a perl bug
21:14 jberger jabberwok: o/
21:15 jberger you know, I meant to go back and comment on the post and then I got really busy the last few days
21:15 jberger sri: that's looking really cool!
21:15 sri i mean how is "$foo .= scalar bar()" less ambiguous than "$foo .= scalar + bar()"
21:16 jnbek I'm not sure those two things do the same thing...
21:16 Grinnz_ they do
21:16 Grinnz_ unary + is a no-op
21:17 Grinnz_ its just there so the parser doesn't interpret a following ( as being the args for scalar
21:17 kaare joined #mojo
21:17 jberger yes
21:17 Grinnz_ i.e. "$foo .= scalar (1+2)*3" vs "$foo .= scalar +(1+2)*3"
21:18 Grinnz_ the first one will scalar 1+2 and then multiply it by 3
21:18 jberger thats a bad example
21:18 dotandimet joined #mojo
21:19 jnbek ([J:0]jjones@perlgeeks4u[/tmp]% perl -E'sub bar { qw(1 2 3) } $foo .= scalar + bar(); say $foo;'                                                                                                                                                         [02/27/15][14:17:17])
21:19 jnbek Warning: Use of "scalar" without parentheses is ambiguous at -e line 1.
21:19 jnbek though they do both return 3
21:19 jnbek :)
21:19 Grinnz_ yeah thats the ambiguous warning sri mentioned
21:19 Grinnz_ its not really ambiguous though
21:20 sri perl -E 'scalar "bar"; scalar + "bar";'
21:20 sri that one should generate two warnings
21:20 jnbek I only got one
21:20 sri exactly
21:21 sri or rather... two warnings or no warnings :)
21:21 jnbek true
21:21 jabberwok as long as no-one says "Perl 6 is the answer here"  <sarcasm/>
21:22 jnbek also typing salar results in some fun spew
21:26 * sri loves the new Mojo::Server::Prefork internals
21:28 sri without the accept mutex it's all sooooo clean and reusable
21:31 sri literally could just be turned into a Mojo::IOLoop::Prefork
21:51 riche jberger: is mct being moved to https://github.com/mojoconf ?
21:51 berov joined #mojo
21:52 jberger yes, though batman has just about rewritten all of it :-)
21:52 jberger I haven't had much time this week and he has
21:53 jberger batman: around?
21:53 jberger and reason for me not to move the mct repo under the mojoconf group?
21:53 jberger *any
21:53 batman No. Move it
21:54 batman Zzz
21:54 riche lol I was about to say I would be surprised ... Friday night ;)
21:54 riche but I would be wrong
21:54 batman It wasn't very much to rewrite. I still have most of your db schema :)
21:54 riche _most_ lol
21:55 batman Actually all. Just added some bits.
21:55 batman Going to bed. Back in ~eight hours.
22:02 jberger yes, there were going to have to be additions to that schema
22:04 jberger transferring now
22:20 disputin joined #mojo
22:56 cpan_mojo Ado 0.83 by Krasimir Berov - http://metacpan.org/release/BEROV/Ado-0.83 (depends on Mojolicious::Plugin::OAuth2)
23:07 alnewkirk joined #mojo
23:20 riche I usually use DBIx::Class but Mojo::Pg is like grease lightning to use... wow
23:27 riche wow Mojo::Pg::Migrations :)
23:30 sri PostgreSQL does all the work ;)
23:34 riche the modules just make it stupid easy.  no excuses now!
23:35 * Grinnz_ has plenty of excuses, but none by choice
23:35 riche honestly I don't work with pg... until now.  usually it's sqlite, mysql, db2, oracle, or mssql
23:35 Grinnz_ for a relational database my choice would always be pg
23:38 sri i've used postgresql a lot back when Class::DBI was still all the rage... and it by far not as good as it is today
23:38 sri *+was
23:38 riche like your exuses comment, 99% of the time I don't have a choice ;)
23:39 riche but now with mct ... I need to.  learning it though with another app I've had on the back burner
23:42 Grinnz_ yeah postgresql 9.0 was like a completely new database
23:42 Grinnz_ and they've made huge strides with every release since
23:42 genio mct?
23:42 purl i think mct is funny sometime4s.
23:42 riche genio: it's our answer to act
23:44 riche lol psql I have no idea ... no 'attach database' or 'use database' ... such a pg noob :p
23:49 Grinnz_ \connect database?
23:49 riche yah just learned \c and \dt
23:49 Grinnz_ psql has tons of \ commands
23:50 riche just funny though
23:51 riche I am having trouble with $m->migrate(0)->migrate though
23:51 Grinnz_ it makes sense if you think about it; switching databases and inspecting schemas is something you do from the command line but not code
23:52 Grinnz_ never used migration
23:54 riche it's way better DBIx::Class::DeploymentHandler, which is what I have been using on "autopilot"

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