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

IRC log for #mojo, 2016-11-18

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

All times shown according to UTC.

Time Nick Message
01:00 jontaylor joined #mojo
01:16 aborazmeh joined #mojo
01:37 Paddi joined #mojo
02:13 asarch joined #mojo
03:37 noganex_ joined #mojo
04:11 dave joined #mojo
04:52 q_gone joined #mojo
05:04 dboehmer joined #mojo
05:45 kivilahtio joined #mojo
05:45 lari joined #mojo
06:08 Paddi joined #mojo
06:14 inokenty-w joined #mojo
06:25 dod joined #mojo
06:28 Vandal15263 joined #mojo
06:55 mbudde joined #mojo
06:57 dod joined #mojo
07:01 dod joined #mojo
07:04 dod joined #mojo
07:16 dod joined #mojo
07:25 Adurah joined #mojo
07:56 Jonis is there a way to set a stash value without using over when routing?
07:58 Jonis badly formed question. so $r->get('/foo')->over( auth => 'module#action' )->to(....); is basically what we use to do per route auth, but it's really harming performance because there's a fair few routes.
07:58 Jonis with auth being a condition on the route
07:58 Jonis the condition stashes the value of auth => and then the ->under verifies the data
08:00 Jonis tried doing ->to('module#action', auth => 'module#action') but it seems the stash value is then not available until the controller?
08:12 AndrewIsh joined #mojo
08:14 Jonis ah, can get it from $self->match->stack in the under
08:24 rshadow joined #mojo
08:29 trone joined #mojo
08:35 cpan_mojo Mojolicious-Plugin-RequestBase-0.3 by MRAMBERG https://metacpan.org/release/MRAMBERG/Mojolicious-Plugin-RequestBase-0.3
08:41 janl joined #mojo
08:50 rshadow joined #mojo
08:53 osfabibisi joined #mojo
09:15 sri if anyone else is interested in a mojo rabbitmq client, comment here ;) https://github.com/inway/mojo-rabbitmq-client
09:22 nic Jonis: Take a look at ::Plugin::Authentication -- it achieves what you want without any of that
09:26 henq joined #mojo
09:34 Jonis Actually removed changed my routes from $r->get(foo)->over(bar)->to(baz) to $r->get(foo)->to(baz, bar) and noticed no change in responsetime.
09:37 Jonis But I found that literally moving $r->get up under the $r->under gave a good increase, and moving the $r->bridge and the $r->route up under $self->routes gave really big gains
09:39 janl Jonis: this souds like a blog posting with very clear examples
09:39 Jonis yeah, maybe I should make one
09:39 Jonis went from 144 req/sec to 180 req/sec by rearranging ->unders and ->routes
09:39 Jonis basically
09:40 nic +1 for a blog post or gist showing before and after
09:41 sri ->over() is very expensive, since it disables the routing cache
09:41 Jonis I'll see if I can hammer out a lite app that reproduces this
09:42 nic doing it inside a test file might be quicker/more fruitful
09:44 rshadow joined #mojo
09:52 rshadow joined #mojo
09:53 marcus joined #mojo
10:01 alexbyk joined #mojo
10:03 Jonis turns out there was a bit of pebkac, was still one ->over left in the routes
10:03 Jonis thanks for the help guys :)
10:07 jontaylor joined #mojo
10:29 trone joined #mojo
10:29 polettix joined #mojo
10:59 tchaves joined #mojo
11:05 tchaves joined #mojo
11:19 parv joined #mojo
11:31 mib_8gkh05 joined #mojo
11:33 mib_8gkh05 is there a way to do basic auth with the Mojo UA *without* passing the secret as part of the URL? asking because I want to include the url in debug messages and the way things are now I got to juggle 2 different url strings - the "working" one and the "safe to show" one
11:33 mib_8gkh05 ( the endpoint I am talking to is stupid, does not do cookies or anything like that, needs basic auth on every request )
11:44 gregf_ joined #mojo
11:47 janl left #mojo
11:53 mib_8gkh05 hm... I guess I could ask $tx->req->url ...
11:58 CandyAngel Is it just mebor is content_for and content_with the wrong way around
11:58 CandyAngel me or*
11:58 CandyAngel content_for $key sounds like replacing the content for $key
11:59 CandyAngel with sounds like concatenation
11:59 CandyAngel put this content_with $key
12:16 hrupp joined #mojo
12:44 mib_8gkh05 hm... so handling of errors in Mojo::UA, I ended up needing something like http://paste.scsys.co.uk/539802
12:44 mib_8gkh05 that's an awful lot of typing - does Mojo itself provide a canned version of this?
12:46 sri yea, iwant to improve Mojo::UserAgent error handling, but nobody could come up with a good proposal yet
12:46 sri and your code is terrible too ;p
12:47 mib_8gkh05 I wasn't planning on proposing that, I just need something to start with
12:47 mib_8gkh05 are there corner cases that aren't covered, or just stylistically terrible (with which I agree)
12:47 sri well, the official recommendation is in the synopsis
12:49 mib_8gkh05 I see...
12:49 mib_8gkh05 right, in my case I want to dump the body on stderr as well, but I fully see how that's not ok for general use
13:10 sri hahaha, that moment when you google something and find a stack overflow thread from 2011 where jberger asked a similar question
13:18 polettix joined #mojo
13:25 gizmomathboy joined #mojo
13:39 marty joined #mojo
13:44 sri nice, the rabbitmq module has already been updated \o/ https://github.com/inway/mojo-rabbitmq-client
13:44 jontaylor joined #mojo
13:48 jberger Heh. Now I'm curious what the question was
13:50 nic Sometimes it feels like a job in cryptography would be slightly less taxing.  Found that certain characters in a latin1/cp1252 db did not look to be genuine latin1
13:50 parv joined #mojo
13:51 nic Turns out....  [drum roll]...  you need to utf8 decode them from the db, then cp1252 decode them, and then utf8 encode them when writing into a more sane db
13:55 ramortegui joined #mojo
14:00 sri jberger: was reviewing a patch and looking for arguments against this, aside from it looking awkward https://github.com/os-autoinst/openQA/pull/1019/files#diff-1cea6817de0a4b4153258db1540f2ebdL118
14:01 rshadow joined #mojo
14:16 cpan_mojo Mojolicious-Plugin-AssetPack-1.27 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-1.27
14:36 Paddi joined #mojo
14:36 q_gone joined #mojo
14:37 q_gone joined #mojo
14:50 asarch joined #mojo
14:51 polettix joined #mojo
14:52 Jonis how do I debug a callback that's not returning?
14:53 Dandre joined #mojo
14:56 itaipu joined #mojo
14:56 Pyritic joined #mojo
14:59 cpan_mojo Mojolicious-Plugin-OpenAPI-1.06 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-OpenAPI-1.06
14:59 mishanti1 Jonis: https://cdn.meme.am/cache/instances/folder83/500x/73267083.jpg
15:01 Jonis haha
15:02 jberger mishanti1++
15:02 jberger Jonis:
15:03 jberger especially with callbacks, to start out, I use lots of warn 'in <<location>>'
15:04 batman Jonis: if a tree falls in a forest and nobody is......... :P
15:05 sri lol
15:17 sri does perlcritic actually recommend local *sub = sub {}?
15:18 jberger if so then all the more reason to ignore perlcritic
15:18 sri yea, every time someone mentions perlcritic to me it's because of some super weird recommendation it makes :S
15:21 genio depends on what rule set you give it, does it not?
15:33 jberger like all tools/software/whatever, most people only use the defaults
15:33 jberger that's why sane defaults are so important
15:43 gregf_ joined #mojo
15:52 zivester joined #mojo
16:07 haarg i don't think perlcritic suggests anything like that
16:08 haarg and the function templates thing in perlref is for a totally different use case
16:19 disputin joined #mojo
16:30 tyldis Which darkpan solution do people recommend these days?
16:47 rshadow joined #mojo
16:50 rshadow joined #mojo
17:00 coolo sri: https://github.com/os-autoinst/openQA/pull/1016#issuecomment-261583504 - do you of a DB design pattern to solve that?
17:06 polettix joined #mojo
17:12 mishanti1 tyldis: Depends on what you need. My colleagues and I are trying to get https://trepan.pl going. But I guess if you want to host things yourself then Trepan is not what you want.
17:13 mishanti1 tyldis: Pinto is great for self-hosting. The code seems sound and there are not a lot of gotchas that I have run into.
17:25 dod joined #mojo
17:27 FatalNIX joined #mojo
17:28 FatalNIX If I wanted to run something when I close my Mojolicious lite application, is there a simple way to do it?
17:29 preaction FatalNIX: guaranteed? no-possible way to make it not run it?
17:29 pink_mist what does "close my Mojolicious lite" app mean to you?
17:29 FatalNIX like, what if I went into the terminal it was sitting in and sent sigint
17:30 FatalNIX I mean I could trap that
17:30 preaction you can handle sigint
17:30 preaction but what if you sent sigkill?
17:30 FatalNIX but I didn't know if Mojolicious had some shutdown routine that you could hook or something
17:30 FatalNIX to do some cleanup
17:31 pink_mist instantiate an object whose DESTROY method does the cleanup
17:31 FatalNIX sounds like a good idea.
17:32 pink_mist beware of forks though
17:33 FatalNIX yeah..
17:33 preaction you could use DESTROY in your main app class though even
17:33 preaction or END blocks
17:34 preaction but, again, those aren't necessarily guaranteed to be run, so if it's _important_, you likely want to find some external way of dealing with it
17:34 Grinnz you could just put the code after the app->start call
17:34 Grinnz but same caveats
17:50 sri coolo: guess i would just lock the affected tables for the duration of the migration
17:51 sri it's very easy in postgres, not sure about sqlite though
17:52 Grinnz in sqlite you would lock the database as a whole i think
17:53 sri Mojo::Pg::Migrations uses exclusive table locking itself, for the versioning table
17:53 Grinnz exclusive transaction
17:53 coolo sri: the migration runs for days if not weeks
17:53 sri ouch
17:53 Grinnz o_0
17:54 sri coolo: what takes so much time?
17:55 coolo sri: a "du -s images" took 2 1/2 days to output "1.2T"
17:55 sri ah, the file system
17:56 Grinnz yowch
17:56 sri funny how that keeps coming up as the bottleneck all the time
17:57 coolo sri: yeah. "wenn die Post aufhoeren wuerde, anderer Leute Briefe nachzutragen, waeren sie auch schneller"
18:03 Pyritic joined #mojo
18:19 Pyritic joined #mojo
18:45 rshadow joined #mojo
18:46 stryx` joined #mojo
19:13 PryMar56 joined #mojo
19:16 marty_ joined #mojo
19:19 tyldis mishanti1: Yeah, I pretty much want internal mirror, but it could simply be a CPAN-aware proxy. I'll read more on Pinto, but it seems to be a bit over the top on pinning versions... We currently have minicpan and inject a few distros, but it's not very elegant.
19:32 haarg kind of sounds like opan
19:49 dod joined #mojo
19:50 Grinnz yeah that's the sort of thing App::opan is for
19:55 stryx` joined #mojo
20:02 jontaylor joined #mojo
20:24 stryx` joined #mojo
20:32 genio ooh.  I don't hate it http://www.razerzone.com/gaming-systems/razer-blade
20:34 genio expensive though
20:34 genio I don't like the Razer Blade Pro though
20:35 Grinnz I always liked that Razer makes 14" models
20:35 Grinnz gaming laptops are mostly 15.7" and larger
20:35 Grinnz But they're overpriced of course
20:35 Grinnz being razer
20:38 rshadow joined #mojo
20:40 disputin joined #mojo
21:15 rshadow joined #mojo
21:22 sri and they have rather poor international support and battery life
22:09 jontaylor joined #mojo
22:22 sri hahahaha, so i guess apple has QA at all anymore https://twitter.com/luke_dot_js/status/799271787133403136
22:23 Grinnz LOL i just noticed
22:23 Grinnz the touch strip
22:24 sri yea, that's auto correct suggestions for the password you just entered -.-
22:24 laidback_01 joined #mojo
22:24 Grinnz courage
22:38 marty joined #mojo
22:38 jberger LastPass integration on there might be pretty cool
22:39 jberger But I wouldn't think THAT'S how I'd do it ;p
22:39 Grinnz heh
22:43 marty joined #mojo
22:57 henq joined #mojo
23:03 marty_ joined #mojo
23:39 jontaylor joined #mojo
23:50 marty joined #mojo
23:51 gizmomathboy joined #mojo

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