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

IRC log for #mojo, 2018-01-29

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

All times shown according to UTC.

Time Nick Message
01:26 aborazmeh joined #mojo
01:31 itaipu joined #mojo
02:10 itaipu joined #mojo
02:58 ilbot2 joined #mojo
02:58 Topic for #mojo is now 🍩 nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
03:35 itaipu joined #mojo
03:59 itaipu joined #mojo
04:29 gizmomathboy joined #mojo
05:04 dboehmer_ joined #mojo
05:41 hesco1 Baffled, here.  Any ideas?  https://gist.github.com/hesco/a8118bc57c35cbe55788657613a9a704
05:43 Grinnz hesco1: the method should be ->status_is
05:43 Grinnz which you actually did right the first time lol
05:43 hesco1 thanks.  should check back with the docs from time to time, I guess.  thanks.
05:43 hesco1 is it getting late here?
05:45 hesco1 yes, that seems to work far better.  Thanks Grinnz.
05:45 mib_u0pug9 joined #mojo
05:57 inokenty-w joined #mojo
06:15 mib_7hi5ep joined #mojo
06:32 hesco1 Does a Mojolicious::Controller instantiate a ->session object when invoked?  Or do I need to explictly attach a Mojolicious->Sessions object to it somehow?
06:47 Grinnz it has one by default
06:47 Grinnz stored at $app->sessions
06:48 Grinnz $c->session accesses the session cookie data but the Mojolicious::Sessions object is stored in the app
06:53 hesco1 thanks.
06:54 hesco1 so where do I send the beer?
06:57 hesco1 so does $app->sessions do what this says:  http://mojolicious.org/perldoc/Mojolicious/Sessions ?
06:59 hesco1 I'm getting noise about: Can't call method "default_expiration" on unblessed reference; when I use: $self->session->default_expiration(900);
07:00 Grinnz sessions
07:01 Grinnz $app->sessions to set attributes of Mojolicious::Sessions which manages the sessions, $c->session for the contents of a specific session
07:18 hesco1 ah, that is helpful.  thanks!
07:18 hesco1 only 3 tests left and I can decalre victory on this piece.
07:19 hesco1 yeah!
07:23 hesco1 found it:  $self->app->sessions !  nice.  Still did not resolve issue, though.  I use a get_ok to create a session, the next get_ok finds the session, but the next get_ok fails to find the session.  very annoying.
07:31 noganex joined #mojo
07:48 McA joined #mojo
07:52 dod joined #mojo
07:57 AndrewIsh joined #mojo
08:04 Vandal joined #mojo
08:07 ashimema joined #mojo
08:07 dod joined #mojo
08:22 trone joined #mojo
08:36 hesco1 My assumption is that a Test::Mojo object will manage a session cookie across a multiple $t->get_ok() requests in a single script; would that be incorrect?
08:43 ashimema joined #mojo
08:46 Edward joined #mojo
08:55 hesco1 yeah, ok, final three resolved, all passing, and it would seem I do understand that there is a cookie being managed here somewhere.
09:14 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Growing#Sessions
09:14 sri there are docs
09:14 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Growing#State-keeping
09:27 bianca joined #mojo
09:51 tyldis How stable/precise in Mojo::IOLoop->timer? If I set it to 86400.25 for instance?
09:52 tyldis s/in/is
09:52 tyldis Would the reactor backend matter?
09:54 sri not very, and yes
09:54 jamesaxl joined #mojo
10:18 kes joined #mojo
10:29 marcus wish it was easier to contribute to perltidy.
10:31 sri don't we all
10:31 purl I don't!
10:40 karjala_ joined #mojo
10:45 Edward joined #mojo
10:59 tchaves joined #mojo
11:04 kes Hi. What do you think about "key/value list slices"? I think it will be useful in Mojolicious: http://paste.scsys.co.uk/568599
11:09 sri i don't think there is any reason to use the ugly form for kv slices
11:11 sri stash->%{qw(foo bar)}
11:12 kes no. latest will always return keys foo and bar
11:15 kes but in case key/value list slices the default value will be used, if nothing is provided in stash
11:15 kes compare: http://paste.scsys.co.uk/568612
11:16 sri i'm not understanding you again
11:22 itaipu joined #mojo
11:24 kes is it more clear now? http://paste.scsys.co.uk/568619
12:31 bianca joined #mojo
12:34 tcohen joined #mojo
13:11 hesco1 from inside a controller, can I call my own API?
13:11 hesco1 the API which the controller implements?
13:12 batman hesco1: $c->app->ua->get("/api/whatever")
13:12 batman but you probably want to add a helper which gives you the data instead
13:12 hesco1 may be a saner way of fdoing this, ok, thanks @batman, will test that
13:12 hesco1 yeah, that might be less convoluted.
14:02 aborazmeh joined #mojo
14:08 maschine_ joined #mojo
14:21 Pyritic joined #mojo
14:22 gizmomathboy joined #mojo
14:26 bwf joined #mojo
14:30 coolo joined #mojo
14:49 jacoby joined #mojo
14:50 itaipu joined #mojo
15:19 maschine_ sri:  I think there's a typo in the Mojo::Pg:Results docs -
15:19 maschine_ $db->insert('t', {a => 'b'}, {on_conflict => [['a'], {a => 'c'}]); should be
15:19 maschine_ $db->insert('t', {a => 'b'}, {on_conflict => [['a'], {a => 'c'}]});  (missing } at the end)
15:21 sri you are correct
15:21 good_news_everyon joined #mojo
15:21 good_news_everyon [mojo-pg] kraih pushed 1 new commit to master: https://git.io/vNSk1
15:21 good_news_everyon mojo-pg/master 7a7237f Sebastian Riedel: fix typo in example
15:21 good_news_everyon left #mojo
15:24 exp-innit mojolicious doesn't have any daemon-wide cache does it? just the per-request and session cookie stores?
15:25 batman exp-innit: you can store data in the app object, but that information is not shared between workers if you use prefork
15:26 exp-innit batman: roger, that's totally fine
15:26 exp-innit i'll just use the session store
15:27 genio Grinnz: Have you had any opportunity to bench Mojo::Reactor::UV?
15:40 sh14 joined #mojo
16:10 ChmEarl joined #mojo
16:25 jberger sri: sorry I was mostly unavailable for the weekend, I see that I was poked but I assume that its too late for comment?
16:25 jberger even if so, I'm not sure I'd have any
16:25 jberger once it comes to such complex queries I really don't see myself using sql generation
16:26 tyldis Is there a gain in choosing libuv over libev? I am very ignorant on this subject. Google didn't enlighten me more than some windows support and hotness.
16:28 jberger tyldis: ev has a few things that make it a little odd (as I understand it) like you really can't nest the loops etc
16:28 jberger but I think overall the biggest win is ... let's say ... a different level of confidence in the professionalism of the maintainers
16:29 tyldis Roger.
16:33 pink_mist yes, the maintainer is the biggest issue that EV has; UV fixes that issue
16:35 itaipu joined #mojo
16:40 tcohen joined #mojo
16:47 disputin joined #mojo
17:05 genio Looks like I started Alien::libuv on June 15, 2017. We got a working build of that across platforms on August 18, 2017. I've been working on UV since then pretty well non-stop (minus a few burn-out periods)
17:05 genio and we might actually have something now that works. \o/
17:05 nicomen \o/
17:06 genio So, 8 months of learning C and XS from scratch (pretty much) to get something working
17:06 jberger genio++ , amazing tenacity
17:07 genio I'm sure someone else with a greater skill set could have done so much faster, but nobody seemed to want to start
17:09 sri genio++
17:12 jamesaxl what kind of plugins does mojo need?
17:21 Grinnz genio: not yet, thanks for the reminder
17:21 Lee joined #mojo
17:27 mr_sticky joined #mojo
17:33 CandyAngel genio knows how to do XS?
18:01 good_news_everyon joined #mojo
18:01 good_news_everyon [mojo-pg] kraih pushed 1 new commit to master: https://git.io/vNSEw
18:01 good_news_everyon mojo-pg/master 7bb2864 Sebastian Riedel: add a shortcut for simple conflict targets
18:01 good_news_everyon left #mojo
18:04 genio CandyAngel: For some values of "knows"
18:05 disputin joined #mojo
18:09 jamesaxl genio: where did you learn XS?
18:09 genio CandyAngel: I'm fairly ok with saying I'm probably at a junior dev level with C. XS is more or less memorization of many macros. I've become comfortable-ish with a small subset of the available macros when writing XS. It's rote memorization and I have to look through the docs fairly frequently (read: very slow going)
18:09 genio jamesaxl: learning by doing with the UV module, really.
18:10 Grinnz XS is basically a subset of the perl source code which is implemented on a metalanguage made of C macros
18:10 genio I'm not really even comfortable putting my skillset with XS at the junior dev level. I'm still at the college student idiot level
18:11 genio I might make a good unpaid intern in that realm
18:14 jberger genio: that small subset is what I did for PerlGSL::DiffEq and friends
18:14 jberger just enough to make it work
18:15 gryphon joined #mojo
18:15 jberger and then I gave a talk on it at YAPC, Baby XS
18:15 jberger don't sell yourself short, that much is pretty good
18:15 jberger honestly learning how to read perlxs and perlapi is a major hurdle
18:16 genio I pretty much have to have perl.h open,   perlguts, perlapi, perlxs, and perlcall  open
18:17 jberger I didn't need perlguts that much
18:17 jberger perlcall makes sense because of the callbacks
18:17 jberger PerlGSL::DiffEq needed that too actually
18:26 good_news_everyon joined #mojo
18:26 good_news_everyon [mojo-pg] kraih pushed 1 new commit to master: https://git.io/vNSgL
18:26 good_news_everyon mojo-pg/master ba9e706 Sebastian Riedel: arrayref does not actually work correctly
18:26 good_news_everyon left #mojo
18:28 CandyAngel coolies. I need to learn some at some point.. want to make an XS backend for a module (using Inline::C at the moment)
18:29 good_news_everyon joined #mojo
18:29 good_news_everyon [mojo-pg] kraih pushed 1 new commit to master: https://git.io/vNSgW
18:29 good_news_everyon mojo-pg/master 1385d83 Sebastian Riedel: remove untested scalarref handling
18:29 good_news_everyon left #mojo
18:30 good_news_everyon joined #mojo
18:30 good_news_everyon [mojo-pg] kraih tagged v4.08 at f47f2d1: https://git.io/vNSgi
18:30 good_news_everyon left #mojo
18:30 good_news_everyon joined #mojo
18:30 good_news_everyon [mojo-pg] kraih pushed 1 new commit to master: https://git.io/vNSgP
18:30 good_news_everyon mojo-pg/master 3929ec7 Sebastian Riedel: bump version
18:30 good_news_everyon left #mojo
18:34 trone joined #mojo
18:43 Seth joined #mojo
19:10 anony joined #mojo
19:24 mohawk constantly looking at perlguts is *how* you do XS programming
19:24 mohawk with indeed some help from perlapi
19:24 mohawk and in one case going onto #xs and saying "help, this doesn't make sense"
19:24 mohawk and they said, "yes, that doesn't make sense. try this" (which worked)
19:25 jberger CandyAngel: honestly if you've already got something working with Inline::C, there isn't a TON more to moving to XS
19:25 jberger (IIRC)
19:26 mohawk having done some of both, i agree
19:27 mohawk and genio, from my having fought Gimp.xs, i know how hard that was. massive congrats!
19:46 itaipu joined #mojo
19:54 bwf joined #mojo
20:13 tcohen joined #mojo
20:16 ghenry joined #mojo
20:21 Grinnz Inline::C doesn't generally require using perls macros does it? though you still need a basic understanding of typemaps which the docs go over
20:38 Leffe joined #mojo
20:55 drymaik joined #mojo
20:58 drymaik joined #mojo
21:00 drymaik left #mojo
21:13 polettix joined #mojo
21:13 polettix hello all
21:13 purl It's a crazy world, but hello to you too!
21:19 polettix is RFC7239 “Forwarded HTTP Extension” supported? I tried to do some experiments but it didn’t work, I don’t know if I’m using it the wrong way
21:21 Grinnz polettix: if you set proxy => 1 in hypnotoad, or MOJO_REVERSE_PROXY=1 in env, it will use X-Forwarded-For and X-Forwarded-Proto
21:23 polettix Grinnz: thanks. My impression reading around is that the “standard(ized)” way to do that is to use the “new” (2014) header “Forwarded”
21:28 Grinnz polettix: it's not really useful to support things until enough of the internet supports it, and I don't get the impression that's the case with that header
21:28 Grinnz however, I think it has been proposed to support it before
21:29 Grinnz don't see any issues or PRs about it, maybe just in irc
21:30 polettix yes, I had a look there but to no avail
21:31 polettix I might be missing something, but in simple reverse-proxy cases this might be adopted immediately without waiting for “enough of the internet”, because it boils down to setting the right header in the proxy’s configuration
21:31 dod joined #mojo
21:32 Grinnz http://irclog.perlgeek.de/mojo/2017-01-24#i_13980413
21:32 Grinnz seems to be the last time it was discussed
21:32 polettix I also think it would help to have some more explicit documentation (e.g. in Cookbook?) about the reverse proxy, and the impact of different headers on url_for()
21:32 polettix about 1 year ago :D
21:33 Grinnz yeah, and it's still listed as "proposed standard"
21:34 Grinnz polettix: the cookbook does mention how to use reverse proxy information for hypnotoad, and mentions MOJO_REVERSE_PROXY later in the context of psgi; maybe there could be more, but not sure specifically what
21:35 polettix I don’t know… I was just trying to figure that out and had to play a bit with X-Forwarded-For (ruled out, obviously), Host and X-Forwarded-Proto before getting url_for() work properly. This just by using command-line tests a-la ./app get / -H …
21:36 polettix so it would probably help to have a section specific for reverse proxy
21:36 Grinnz if you're doing commandline tetss, there's no proxy involved?
21:36 polettix eheh of course there will be… and I want(ed) to figure out how it works :D
21:36 Grinnz ah, you mean sending headers as if you were the proxy
21:37 polettix right
21:37 polettix when googling “mojolicious reverse proxy” I get… suboptimal results IMHO
21:37 Grinnz well take a look at the example configuration for a nginx reverse proxy for instance https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Nginx
21:38 Grinnz it lists a bunch of headers to set
21:38 Grinnz (Upgrade and Connection are for websocket support)
21:38 Leffe_ joined #mojo
21:38 polettix yes, that’s where I got the hints for the possible involved headers
21:40 polettix still, it leaves me with a taste of cargo-cult because I don’t really understand what’s going on, not considering that MOJO_REVERSE_PROXY is named only in relation to PSGI
21:41 Grinnz well, if it helps, i use MOJO_REVERSE_PROXY for our morbo setup as well
21:42 Grinnz i think it's definitely under-represented but I havent figured out how to documented it better
21:43 Grinnz if you search the codebase for MOJO_REVERSE_PROXY it might help, it's only used for a couple simple things
21:51 polettix OK, I’ll take a look. In case I think of something, would a PR towards the Cookbook be useful?
21:54 disputin joined #mojo
21:57 Grinnz sure, but when it comes to doc patches you need to keep in mind the most important thing is consistency
21:58 polettix sure. I’ll try not to waste anyone’s time
23:02 Leffe joined #mojo

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