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

IRC log for #mojo, 2015-10-04

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

All times shown according to UTC.

Time Nick Message
00:09 Onigiri joined #mojo
00:19 Repaster joined #mojo
00:27 Adurah joined #mojo
00:27 meshl joined #mojo
00:33 nnutter joined #mojo
00:40 mattastrophe joined #mojo
02:14 aborazmeh joined #mojo
02:27 absolut_todd joined #mojo
02:31 noganex_ joined #mojo
02:39 KimmoNO__ joined #mojo
02:39 Adura_ joined #mojo
03:12 absolut_todd joined #mojo
04:50 absolut_todd joined #mojo
05:02 absolut_todd joined #mojo
05:06 absolut_todd joined #mojo
05:08 absolut_todd joined #mojo
05:18 disputin joined #mojo
05:26 kaare joined #mojo
06:37 dod joined #mojo
06:38 dod joined #mojo
06:43 dod joined #mojo
07:06 panshin joined #mojo
07:09 amon joined #mojo
07:35 panshin joined #mojo
07:40 Vandal joined #mojo
08:21 genio joined #mojo
08:48 meshl joined #mojo
09:04 Mattes joined #mojo
09:28 ladnaV joined #mojo
09:33 gaunt joined #mojo
09:33 Vandal joined #mojo
09:42 sri oh, looks like the http/2 parts of the browser networking book are free now https://www.nginx.com/http2-ebook/
09:43 sri great book
09:45 Lee joined #mojo
09:58 Mattes joined #mojo
10:02 Martin90 joined #mojo
10:08 panshin joined #mojo
10:19 stephen joined #mojo
10:34 panshin joined #mojo
10:39 sh4 joined #mojo
11:24 aborazmeh joined #mojo
11:26 bpmedley http://bmedley.org/minion_ui.mov
11:28 bpmedley https://github.com/brianmed/minion_ui <-- Code is here
11:30 lupi joined #mojo
11:35 asm35 joined #mojo
11:36 asm35 left #mojo
11:42 asm35 joined #mojo
11:46 asm35 left #mojo
12:01 theo joined #mojo
12:18 tencendur joined #mojo
13:04 panshin joined #mojo
13:11 panshin joined #mojo
13:32 kaare joined #mojo
13:48 sri bpmedley: neat
13:48 bpmedley Thanks!
13:49 sri the graphs seem to stutter a bit
13:50 bpmedley Every 3 seconds?
13:50 sri think i'd make a timer update it more often with the old data in the meantime, so it looks better
13:51 bpmedley I see.  So, every 300ms update the graph with old data and every 3s update with new data?  Is that what you mean?
13:51 sri something like that, yea
14:15 aborazmeh joined #mojo
14:25 Martin90 joined #mojo
14:29 ajr_ joined #mojo
14:40 gryphon joined #mojo
14:45 meshl joined #mojo
14:59 Lee joined #mojo
15:15 bpmedley https://github.com/brianmed/minion_ui <-- Updated for smoother graph.  Does anyone have time to give feedback?
15:15 zivester joined #mojo
15:24 Zoffix How do I start it? (what does it expect to be in the db?)
15:25 bpmedley Zoffix: Step one is to change the "plugin" line to reflect your Minion install.  Does that make sense?
15:25 bpmedley Zoffix: https://github.com/brianmed/minion_ui/blob/master/minion_ui.pl#L7
15:26 Zoffix Well, I got Pg => "postgresql:///test?host=localhost&user=zoffix"
15:26 Zoffix Tells me "relation "minion_workers" does not exist"
15:27 bpmedley Hrmm.  Is that the test db on localhost and user zoffix?
15:27 Zoffix Yeah
15:27 Zoffix And it's empty
15:28 Zoffix Oh. "[Sun Oct  4 11:27:31 2015] [error] DBD::Pg::st execute failed: ERROR:  type "json" does not exist"
15:28 Zoffix Ohhhh
15:28 Zoffix My pg might be too old
15:28 bpmedley Perhaps we can try the File backend?
15:31 PryMar56 joined #mojo
15:33 * Zoffix shudders at <center>
15:34 bpmedley Gaw.  Patches, cull cutting welcome.. ;)
15:34 bpmedley The File backend worked for me - did it work for you?
15:35 Zoffix Yeah
15:36 Zoffix Or rather "maybe"... I see the pretty graphs, but they're lying flat. I'm not following how to make new jobs and stuff
15:36 bpmedley Zoffix: Do you have a worker running with defined tasks?
15:37 Zoffix *shrug* I'll just give up :P
15:37 Zoffix Looks pretty though! :)
15:37 bpmedley Zoffix: Thanks for trying it out!
15:38 Martin90 in full app all routes should be in startup right ?
15:39 bpmedley Martin90: All of mine are
15:39 Zoffix Martin90, I have some plugins that add their own routes: https://github.com/XTaTIK/XTaTIK/blob/master/lib/XTaTIK/Plugin/Cart/PayPal.pm#L26
15:40 Martin90 nice, it is a liite bit confusing sice it says: startup method will run once at server start
15:41 dod joined #mojo
15:42 Martin90 so those startup routers must be saved somewhere internally
15:43 bpmedley Martin90: http://mojolicio.us/perldoc/Mojolicious#routes <-- Here I believe.
15:44 Martin90 bpmedley, that's right, thank you ;)
15:45 Martin90 initially I was thinking about one or two global routes, which use placeholder to perform action. Like /:login or /:add_news
15:45 Martin90 but its probably a bad idea
15:46 bpmedley Martin90: Routes allow you to express your app in interesting ways.  Why not embrace the ability to be expressive?
15:47 Martin90 the starting point is mojolicious has different ways to perfom routes
15:47 Martin90 $r->get('/')->to('example#welcome');
15:47 Martin90 is ok
15:47 Martin90 but get '/' => sub {
15:47 Martin90 my $c = shift;
15:48 Martin90 tends to repeat shifts and so on
15:48 Martin90 do you get it ?
15:48 Zoffix no
15:48 Zoffix What do you mean "repeat shifts"?
15:48 bpmedley Martin90: It's difficult to understand without a pastie.
15:48 Martin90 ok one sec
15:49 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Growing
15:49 Martin90 http://paste.scsys.co.uk/499852
15:50 Martin90 That was my initial idea to bypass a lot of gets
15:50 * Zoffix is still confused
15:50 Martin90 sri, yes I am going thru it now...
15:50 bpmedley Martin90: I've found that copying 'n pasting is much faster than trying to put a lot of business logic in one sub.
15:52 Martin90 will I be able to play with mojo + postgresql on windows ?
15:52 Zoffix Martin90, yes, I have an app that does so on 2008 server
15:53 Zoffix Though I first develop it on Linux, because morbo takes forever to restart
15:53 Martin90 Zoffix, I was rather thinking about testing on my home win 7 ;)
15:53 Zoffix Get a real OS :)
15:54 Martin90 heh
15:54 bpmedley Martin90: I've used Mojolicious with Strawberry Perl on Windows 7.  That was a while back, and I have nothing in Production on Windows.
15:55 Martin90 bpmedley, yes I can agree mojo works fine in case of testing on windows 7 and strawerberry perl
15:55 Martin90 Strawberry*
15:57 jberger Martin90: mojo works just fine on Windows
15:57 jberger The only thing that doesn't is hypnotoad
15:57 good_news_everyon joined #mojo
15:57 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vcPhk
15:57 good_news_everyon mojo/master 2c0a855 Sebastian Riedel: use a real list instead
15:57 good_news_everyon left #mojo
15:57 Martin90 so for that routes case, you recommend to just hard code main routes like: $r->get('/login')->to('Login#login'); in startup ?
15:58 sri "hard code" is an odd choice of words
15:58 bpmedley Martin90: https://github.com/brianmed/CallsAbound/blob/master/lib/CallsAbound.pm#L143 <-- This is what I do.
16:00 jberger Martin90: think of the router and its route tree as a property of the app
16:00 Martin90 sri, it may sounds odd, I was really thinking about routes for particular task instead of one dispatch table ;)
16:00 jberger What are "routes for particular task"?
16:00 sri it's the decorator pattern, if you know design patterns
16:01 Martin90 yes I know decorator pattern ;)
16:02 Martin90 jberger, the way that bpmedley shows here https://github.com/brianmed/CallsAbound/blob/master/lib/CallsAbound.pm#L143
16:03 jberger That looks fairly standard to me, but I don't know what you mean about tasks
16:04 jberger Could just be a terminology difference
16:04 Martin90 $r->get('/task')->to('controller#task')
16:05 Martin90 I guess
16:05 jberger The standard terminology is:
16:05 Martin90 I comes from uC background ;)
16:05 jberger $r->get('/path')->to('controller#action')
16:06 bpmedley Martin90: I think you'll enjoy the separation of business logic and app structure that routes allow.
16:06 dod1 joined #mojo
16:07 jberger Depending on how restful you are thinking, path could also be called resource
16:08 Martin90 I hope so, I first touched mojolicious year ago but didn't had enough time to do something in it, now I am going to test it a little deeper. Maybe write small cms who know ;)
16:08 jberger Anyway terminology aside, that kind of set of route definitions looks standard to me
16:09 jberger Sometimes if you want to group them you could make methods which build parts of the router
16:10 jberger sub setup_foo_routes { ... }
16:10 jberger And call those from startup
16:10 jberger Or even from a plugin
16:11 Martin90 mhm
16:11 jberger A plugin's register method is basically just abstracting out part of a startup method for reuse
16:12 Martin90 ok thanks
16:15 Martin90 hmm why is that POD renderer included in lite and full app from start?
16:17 Martin90 ahh for /perldoc ok
16:18 sri are you using an old version?
16:18 sri there is supposed to be a comment
16:22 Martin90 I use older one but it's ok
16:22 Martin90 I somehow missed that comment, sorry
16:22 sri using old versions will make it a lot harder for people to help you
16:24 Martin90 update or install new one ?
16:25 bpmedley Martin90: cpanm has worked well for me
16:28 Martin90 so just install new cpan version ?
16:29 bpmedley Martin90: What I'm trying to say is that under the assumption that I'm using a supported Perl version, then I have no issues upgrading.
16:29 sri i run "cpan-outdated | cpanm" regularly
16:30 sri with my perlbrew perls
16:34 Martin90 Successfully installed Mojolicious-6.22 (upgraded from 5.13)
16:34 Martin90 \o/
16:35 Martin90 6.22 wow ;p
16:35 sri only 625 lines of changes https://github.com/kraih/mojo/blob/master/Changes#L625
16:37 Martin90 haha, you should rather say only 625 lines in changelog :P
16:39 sri https://github.com/kraih/mojo/compare/v5.13...master
16:39 sri Showing  274 changed files  with 3,563 additions and 2,615 deletions.
16:41 Martin90 great, although I see all those people complaining about too many changes...
16:42 bpmedley Martin90: IMO, the changes are all the awesome.
16:42 Zoffix Martin90, we've got a guide: https://github.com/kraih/mojo/wiki/Upgrading
16:42 sri if you want no changes ever, then catalyst might be a better choice
16:43 Zoffix :P
16:43 Martin90 heh
16:44 Martin90 Zoffix, thanks but I did "cpan Mojolicious" and it seems like it updates all for me
16:45 Zoffix Martin90, the guide I linked to is for any existing Mojo-based codebases you had.
16:46 Martin90 in case I changed something internally right ?
16:47 sri hmm, anyone happen to run openbsd?
16:47 sri got 4 of these reports http://www.cpantesters.org/cpan/report/205f4c64-6a06-11e5-adab-f64dcfe82091
16:47 stephen joined #mojo
16:48 sri would be nice to know what's going on there, seems to only affect perl 5.14
18:12 BinGOs sri: wstat 139 is a SEGV
18:15 BinGOs all the other OpenBSD (apart from the 5.5) are the same box http://www.cpantesters.org/distro/M/Mojolicious.html#Mojolicious-6.22?grade=1&perlmat=2&patches=2&oncpan=2&distmat=2&perlver=ALL&osname=openbsd&version=6.22
18:16 sri oh :(
18:16 BinGOs that box is currently doing a run of "ocsygen: Smoking v5.14.2 built for OpenBSD.amd64-openbsd-thread-multi 5.7"
18:17 BinGOs it runs a backwards through all the perl versions from v5.22.0 to v5.8.9
18:18 thowe that reminds me...  I need to kill this debian setup and go back to OpenBSD...
18:18 sri it's a very harmless test https://github.com/kraih/mojo/blob/master/t/mojolicious/pod_renderer_lite_app.t
18:19 sri i wonder if it has anything to do with one of the pod files being too big or so?
18:21 sri we basically just hand off work to Pod::Simple
18:21 sri which seems to pass all its tests on openbsd at least
18:22 BinGOs I have a x64 5.6 OpenBSD vm and a x86 5.7 OpenBSD vm on my dev box so if I get a chance I could see if I can reproduce it on them.
18:23 sri this appears to be the one causing it https://github.com/kraih/mojo/blob/master/t/mojolicious/pod_renderer_lite_app.t#L54
18:24 BinGOs it may well be a v5.14.x + OpenBSD thing. We'd have to wait to see what the smoker makes of it when it gets to v5.12.x series of perls.
18:25 BinGOs I've been suspicious of v5.14.x ever since I couldn't get a viable x64 build of it with Sun Studio on Solaris.
18:46 Mattes joined #mojo
18:58 Lee joined #mojo
19:08 panshin joined #mojo
19:26 dod joined #mojo
19:48 panshin joined #mojo
20:09 tencendur joined #mojo
20:21 asarch joined #mojo
20:24 asarch One stupid question: as far I understand: | Web server |----HTTP--->| Web browser client |, but in the REST technology: | REST web server |---HTTP--->| REST web client |?
20:24 Martin90 joined #mojo
20:25 bpmedley asarch: Would you like a specific example?
20:26 asarch I mean, do you have to write two different applications (one for the server and the other one for the client) if you want to fully support REST?
20:26 bpmedley asarch: No
20:27 asarch Thank you bpmedley
20:27 bpmedley I may be confusing your question, though.  Perhaps a concrete Lite app would help?
20:27 asarch Thank you very much :-)
20:28 bpmedley asarch: If understand correclty, hopefully users will write the client apps and/or your website will be its own consumer of the REST API.
20:52 sri who writes what has absolutely no relevance
20:52 preaction me!
20:52 sri REST is an architectural pattern
20:57 ajr_ joined #mojo
21:00 mattastrophe joined #mojo
21:31 jwang joined #mojo
22:00 * sri still doesn't like route conditions much
22:00 sri i feel like there has to be a better alternative
22:01 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Adding-conditions
22:04 Martin90 Conditions or adding own conditions ?
22:04 sri the concept
22:05 Martin90 Hmm conditions such as headers, agent, etc sound reasonable to me
22:07 sri the plug system in phoenix seems more elegant to me http://www.phoenixframework.org/docs/understanding-plug
22:08 sri of course it applies at a different time
22:08 sri it's more of a pluggable under system
22:09 Martin90 are you satisfied about placeholders ?
22:09 sri ?
22:11 Martin90 The idea is great but I was a little bit confused about i.e this: if you do lets say $r->get('/index')
22:12 Martin90 it works ok for /index but fail in case of /index/ and I can't see simple way to get around it
22:12 sri umm
22:13 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Routes
22:13 Martin90 maybe that was bad example
22:20 Martin90 the only disadvantage of those condition that I see is they tends to produce complicated code
22:20 Martin90 phoenix has it more 'readable' i would say
22:20 sri there is a lot more to it
22:21 sri incompatibility with non-blocking operations for example
22:21 Martin90 uu that one is huge
22:22 Martin90 I work with mojo for two days, didn't tested it yet..
22:23 Martin90 test*
22:24 bpmedley sri: I haven't used conditions very much.  Would it make sense to have a "condition" method like "helper"?  The "condition" would only work for a route and would receive a controller object.  Returning 1 would satisfy the condition and anything else would not.
22:25 sri bpmedley: that doesn't help with non-blocking operations at all
22:27 bpmedley Hrmm.  Understood, I'll try and look at the code more.  Time may not be on my side on this one.
23:14 meshl joined #mojo
23:48 bpmedley http://liveperl.us/ <-- Sorry about the downtime
23:49 bc547_ joined #mojo
23:50 Zoffix bpmedley++ pretty cool
23:50 bpmedley Thanks

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