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

IRC log for #mojo, 2016-12-11

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

All times shown according to UTC.

Time Nick Message
00:04 Pierre joined #mojo
01:39 mishanti1 jberger , marcus : Thanks for the input. The endpoints that need to be quick are pretty decent speedwise now. Down to a handful ms, and now it is mostly about being able to hold enough connections open.
01:47 Adurah joined #mojo
01:49 mishanti1 After a couple of rounds of tuning we are at a point where our datastores are chooching along just fine, but we are able to max out web nodes (mojo) cpu-wise.
01:54 mishanti1 Even thogh I do enjoy working with Linux, I do miss FreeBSD for performance.
01:55 mishanti1 s/thogh/though/
02:08 Adura joined #mojo
02:21 Pierre joined #mojo
03:02 asarch joined #mojo
03:13 noganex_ joined #mojo
03:29 Pierre joined #mojo
05:04 asarch joined #mojo
05:04 dboehmer_ joined #mojo
05:05 Pierre joined #mojo
05:20 jontaylor joined #mojo
06:45 Vandal15263 joined #mojo
07:08 Pierre joined #mojo
07:14 crab joined #mojo
07:23 polettix joined #mojo
07:28 dod joined #mojo
07:32 dod joined #mojo
07:41 khfeng joined #mojo
07:48 dotan_convos joined #mojo
07:57 kaare joined #mojo
07:58 crab joined #mojo
08:38 polettix joined #mojo
09:04 jontaylor joined #mojo
09:06 Dandre joined #mojo
09:25 dod joined #mojo
10:41 cpan_mojo Mojolicious-Plugin-OpenAPI-1.07 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-OpenAPI-1.07
10:49 mrErikss1n Hey folks, I'm looking for a way to return from an action and allow the rest of the dispatch chain to be processed. But I've been unable to find a way to do this. Closes I've come is ->continue, but that doesn't seem to be what I'm looking for. Anyone got any ideas?
10:55 batman mrErikss1n: i don't follow... an action is the end of a dispatch chain.
10:58 mrErikss1n I might be using the wrong terminology. What I'm looking for is a way to have an action return, if it decides that it can't render the response, and hope that a route further down the list might do a better job.
11:00 mrErikss1n Basically, I've got some wildcard placeholders that collides in some special situations
11:16 sri we don't have that feature
11:19 sri thinking about it a bit, the feature could totally be added, even in multiple ways
11:20 sri but we'd need good use cases and someone willing to implement it
11:20 mrErikss1n That's probably why I can't find it then :-)
11:20 mrErikss1n I've got the use case but I'm too much of a newbie to implement it
11:21 sri one way would be to extend $c->match->stack with another level, and search all possible additional routes up front, and then have maybe a flag that allows moving on to the next route
11:22 mrErikss1n Wouldn't that add a pretty hefty overhead if there are many routes?
11:22 sri another would be to have the same flag, but only search again for another route after dispatching to the current stack
11:22 sri mrErikss1n: yes, the first solution would be slower
11:23 sri the second would be faster, and it would be possible to change request data, like the method, before searching again, but would be much less introspectable
11:23 coolo mrErikss1n: can't you call another controller function instead of returning? actions are just functions after all
11:25 mrErikss1n coolo: You mean if the action decides it can't handle the request, I'd call the action of the match-all route instead? (which is where I would really want it to end up if the first one doesn't match)
11:25 sri or you put the shared logic into a helper
11:27 mrErikss1n sri: I was thinking about that too. But I'm not sure what the major benefit would be to having it in a helper instead of just calling a "normal" function
11:28 Pierre joined #mojo
11:32 polettix joined #mojo
11:32 coolo mrErikss1n: let's agree on helper function then :)
11:32 mrErikss1n Hah, ok then :)
11:33 coolo helpers have the charm that they are available in all controllers
11:35 mrErikss1n Yeah, but I still need to call them via $self->helpers-myfunc(), right? So it wouldn't be to far fetched doing my::superduper::func() either
11:36 mrErikss1n I'm pretty new to perl and mojo, so I'm probably overlooking some obvious stuff here
11:41 sri my::superduper::func($self) is considered more ugly than $self->helpers-myfunc()
11:41 mrErikss1n sri: That's a perfectly acceptable reason
11:42 mrErikss1n Anyways, helper it is. Thanks guys, for your input!
11:43 sri btw. http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Adding-a-plugin-to-your-application
11:43 sri for organizing those helpers
11:47 mrErikss1n Thanks
12:17 RustyPerl joined #mojo
12:17 RustyPerl Hi guys
12:18 RustyPerl I'm little rusty in mojolicious, tried to google but returned tons of unrelated result. How do I do a one-liner of <%= ( $a == $b) ? "print this" : "print that" %> in mojo template
12:19 RustyPerl I could do a multi-liner, but that's overkill for a simple if..else
12:35 sri just like that
12:36 RustyPerl oh thank @sri, I tried that but didn't work just now... maybe a typos somewhere, thanks
13:19 karjala I'm having a little problem with $c->render_to_string - it outputs to log (or maybe to STDERR, not sure which) whenever it is called. Is there a way to disable this behaviour?
13:19 karjala Because my cron script renders the emails it sends from templates before sending them - and I get annoying entries in the log
13:20 karjala I'm not sure this information is interesting enough to be logged
13:20 karjala even
13:23 [vlad] something to do with putting 2>&1 after your cron entry?
13:24 [vlad] 1>/dev/null 2>/dev/null
13:24 [vlad] or 2>&1 /dev/null i think
13:26 karjala I've tied STDERR to a mojo $log, to catch errors & warnings
13:26 karjala and I get this entry as well, which I don't want
13:26 pink_mist [vlad]: you mean &> /dev/null
13:27 pink_mist or > /dev/null 2>&1
13:28 pink_mist oh wait, I'm wrong on the second one
13:28 abra joined #mojo
13:28 asarch joined #mojo
13:28 pink_mist 2>&1 >/dev/null
13:29 pink_mist hmm, no, I was right the first time (gah, this is why I never do that and simply use the &> /dev/null version)
13:32 karjala grr
13:33 karjala doesn't anyone else dislike the log entries by render_to_string?
13:46 sri karjala: it doesn't do that
13:48 karjala to me it logs with level=debug. It says: [Sun Dec 11 13:39:04 2016] [debug] Rendering template "email/new_release.html.ep"
13:48 karjala I fixed it by setting the $app->log->level('fatal')
13:49 karjala Maybe I'm doing something wrong
13:49 sri oh, you mean the name of the file it rendered
13:49 karjala ah yes
13:51 dotan_convos joined #mojo
13:51 karjala no need to change it, sri, i fixed it.
13:51 karjala for myself
13:52 sri i wouldn't have changed aything anyway ;p
13:55 karjala is there a way to disable logging of the $app? setting $app->log(undef) causes the script to crash (can't print to undef)
13:55 karjala maybe if i logged to /dev/null
13:56 karjala ok
14:23 sh14 joined #mojo
14:23 abra_ joined #mojo
15:16 abra joined #mojo
15:41 juikuen joined #mojo
15:49 RustyPerl joined #mojo
16:34 Dandre joined #mojo
16:34 jontaylor joined #mojo
16:44 CandyAngel left #mojo
16:54 sri argh
16:55 * sri just dropped his razer keyboard and stuff broke off :(
16:58 sri definitely a fragile keyboard
17:02 tyldis Apart from keys, what the heck can break off a keyboard?
17:03 sri it's one of these http://assets.razerzone.com/eeimages/products/24325/razer-blackwidow-x-chroma-lifestyle-1.jpg
17:03 sri yea, the switches can break off the base
17:06 pink_mist heh, a friend of mine was about to replace his old broken keyboard by buying one of those
17:06 pink_mist but then his old one suddenly started working again
17:07 pink_mist (it had suffered some water damage)
17:07 [vlad] whats cool about them?
17:08 tyldis Oh, that is nasty. They are totally unprotected from a sideways impact.
17:17 spicyjack joined #mojo
17:50 lluad joined #mojo
17:55 polettix joined #mojo
18:28 PryMar56 joined #mojo
18:33 khfeng_ joined #mojo
20:27 disputin joined #mojo
21:23 [vlad] mst: would i load it with additional_base_classes in Schema::Loader ?
21:23 [vlad] whoops wrong chan
21:32 cpan_mojo Mojo-SQLite-1.003 by DBOOK https://metacpan.org/release/DBOOK/Mojo-SQLite-1.003
21:43 polettix joined #mojo
22:24 mishanti1 sri: Other than the keyboard to being able to withstand you throwing it around, are you happy with it?
22:24 mishanti1 s/to being/not being/
22:26 sri heh, i didn't exactly throw it around, it fell from like a little over a meter height on a soft carpet and stuff broke off
22:26 sri overall, it's pleasant to use
22:28 sri razer green switches are very much like cherry blue with a shorter actuation point
22:29 sri build quality feels good, but there's definitely issues... not just stuff breaking off easily ;p
22:29 sri the aluminium base and glossy plastic parts also scratch easy, like everything razer makes i guess
22:30 mishanti1 I've been curious about the razer switches. How to the caps feel?
22:30 mishanti1 Firm, wobbly?
22:30 mishanti1 s/to/do/
22:30 sri i'd describe them as average for a mechanical keyboard
22:32 sri that said, my daily driver is an apple magic keyboard 2
22:36 sri one thing i didn't expect i would enjoy as much as i did was game specific lighting modes, it's actually quite fun
22:36 sri like have buttons blink once a cooldown is up :)
22:37 sri one of the downsides is that it's not very good without the windows/macos drivers, since the keyboard itself has no storage for lighting modes and the like
22:38 sri so, on linux you get your one lighting mode you configured with windows, and that's it, you can never change colors or effects
22:40 sri oh btw. re "withstand you throwing it around"
22:41 sri it's actually meant to be carried around, i got the so called tournament edition
22:41 sri so i'd expect it to be at least somewhat resilient
22:41 sri but there's no way you can just put it in your backpack with other stuff
22:43 mishanti1 Right. They have in other words made a nice keyboard but failed on the portability side.
22:44 mishanti1 I took a liking to the ducky keyboards, and was pretty mesmerized by the Ducky Shine. Eventually decided that even though it was pretty darn cool, I would probably not use the lighting features at all.
22:45 mishanti1 A soft single-colored backlight would be enough for me I think.
22:45 sri i didin't really think the lighting situation through
22:46 sri since i've mostly used my laptop exclusively for years, my assumption was that i just need backlighting for a desktop keyboard too
22:46 sri but that's just not the case
22:47 sri there's always enough light at the desk to see the keyboard
22:50 mishanti1 Yeah. When I can afford a mechanical keyboard I'll for a doubleshot PBT/POM, and won't really pay much heed to lighting. As you say: there is light by the desk.
22:51 mishanti1 Also: when does one look at the keyboard?
22:51 mishanti1 ( except at 4:39am, after 12 hours of Stuff Not Working (TM) )
22:51 sri regarding looks, the razer is definitely the best looking keyboard i've ever seen http://www.razerzone.com/gaming-keyboards-keypads/razer-blackwidow-x-tournament-edition-chroma
22:52 sri i take my hands off the keyboard a lot, need to be able to see at least the outline when i start typing again
22:54 sri although, recently i've switched a lot between very different keyboards, so it's hard to develop muscle memory
23:00 mishanti1 My mm on this keyboard is pretty good, seeing as I use the same brand/model keyboard at home and at the office. US$11, and yes, you get what you pay for.
23:01 mishanti1 Oh dear. It has risen in price. Now US$17.
23:01 mishanti1 http://www.clasohlson.com/no/Tastatur/38-7249
23:25 nicomen joined #mojo

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