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

IRC log for #mojo, 2015-02-09

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

All times shown according to UTC.

Time Nick Message
00:26 good_news_everyon joined #mojo
00:26 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/bFJu
00:26 good_news_everyon mojo/master f7452ce Sebastian Riedel: a link tag is more efficient
00:26 good_news_everyon left #mojo
00:28 ente so hm
00:29 ente another question
00:29 ente Mojo::Reactor::Poll: Read failed: Can't call method "res" on an undefined value at /usr/lib/perl5/vendor_perl/5.18.1/Mojolicious/Controller.pm line 211.
00:29 ente what does this mean? :P
00:29 ente https://paste.xinu.at/qtCf/ here's the code I currently have
00:30 ente ... except the hilighter is broken for some reason so you'll have to use this link instead: https://paste.xinu.at/qtCf/perl
00:30 nicomen it means that you need to keep a reference to the ua object outside your callback, or else it's reference is lost IIRC
00:31 ente I see
00:31 nicomen or
00:31 nicomen where do you get the error?
00:31 purl i heard the error was KABOOM!
00:33 ente that's a good question...
00:35 jberger ente: nicomen's suggestion is usually the culprit
00:36 ente I had no idea there was an ua object :)
00:36 jberger oh, I didn't see your code, nm, looking
00:37 ente I'm very clueless, there may be one somewhere
00:37 Anon joined #mojo
00:37 ente I'm just starting out
00:37 ente I'm amazed I can kind of authenticate already using the module I wrote :>
00:38 jberger you probably don't want to be rendering index inside that under
00:38 ente I see
00:39 ente anything else that's obviously wrong?
00:39 jberger can you confirm line 211
00:39 jberger or should I say, are you using github/master of mojo?
00:40 ente nope
00:40 ente line 211 is sub res { shift->tx->res }
00:40 jberger try running your code with Carp::Always
00:41 jberger that should give you a full stack
00:41 jberger also you can try with MOJO_DAEMON_DEBUG=1
00:41 jberger but I don't think its going to help in this case
00:42 ente well I suppose the $c->render('index') was the culprit
00:43 jberger not surprising
00:43 ente how do I redirect to '/' then?
00:44 nicomen redirect internally right?
00:44 jberger redirects should be fine
00:44 nicomen or 301?
00:44 purl it has been said that 301 is Moved Permanently or Thank you for the request, but the page is in another server!
00:44 nicomen purl: oh shut up
00:44 purl ;-(
00:44 ente alright
00:44 jberger once the under matches, it should fall through to rendering index
00:45 jberger index is a template?
00:45 ente yep
00:45 jberger ok
00:45 ente it yields this now: [Mon Feb  9 01:44:53 2015] [debug] Nothing has been rendered, expecting delayed response.
00:45 ente which of course times out
00:45 ente is that $c->continue?
00:46 jberger I'm assuming the template is something simple?
00:46 ente Hello <%= $user %>
00:48 jberger btw, stashing and then redirecting does you no good
00:49 ente ok
00:49 jberger but I don't see what else is the trouble
00:49 jberger I think likely there is an exception somewhere that is getting lost, or else nothing is getting rendered (not finding the template?)
00:50 jberger without a full example I can't test, and indeed I can't anyway cause I'm about to take the wife out to dinner
00:50 ente *nod*
00:51 ente I'm about to sleep for a bit
00:51 sri http://mojolicio.us/perldoc/Mojolicious/Controller#tx
00:52 ente jberger: have fun!
00:52 ente and thanks a lot
00:53 jberger sri: "Note that this reference is usually weakened, so the object needs to be referenced elsewhere as well when you're performing non-blocking operations **OR** the underlying connection might get closed early."
00:53 jberger ente: how long does the rpc request take?
00:53 sri jberger: no
00:54 jberger oh, you're right, I read it wrong
00:54 ente less than a second, but I don't have accurate information
00:54 ente the website responds instantaneously
00:55 dotan1 joined #mojo
00:56 jberger anyway, I'm out for a bit, o/
00:59 asarch joined #mojo
01:05 Grinnz https://github.com/Grinnz/Mojo-Log-Clearable this is essentially 2 lines of code, should i even bother putting on cpan :P
01:08 good_news_everyon joined #mojo
01:08 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/bFYU
01:08 good_news_everyon mojo/master 716442c Sebastian Riedel: just use Helvetica Neue for now
01:08 good_news_everyon left #mojo
01:16 cpan_mojo Mojo-Log-Clearable 0.001 by DBOOK - http://metacpan.org/release/DBOOK/Mojo-Log-Clearable-0.001
01:28 nicomen Grinnz: what does clear handle mean?
01:29 Grinnz nicomen, so the next time it logs it will get a new handle from ->path
01:29 nicomen did it clear my old file?
01:29 Grinnz lol no
01:29 nicomen what's the intention behind it?
01:29 purl somebody said the intention behind it was IoC, no?
01:30 Grinnz the synopsis, that shows the intention basically
01:30 Grinnz the other use cases is for a logrotate
01:30 nicomen do you mean it has to be "reopened" or set to point to the new path?
01:31 Grinnz right, when it gets a new handle it will be for the new path
01:31 nicomen so you made a trigger, that re-inits the fh once the path changes?
01:31 Grinnz basically yes
01:32 nicomen ok
01:32 nicomen btw. not sure how much it helps with logrotate and friends
01:32 Grinnz after a logrotate, you can call $log->clear_handle instead of making a new log object
01:33 nicomen and that is basically re-open handle ;)
01:33 Grinnz right
01:33 Grinnz because the current handle would be pointing to the rotated file
01:33 nicomen yeah I know ,)
01:33 nicomen by experience
01:33 Grinnz i just ran into this issue recently hehe
01:33 nicomen and some of the log rotators even allow you to notify an app when it has been rotated
01:34 Grinnz that part is up to the app really
01:34 nicomen but I ended up using cronolog and logging to a pipe at that time
01:35 nicomen nowadays if I could choose I would use syslog, and ship it to a central place for merging/munging
01:35 nicomen but my point was that clear, is not so clear ;)
01:36 Grinnz yeah perhaps
01:49 Grinnz https://github.com/Grinnz/Mojo-Log-Clearable/blob/master/README.pod any better?
01:51 sri hmm, looks like i've only sold 7 of those badass mugs :o
02:02 klapperl_ joined #mojo
02:03 inokenty-w joined #mojo
02:54 cpan_mojo Statocles 0.035 by Doug Bell - http://metacpan.org/release/PREACTION/Statocles-0.035 (depends on Mojolicious)
02:59 klapperl joined #mojo
03:06 * jberger wants a mug
03:13 noganex joined #mojo
03:14 * sri mugs jberger
03:14 jberger :o
03:22 * Grinnz takes a mugshot
03:27 elik joined #mojo
03:27 preaction takes a shot of a mug
03:27 * preaction did i just say that out loud?
04:33 stryx` joined #mojo
04:34 sh4 joined #mojo
06:41 marcusr GOOD MORNING
06:41 purl Lies!
06:42 marcusr purl: you misanthropist!
06:42 purl marcusr: sorry...
06:42 marcusr I guess it's in your nature...
06:59 mtths joined #mojo
07:13 basiliscos joined #mojo
07:25 marmez Hello!
07:27 marmez I know this is not directly related to Mojolicious, but I'm writing a Mojolicious app based on DBI and I'm trying to test the db connections with Test::MockDBI.
07:29 marmez I have this problem:
07:29 marmez http://www.perlmonks.com/?node_id=1115939
07:30 marmez Maybe you will know what is wrong with that code.
07:30 marmez ->get_all_songs() returns undef
07:31 marmez Why?
07:46 preaction why use Test::MockDBI when you could use a SQLite database for testing?
07:47 marmez preaction: because I already use SQLite database
07:47 preaction so?
07:47 purl so is Ah, so!
07:48 marmez So I should use another one only for testing?
07:48 preaction from what i can tell, Test::MockDBI is supposed to mock the DBI methods, not the methods of your class. you're setting the wrong thing to mock. you also never give the Test::MockDBI object to your object, so it's using the wrong dbh entirely
07:48 preaction yes. instead of a connect() method, pass in the dbh that the object should use
07:50 preaction you're building a Mojolicious app, so build a proper object using Mojo::Base
07:50 preaction then you get attributes and a constructor made for you
07:53 sh4|2 joined #mojo
07:55 preaction https://gist.github.com/preaction/3d47ac7429e8bd12488b <- something like this perhaps
07:55 preaction i wrote it, but i didn't try it. i assume there are bugs
07:56 marmez Thank you for tip on Mojo::Base
08:09 marmez => Is the Mock::DBI usable only for testing the DBI module?
08:24 Vandal joined #mojo
08:24 eseyman joined #mojo
08:42 odc joined #mojo
08:43 trone joined #mojo
09:04 ZadYree joined #mojo
10:07 cpan_mojo MojoX-Renderer-HTC 0.02 by Renee Baecker - http://metacpan.org/release/RENEEB/MojoX-Renderer-HTC-0.02
10:16 reneeb joined #mojo
10:16 punter joined #mojo
10:28 dparry joined #mojo
10:28 dparry is there a mojolicious preferred way of generating uuids out of interest? (Or perhaps just some personal preferences?)
10:30 dparry thinking maybe UUID::Tiny
10:32 Anon joined #mojo
10:56 HtbaaPi as of Mojolicious 5.73 Routes::Route::bridge has been deprecated in favor of ::under, but does it work exactly the same?
10:57 marmez preaction: Your solution does not solve the problem with undef value returned by ->get_all_songs() method
11:09 Dandre joined #mojo
11:28 reno_13 joined #mojo
11:31 reno_13 hi all
11:38 punter hi
11:38 purl salut, punter.
11:39 dotandimet joined #mojo
11:40 alnewkirk joined #mojo
11:41 pink_mist marmez: his soultion has {RaiseError => 1} ... and if that were to return undef, an error would have been raised
11:46 pink_mist *solution
12:00 marmez preaction, pink_mist: you are right, I've got a typo in my script. I detect it after a rest. preaction's solution with test db works fine.
12:36 amon joined #mojo
12:37 asarch joined #mojo
13:24 marty joined #mojo
13:51 neilhwatson joined #mojo
14:14 gryphon joined #mojo
14:15 kaare joined #mojo
14:26 sri i guess cloudflare ssl is dead now that isp blocklists add more and more of their ips
14:27 * sri was actually thinking about enabling it for mojolicio.us
14:28 sri yay for the great firewall of the uk :S
14:29 punter joined #mojo
14:32 marcusr sri: wat?
14:32 purl Watt?  Watt?  I can't hear you, there's this buzzing noise where my brain should be. or https://www.destroyallsoftware.com/talks/wat
14:32 marcusr fuck those isps
14:32 sri https://news.ycombinator.com/item?id=9020646
14:33 marcusr "Wouldn't help in general. Firstly, lots of sites on Sky's default block list aren't porn.
14:34 Grinnz gg uk
14:43 sri hahahaha... stay classy HN... "To be honest if they can't afford the $240/year to get TLS added to Heroku perhaps they've got bigger problems?"
14:45 sri looks like there's at least spam and gambling sites on the cpanmin.us cert https://www.sslshopper.com/ssl-checker.html#hostname=https://cpanmin.us
14:47 Grinnz lol
15:00 jberger sri: and convos.by :-)
15:02 reneeb Just a reminder that Mark Keating is looking Google Summer of Code project ideas: http://wiki2.enlightenedperl.org/index.php5?title=Google_Summer_of_Code
15:03 reneeb Organisation application period starts today...
15:04 jberger reneeb: last time I looked I was the only one on it!
15:05 reneeb jberger: I added some ideas for two projects of mine that use Mojolicious ;-)
15:05 jberger reneeb++
15:05 jberger just looked
15:08 dparry joined #mojo
15:14 batman they are missing the point... cloudflare is first a cdn, not a "ssl proxy"
15:15 Grinnz lawmakers missing the point regarding the internet? never!
15:16 batman Grinnz: i was thinking about the "can't afford ssl" comments
15:18 DaniBunn1 joined #mojo
15:19 Mikey joined #mojo
15:30 ente jberger: so what am I supposed to do instead of stash-then-redirecT?
15:30 ente (I've already wondered why the stashed stuff doesn't show up)
15:31 jberger flash then redirect
15:31 jberger flash stores data in the session cookie
15:31 jberger so that it can be found on the next invocation
15:31 jberger the stash is server side only, so when the client redirects, it is forgotten
15:31 ente ahh, I see
15:41 PotatoGim^Home joined #mojo
15:49 dparry joined #mojo
15:50 Mikey do you guys see any benefit from using lowlatency/realtime kernels on deployments with huge event loops
15:50 Mikey (meaning lots of connected websockets, mostly)
15:51 Adura Realtime kernels for the realtime web?
15:52 Mikey haha yeah :)
15:52 Mikey i know the tradeoffs of using the preempt/low latency kernels, but i was just wondering if anyone had any experience testing it out.
15:52 Mikey i'm gonna play around in a bit
16:44 odin22 joined #mojo
16:45 punter joined #mojo
16:52 Grinnz jberger, question; is there any problem with just using the first callback in forkcall as a closure, instead of passing in args?
16:52 Grinnz theres nothing weird going on there, it just gets forked before it's executed, right
16:52 jberger shouldn't be
16:52 jberger that was mostly a holdover from AE::Util::fork_call()
16:59 Grinnz cool, that simplifies things heh
17:10 reneeb_ joined #mojo
17:15 ignacio_ joined #mojo
17:49 dod joined #mojo
17:53 Ptolemarch joined #mojo
18:12 Gilly joined #mojo
18:15 elik joined #mojo
18:20 dparry joined #mojo
18:21 dod joined #mojo
18:36 ua_ joined #mojo
18:45 dparry joined #mojo
18:49 disputin joined #mojo
18:56 dotandimet joined #mojo
19:17 Ptolemarch joined #mojo
19:17 dotandimet joined #mojo
19:17 Gilly left #mojo
20:05 ignacio_ joined #mojo
20:09 Anon021 joined #mojo
21:06 ilbot2 joined #mojo
21:06 Topic for #mojo is now 🐯 hear me roar | http://mojolicio.us | http://irclog.perlgeek.de/mojo/today
21:15 reneeb joined #mojo
21:26 sri bye bye spdy
21:27 sri http://blog.chromium.org/2015/02/hello-http2-goodbye-spdy-http-is_9.html
21:29 reneeb_ joined #mojo
21:31 marcusr we hardly knew ya
21:31 kaare joined #mojo
21:34 cfedde the singularaity is here.
21:36 cfedde also what is framing layer as compared to application layer?
21:36 cfedde I guess the singularity has passed me by.
21:50 jberger does anyone have an nginx configuration that has nginx handling ssl (https) and then talking to hypnotoad over http on the inside
21:50 jberger ?
22:02 disputin joined #mojo
22:13 mishantil jberger: I considered that setup, but decided on [ Pound ]->[ Varnish ]->[ Hypnotoad ].
22:14 mishantil jberger: so it is (HTTPS)->[ Pound ]-(HTTP)->[ Varnish ]-(HTTP)->[ Hypnotoad ].
22:18 jberger I almost have this working finally
22:19 jberger I'm not getting pusher to connect
22:19 jberger (and yes I am using a new enough nginx)
22:20 mishantil The number of frustrated people talking about nginx and ssl made med go for the abovementioned setup.
22:20 mishantil It was _not_ painless, but it does work fairly well.
22:22 sri looks like Link headers are going to be huge very soonish :o
22:22 mishantil At least we have not experienced that weird "ohshitwhyissuddenlyrandomsslconnectionsdroppingohmygod!"-issue that seem to plague nginx-users.
22:22 sri https://github.com/h2o/h2o/issues/141
22:23 sri h2o and nghttp2 have adopted that approach
22:25 jberger its possible that pusher isn't working without ssl on this particular host
22:25 jberger :/
22:26 mishantil Ouch. Anyway; hope you manage to fix it. :) Those kinds of issues are just no fun.
22:32 sri btw. i've claimed the mojolicious team on bountysource, in case someone wants to put a bounty on a feature :) https://www.bountysource.com/teams/mojolicious
22:38 marmez joined #mojo
22:48 sri hmm, maybe worth bringing back Link support
22:49 sri https://github.com/kraih/mojo/commit/b5c4de20d3f75b4e17fb583af105963d4fcce184
22:49 sri https://github.com/kraih/mojo/commit/fdd6c579b31145bed0f762544c94013f57a3851d
22:49 sri it existed for a very short time
22:50 sri and perhaps something to generate Link headers
22:51 sri $c->links({url => '/css/foo.css', rel => 'preload'}, {url => '/js/foo.js', rel => 'preload'});
22:51 sri $ua->get(...)->res->links->[0]{url};
22:52 sri i suppose $c->res->links(...) would work too
22:53 sri get and set
22:53 purl i heard get and set was usually going to be enough
22:53 ua_ left #mojo
22:53 * sri pats purl
22:53 * purl purrs
22:53 Averna joined #mojo
22:54 sri it's all pretty straight forward, only not so pretty part is this https://github.com/kraih/mojo/commit/fdd6c579b31145bed0f762544c94013f57a3851d
22:54 sri for actually tokenizing Link headers
22:55 sri Link: <f;o>; bar=baz, <b,z>; yada="a b c"
22:55 sri since that's a valid Link header
23:00 sri http://docs.python-requests.org/en/latest/user/advanced/#link-headers
23:00 sri http://expressjs.com/4x/api.html#res.links
23:01 sri both are actually flawed, since they don't support multiple links with the same rel value
23:02 sri (i think, the documentation for both is not great)
23:04 jberger I really don't like the spec for those headers, I think of semi-colon as a stronger separator than comma
23:04 jberger but I don't get to choose that
23:04 sri no you don't ;p
23:06 bc547 joined #mojo
23:09 jberger batman, in your swagger editor, does that do client side pod rendering?
23:09 jberger if so, how do you do that, is there some library?
23:10 jberger hmmm, no, it looks like that's in the server-side, nm

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