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

IRC log for #mojo, 2013-12-18

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

All times shown according to UTC.

Time Nick Message
00:02 mire__ joined #mojo
00:10 marty joined #mojo
00:20 good_news_everyone joined #mojo
00:20 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/yDCf8Q
00:20 good_news_everyone mojo/master 20435a3 Sebastian Riedel: updated some old documentation
00:20 good_news_everyone left #mojo
00:28 d4rkie joined #mojo
00:33 marty joined #mojo
00:37 d4rkie joined #mojo
00:39 dsteinbrunner joined #mojo
00:45 gryphon joined #mojo
00:48 dvinciguerra_ joined #mojo
00:58 Adurah_ joined #mojo
01:01 asarch joined #mojo
01:02 d4rkie joined #mojo
01:08 laouji joined #mojo
01:17 dsteinbrunner joined #mojo
01:19 zivester joined #mojo
01:40 ka2u joined #mojo
02:06 laouji joined #mojo
02:18 punter joined #mojo
02:39 duncanthrax2 joined #mojo
02:44 klapperl_ joined #mojo
02:49 btyler joined #mojo
02:55 dvinciguerra joined #mojo
03:07 Mad_Dud joined #mojo
03:18 dvinciguerra joined #mojo
04:02 laouji joined #mojo
04:46 * sri adds Mango::Collection::options to make testing easier https://github.com/kraih/mango/commit/39d7c5a3d1671edf4246a8abe0222948892e9e72
04:51 arpadszasz_ joined #mojo
05:00 preflex_ joined #mojo
05:06 beyondcreed joined #mojo
05:12 D4RK-PH0ENiX joined #mojo
05:13 laouji joined #mojo
05:21 ka2u joined #mojo
05:44 d4rkie joined #mojo
05:46 laouji joined #mojo
06:19 arpadszasz_ joined #mojo
06:54 bowtie_ joined #mojo
07:00 themage joined #mojo
07:00 ka2u joined #mojo
07:01 Lee joined #mojo
07:02 Vandal joined #mojo
07:30 dpetrov_ joined #mojo
07:31 BillRuppert joined #mojo
07:52 denis_boyun joined #mojo
08:08 laouji joined #mojo
08:18 migo joined #mojo
08:25 trone joined #mojo
08:39 suy joined #mojo
08:52 mire__ joined #mojo
08:53 salparadise joined #mojo
09:01 alnewkirk joined #mojo
09:02 laouji joined #mojo
09:03 highflying joined #mojo
09:11 nic bpmedley: Does RHEL have the complete perl core, or is it still omitting bits?
09:29 Adura joined #mojo
09:32 denisboyun joined #mojo
09:33 bpmedley nic: I''m not sure.
09:42 stephan48 joined #mojo
10:00 cfedde joined #mojo
10:13 rem_lex|pivo joined #mojo
10:15 stephan48 joined #mojo
10:19 rem_lex|pivo joined #mojo
10:22 dvinciguerra joined #mojo
10:22 fhelmber_ joined #mojo
10:26 dod joined #mojo
10:58 rem_lex joined #mojo
11:36 mire__ joined #mojo
11:40 hrupp joined #mojo
12:20 dsteinbrunner joined #mojo
12:49 kwa joined #mojo
13:00 dod joined #mojo
13:07 aleksey joined #mojo
13:07 aleksey left #mojo
13:09 laouji joined #mojo
13:26 ver joined #mojo
13:26 davido__ joined #mojo
13:34 Tiger joined #mojo
13:38 Tiger Guys, i'm new in mojolicious,  tell me please whether it is possible to check the code changes without restarting mojolicious web daemon?
13:39 jovial_chat Tiger: i don't understand what you're asking
13:39 moritz Tiger: the 'morbo' development server automatically reloads changed code
13:40 Tiger moritz: thanks!
13:46 Tiger moritz: morbo server reload  code if template file changed?
13:50 moritz Tiger: templates aren't strictly code
13:51 moritz Tiger: well, if you change a template file, the change takes effect in the next request
14:01 Tiger moritz: to use morbo it is enough to use only start server with morbo script/myapp? myapp script code is defaultly genegated
14:02 asarch joined #mojo
14:07 moritz Tiger: yes
14:13 Tiger moritz: and, do i need to add some code for enable reloading if code changed? i tried change code in my template and page remained unchanged after reload in browser.
14:16 dvinciguerra joined #mojo
14:17 batman Tiger: the -w switch to morbo tells morbo to watch a directory
14:17 batman but the default is to watch ./templates, ./public and ./lib
14:17 batman i hope you didn't do cd script; morbo app.pl; or something
14:18 batman always stay in the project root folder when running commands
14:20 Tiger batman: thanks a lot, i ran morbo in script directory, then i try ran from root - problem was fixed
14:24 batman :)
14:25 batman i sometimes to cd t/; to rewrite my tests, but i always stay in project root for any other task...
14:28 Lee does -w append to or override the exising defaults?
14:31 batman override
14:31 purl override is enough
14:41 bluescreen joined #mojo
14:47 sh4 joined #mojo
14:49 moritz purl: forget override
14:49 purl moritz: I forgot override
14:49 arpadszasz_ joined #mojo
14:54 btyler joined #mojo
14:57 mire__ joined #mojo
15:07 d4rkie joined #mojo
15:13 bluescreen_ joined #mojo
15:20 gryphon joined #mojo
15:22 bluescreen__ joined #mojo
15:25 PerlNinja joined #mojo
15:25 PerlNinja g'day g'day
15:25 Hellyna joined #mojo
15:27 Hellyna joined #mojo
15:28 PerlNinja not entirely mojolicious related but i'm having a problem getting something to work with Mango. problem is, you can do things like while(my $doc = $cursor->next) { ... } but how does one do this non-blocking? You can append the callback e.g. $cursor->next(sub { ... }) but that only gets you 1 result, how do you approximate the while loop without somehow recursing in your callback
15:32 sri this issue is getting a little frustrating... https://github.com/kraih/mojo/issues/573
15:35 sh4|2 joined #mojo
15:36 bpmedley sri: I'll expand on my comment later, if that's ok.  I'm at work and can't get away right now.
15:38 PerlNinja I'm ambivalent about that issue, never used to_rel since my first time using Mojo... >.>
15:38 DaTa PerlNinja: i'm not really sure, but i guess this should work: http://sprunge.us/CCYD
15:38 PerlNinja d'oh! didn't think of that one
15:39 PerlNinja let me give tha t a shot Mr. DaTa
15:40 PerlNinja hmm looks like the perl I need to use doesn't grok __SUB__
15:41 DaTa PerlNinja: then try this: http://sprunge.us/GTiZ :)
15:41 PerlNinja lol i'd changed it to that just when you linked that
15:43 PerlNinja seems to work.. now the other question, what's better, eventsource or websocket? the goal is to get about 2Mb of JSON data to the browser that's used to move stuff around on a map, and i want it to start right away so streaming it out seems to be an okay idea, but it seems eventsource is fecking slow
15:43 sri DaTa: that example is leaking
15:44 DaTa Darn!
15:45 marty joined #mojo
15:45 PerlNinja so what's the non-blocky way of doing while(my $doc = $cursor->next()) ...
15:46 sri https://github.com/kraih/mango/blob/master/lib/Mango/Cursor.pm#L17
15:46 sri ->all does just that
15:48 sri oh wait, you didn't want recursion... i don't know how to do that
15:48 PerlNinja well, maybe i phrased it wrong in my question, got a head full of snot so i'm not that smart today :/
15:49 abhishekisnot joined #mojo
15:49 PerlNinja I did it with ->all() but that obviously doesn't return results until they're all there, and we're talking anywhere between 50k to 100k records, tends to take a while
15:49 PerlNinja and i was hoping to get rid of said while by streaming it out
15:53 sri http://mojolicio.us/perldoc/Mango/Cursor#limit
15:57 PerlNinja yes, and? I do need to send 50k to 100k records to the browser... chunking it in pieces may be good but.. then we're getting into "this is getting silly complicated" territory... I'll stick to ->all() for now I think :P
15:57 ka2u joined #mojo
16:05 sugar joined #mojo
16:05 dotan__ joined #mojo
16:05 sugar hi\
16:06 sugar guys, how can i do internal redirect in mojolicous?
16:06 sugar like a 'forward' in  dancer
16:07 sugar https://metacpan.org/pod/Dancer#forward
16:07 hummeleBop joined #mojo
16:12 sugar no way?
16:12 purl WAY!
16:13 nicomen sugar: I don't there is an elegant solution to do that, maybe you can explain what you want to do and something else can be applied?
16:14 nicomen for instance, if you are authenticating something, you might want to use a bridge
16:14 nicomen I don't _think_ there is
16:15 PerlNinja monkey patching 4tw...
16:16 PerlNinja patched 2 subs into mango::cursor that do pretty much what all() does except it doesn't push stuff on an array but fires the callback, exits when there's no more documents, doesn't seem to leak any memory... works out I guess
16:16 marty joined #mojo
16:17 marty joined #mojo
16:23 * sri gives up on #573... can't say i didn't try
16:24 fhelmbe__ joined #mojo
16:25 sugar nicomen: thank you, i found another way to solve the problem
16:25 russum joined #mojo
16:25 russum left #mojo
16:31 dotan__ joined #mojo
16:34 maxhq joined #mojo
16:35 nicomen sri: is the base->path relevant in the bug report?
16:39 mire__ joined #mojo
16:39 ravenhall joined #mojo
16:40 sri nicomen: i don't even understand that question
16:40 nicomen in the example in the bug report they set $url->base->path to /xx
16:41 nicomen but I don't get how that affects the output?
16:42 * sri has a headache and is out of that topic now... time for others to step up... https://github.com/kraih/mojo/issues/573
16:42 nicomen hehe ok, I was thinking that base was used like in html <base> and in that case the rel url would yy/zz
16:42 * sri heads off to run his daily 5k
16:42 nicomen ah nice, how fast?
16:43 ravenhall Does anyone have any examples of exception trapping and handling they could share?
16:44 ka2u joined #mojo
16:44 nicomen eval { something_that_might_crash; 1; } or do { print "An aweful thing happened: $@"; }
16:45 ravenhall I guess I meant more like intercepting Mojo::Exception objects and handling them
16:45 nicomen hehe, ok
16:45 nicomen http://search.cpan.org/~mramberg/Mojolicious-4.60/lib/Mojo/Exception.pm isn't that kind of self-explanatory?
16:46 ravenhall on how throw them, sure
16:47 bpmedley ravenhall: https://gist.github.com/brianmed/5790230 <-- Does this still work?
16:47 ravenhall I may just not be looking in the right place in the documentation, but how to trap them (other than in the default exception handling) seems to be an exercise for the reader
16:47 tianon the default exception handling is how to trap them ;)
16:47 nicomen ravenhall: throw is simply a die() call
16:48 tianon there's nothing inheritly magical about Mojo::Exception :)
16:48 tianon *inherently
16:48 nicomen wrap the thing in an eval, Try::Tiny, or make a $SIG{__DIE__} = \&exception_handler
16:50 ravenhall I was hoping to use a hook to trap certain types of exceptions and just log them, and trap other types and give a more user friendly message to the user
16:51 dotan__ joined #mojo
16:51 ravenhall Maybe that's more Exception::Class territory?
16:51 bpmedley ravenhall: Did you see my gist?
16:52 ravenhall ah ok
16:52 nicomen the code doesn't seem to have specific types, only messages
16:52 nicomen ravenhall: yeah
16:52 ravenhall Well I could trap on predictable message types....
16:53 ravenhall err message text
16:53 bpmedley ravenhall: Are you asking for a best practice with exception handling and Mojolicious?
16:54 ravenhall Is there such a beast?
16:55 bpmedley Hrmm.  From what I gather it's personal style, at present.
16:56 ravenhall That's the impression I was getting.. and didn't know if anyone else had run into the need for exception classes
16:57 ravenhall the eval_me sub in your gist would be blocking, correct?
16:57 beyondcreed joined #mojo
16:57 bpmedley I have a Died package that trys to promote string exceptions to blessed exceptions and was hoping to to use it in my Mojo apps.  I'm still working through the kinks.
16:57 bpmedley https://metacpan.org/pod/Died
16:58 ravenhall interesting
16:58 nicomen the good thing about mojo is that it's personal style, the bad thing is that it's personal style ;)
16:58 nicomen just like perl
16:59 nicomen but there is nothing against finding a somewhat good practice way, and either suggesting that or even submitting a merge request with something
17:00 abra joined #mojo
17:06 denis_boyun_ joined #mojo
17:09 maxhq joined #mojo
17:10 kwa ravenhall: sri says that the dispatch chain shouldn't explicitly die from a controller. For occasions where you can't help it (external modules) he implemented hooks to capture exceptions - https://gist.github.com/kraih/6602913
17:10 kwa Home time. Laters.
17:16 nicomen kwa: ah right right, so he makes a global eval inside around_dispatch
17:17 ravenhall kwa: thanks for that!
17:18 nicomen "global" in a route context..
17:18 russum joined #mojo
17:45 mire__ joined #mojo
17:54 ka2u joined #mojo
18:05 sri nicomen: 25m
18:07 russum left #mojo
18:16 dotan__ joined #mojo
18:32 beyondcreed joined #mojo
18:39 arpadszasz_ joined #mojo
18:43 basiliscos joined #mojo
18:48 russum joined #mojo
18:53 beyondcreed joined #mojo
19:09 russum left #mojo
19:09 Mike-PerlRecruiter_ joined #mojo
19:34 russum joined #mojo
19:40 mire__ joined #mojo
19:41 russum left #mojo
19:47 sri oh, this is quite a bit nicer than json patch http://tools.ietf.org/html/draft-ietf-appsawg-json-merge-patch-02
19:48 davido_ joined #mojo
19:53 jovial_chat it's a nice use of PATCH
19:53 jovial_chat i wonder if there are any different solutions in common use, i'm pretty sure this is what we use already
19:54 sri http://tools.ietf.org/html/rfc6902
19:55 cfedde April 2013.. why not April 1?
19:58 mire__ joined #mojo
19:58 russum joined #mojo
20:11 russum left #mojo
20:20 ravenhall left #mojo
20:51 cooper joined #mojo
21:17 meshl joined #mojo
21:28 malikai looking at Mojo::Transaction::WebSocket, it doesn't look like there's a $ws->send(something => 'data', sub { my ($status,$err) = @_; }); equivalent.. do we not need that in case the client/server goes away quietly?
21:29 trone joined #mojo
21:49 vel joined #mojo
21:52 vel joined #mojo
22:08 marcus sri: Seen https://github.com/mileszs/ack.vim ?
22:09 purl I haven't seen 'https://github.com/mileszs/ack.vim', marcus
22:09 marcus purl: diaf
22:09 purl well, diaf is Die in a Fire
22:09 * marcus pats purl
22:09 purl how condescending
22:09 sri marcus: of course, not good enough
22:10 sri TM2 4 LIFE!
22:10 marcus sri: ok. :) I think I will start using it
22:19 Adura What's TM2 this gen...
22:19 Adura Dragon Claw.
22:24 dvinciguerra joined #mojo
22:54 bluescreen_ joined #mojo
23:13 rem_lex|pivo joined #mojo

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