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

IRC log for #mojo, 2014-11-08

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

All times shown according to UTC.

Time Nick Message
00:01 hoppie Cannot understand why Perl is not compiled with threads on Solaris 11.2.
00:02 bpmedley http://pastie.org/9703938  <— Latest
00:04 jberger_ Try without render later
00:04 jberger_ I'm not at a computer atm btw
00:06 bpmedley http://pastie.org/9703944  <— Works!!
00:06 hoppie sri: Net-DNS-Native-0.11 is not passing with Perl 5.16.x (imo)
00:07 bpmedley I removed the render_later; got an error message… then added the render in the callback
00:08 jberger_ But that defeats the purpose
00:08 jberger_ What is the error without render later
00:08 bpmedley Oh, hrmm.  My ignorance is pretty high.  One sec.
00:09 jberger_ Nonblocking is hard. Let's go eat sushi
00:11 * jberger_ goes to eat sushi
00:11 bpmedley http://pastie.org/9703950  <— This works; no render_later and return undef.
00:11 hasan bpmedley: why render_later at all?
00:12 bpmedley hasan: I’m not 100% sure when to use that.
00:12 hasan if this is a bridge and all it does is to return either true or false, why should I render at all?
00:12 sri hoppie: i'm sure oleg would appreciate a github issue with your collected data
00:12 sri https://github.com/olegwtf/p5-Net-DNS-Native/issues
00:13 hasan bpmedley: so the latest version compared to first version was the ua object
00:13 bpmedley I’d have to look.  Can you just diff them?
00:14 hasan in first version you initiated a new Mojo::UserAgent obj. in this one, you use the $c->ua
00:14 jberger_ render later prevents automatic rendering
00:14 hasan bpmedley: Im telling from memory.
00:14 jberger_ Which is an issue in the endpoints
00:14 bpmedley Right.  And the $ua would go out of scope.
00:14 hasan jberger_: yes, but the under sub is not supposed to render anything right?
00:14 jberger_ In a bridge it just confuses things
00:15 hasan jberger_: yes
00:15 bpmedley hasan: The latest version does not render in the under.  Over.  Under.
00:15 hasan I see.
00:15 hasan this looks good and I will implement this.
00:15 hasan thank you.
00:16 bpmedley You’re welcome.  That was an unexpeced excursion.
00:16 hasan it was fun.
00:17 bpmedley https://gist.github.com/brianmed/af56c0b5fe5ca30e094f <— For posterity
00:18 hasan ah. just pasted in a plain text file.
00:18 hasan good timing :)
00:24 good_news_everyon joined #mojo
00:24 good_news_everyon [mojo] kraih tagged v5.59 at 27f9b39: http://git.io/wXHJXg
00:24 good_news_everyon left #mojo
00:25 genio ls
00:26 bpmedley https://gist.github.com/brianmed/0e73292da11940a95b98  <— Anyone find this handy?  It will auto update a timestamp column in postgres on update/insert.
00:26 good_news_everyon joined #mojo
00:26 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/EhQ7Qw
00:26 good_news_everyon mojo/master 2cc909e Sebastian Riedel: bump version
00:26 good_news_everyon left #mojo
00:34 d4rkie joined #mojo
00:44 firnsy joined #mojo
00:52 d4rkie joined #mojo
01:18 good_news_everyon joined #mojo
01:18 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/CYgXow
01:18 good_news_everyon mojo/master 25e63ad Sebastian Riedel: no need to install IO::Socket::IP manually
01:18 good_news_everyon left #mojo
01:21 sri haha http://www.cpantesters.org/cpan/report/73ae0722-66e0-11e4-9ae3-2694dfbfc7aa
01:23 bpmedley_ joined #mojo
01:26 Adura joined #mojo
01:27 hoppie Findings Net-DNS-Native-0.11:  https://gist.github.com/marioroy/9523867fa5c40e4f63bf
01:40 hoppie ohoh, saw 5.59  2014-11-07, released today  - Added support for non-blocking name resolution with Net::DNS::Native.
01:40 hoppie Not sure how that will go, after testing Net-DNS-Native-0.11.
01:41 sri why?
01:42 hoppie well, for Perl 5.16.x (-1).  Perhaps ok for 5.18.x and later versions.
01:42 sri we actually test back to 5.10 on travis
01:42 hoppie ok.
01:45 sri and it's totally optional, so if it doesn't install mojolicious doesn't have a problem
01:45 sri or am i missing something?
01:45 hoppie ok, was just going to ask that. thx
01:46 hoppie Net-DNS-Native is an optional module that one may install -- is not necessary for Mojolicious?
01:46 sri http://mojolicio.us/perldoc/Mojo/IOLoop#DESCRIPTION
01:48 hoppie nice. well then, going to test on Linux with Perl 5.18.
01:49 hoppie Does the description need a comment about running on Perl 5.18 or later -- that may save folks a lot of frustration if on Perl 5.16 or less.
01:50 sri what do you mean?
01:51 hoppie Net-DNS-Native is not passing with Perl 5.16.x or less, from my findings.
01:51 hoppie Net-DNS-Native-011
01:51 sri your findings are wrong, as i said before
01:52 hoppie make test fails on Mac OS X running Perl 5.16.x (hangs) and then the ran out of file handles error.
01:53 sri https://travis-ci.org/kraih/mojo/jobs/40358963
01:53 sri funny thing is a few tests just failed on travis for other reasons
01:54 hoppie isn't that on a Linux OS. I tested on various BSD VMs.
01:54 sri reactor_ev.t failed on 5.14 and 5.16
01:55 sri very odd... just 30 minutes before everything was fine https://travis-ci.org/kraih/mojo/builds
01:58 hoppie Does travis testing test both with and without Net-DNS-Native-0.11?
01:59 sri oh damn, it doesn't test the modules it installs
02:00 sri but it passed 30 minutes earlier, and there have been no meaningful changes
02:00 sri well, lets see
02:01 good_news_everyon joined #mojo
02:01 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/j3ospw
02:01 good_news_everyon mojo/master cb3b509 Sebastian Riedel: test dependencies
02:01 good_news_everyon left #mojo
02:07 sri all fine again, odd
02:07 sri https://travis-ci.org/kraih/mojo/builds
02:10 hoppie Net-DNS-Native-0.11 reports PASS, even after all the errors. Not sure about this (imo).
02:10 hoppie The hang on OS X is random.
02:11 hoppie Running out of file handles is also random.
02:19 sri running out of file handles is your problem
02:22 hoppie just did a favor to test and reported what I saw. that's all.
02:22 hoppie t/03_segfault.t .. skipped: socketpair(): Too many open files at /Volumes/RAMDisk/shm/Net-DNS-Native-0.11/blib/lib/Net/DNS/Native.pm line 37.
02:22 hoppie Perl 5.16.2 on OS X 10.9.5
02:23 hoppie gcc from most recent command-line-tools.
02:27 KCL_ joined #mojo
02:27 hoppie Does not seem right for arguments $_[1] and $_[2] to be undefined (line 37) during "make test" lib/Net/DNS/Native.pm
02:27 hoppie Only seeing that ^^ with Perl 5.16.x.
02:30 sri i mean it's literally your problem, *you* control the file descriptor limit, Net::DNS::Native can't do anything about it
02:31 hoppie ok. Not only on Mac OS X, but the same error under TrueOS. Will check the limit there.
02:32 sri i'll confirm just to make sure
02:34 hoppie Looking at t/03_segfault.t, (that does 3 x 70 ) and runs out of file handles (default is 256 for Mac OS X).
02:35 sri not a particularly good test
02:35 sri but proves the results were harmless
02:36 hoppie correct. I changed 3 to 2. I ran make test again, it hung, I ctrl-c and ran make test again. Still got /03_segfault.t .. skipped: socketpair(): Too many open files
02:37 hoppie ok, no problem. was only passing on my findings.
02:54 hoppie Perl 5.16.3 on CentOS 7 and Net-DNS-Native is fine otherwise (ignoring the make test output). It survives a fork call.
03:06 hoppie well, the first time I wrote here was about a small script failing. That caused for ticket # 700. That small script is passing with Mojolicious 5.59 and Net-DNS-Native 0.11 and even with Perl 5.16.
03:08 bpmedley https://gist.github.com/brianmed/f9225853acf6189b253a <— Is this worth continuing to work on?
03:08 hoppie Not liking the test scripts in Net-DNS-Native 0.11 though (with all the warnings about undefined args, etc). Thought something is wrong. Putting aside "make test" altogether and went on to the next step.
03:08 bpmedley It’s a DBD::Pg backend for Minion
03:08 sri hoppie: just open issues on github
03:09 sri bpmedley: i'm working on one too, but based on Mojo::Pg
03:09 bpmedley Perhaps I should just wait?
03:10 sri no promises about when i'll deliver
03:11 bpmedley I could spend some time trying to port to Mojo::Pg
03:12 hoppie yes, will create an issue for Net-DNS-Native. This is now working (original pastie) http://pastie.org/9689667
03:15 d4rkie joined #mojo
03:21 da5id joined #mojo
03:27 hoppie done.
03:33 jberger sri: why is this -w? https://github.com/kraih/mojo/blob/358eb239efea702a25c6bdc06e05b4b8a426e281/lib/Mojo.pm#L35
03:34 jberger I just had an app die because I have a file called log in my working directory
03:39 jberger indeed I would think it should be: -w $home->rel_dir('mojo')
03:40 preaction wouldn't you want to check the log file itself to see if it was writable, then if it doesn't exist, check to see if you can create it by writing to the directory?
03:43 * jberger is code spelunking
03:45 jberger goes back to 2009: https://github.com/kraih/mojo/commit/de1a03ce5c514ccceb92c0d40668f941e29a03cb
03:48 jwang joined #mojo
03:57 * sri is still terrified by these two identical but somewhat random fails https://travis-ci.org/kraih/mojo/builds/40358957
04:05 hasan joined #mojo
04:05 hasan do I see right that this module is not providing error handling of DBD::Pg?
04:05 hasan http://cpansearch.perl.org/src/ROMANENKO/Mojolicious-Plugin-PgAsync-0.03/lib/Mojolicious/Plugin/PgAsync/Db.pm
04:44 basic6 joined #mojo
04:55 hoppie sri: getting segfault when using threads. also have $ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll'; in BEGIN block. I believed this was worker before.
04:56 hoppie Have been testing with/without threads and MCE. Will put together a test script (without MCE), but using threads.
04:56 hoppie s/worker/working/ before
05:11 hoppie Running with threads and segfault is coming from Net-DNS-Native-0.11. No segfault from 0.10.
05:13 hoppie Segfault is during exiting.
05:50 hoppie Creating another issue for Net-DNS-Native-0.11 with test script: Perl 5.16.3 on CentOS 7: https://gist.github.com/marioroy/262ae81b1f5c4a7479ac
05:52 Oleg joined #mojo
05:52 hoppie hi Oleg
05:53 Oleg hi
05:53 hoppie created 2 issues https://github.com/olegwtf/p5-Net-DNS-Native
05:54 Oleg thanks, will see
05:56 hoppie It's 1:00 a.m. here. I'm going to sleep. Do you want another script (MCE - driven though), segfaults with 0.11, but not 0.12.  Using the same 2 URLs.  Will attached to the same gist.
05:56 hoppie Oops, segfaults with 0.11, but not 0.10
05:57 Oleg yes, please
05:58 hoppie ok, will do. btw, I'm not able to reproduce the "random" segfault during make test on Mac OS X (Perl 5.16.3). However, the MCE script always segfaults when running workers as threads.
06:06 hoppie The gist contains both threads.pl (hangs) and mce_threads.pl (segfaults) at https://gist.github.com/marioroy/262ae81b1f5c4a7479ac
06:08 Vytas joined #mojo
06:09 Oleg ok, and how you tested with 0.10 if mojo requires 0.11? just edited it?
06:10 hoppie I manually install 0.10 by running perl Makefile.PL and make install.
06:11 Oleg but mojo will not use it then. It requires 0.11
06:11 hoppie Mojolicious 5.59 is already installed.
06:11 Oleg https://metacpan.org/source/SRI/Mojolicious-5.59/lib/Mojo/IOLoop/Client.pm#L13
06:12 hoppie ah. I need to fine the location and edit. Do you know where the check is?
06:12 hoppie thanks
06:12 hoppie will try 0.10 again.
06:15 hoppie segfaults with threads.pl
06:15 Oleg ok
06:19 hoppie have to go now
06:23 da5id joined #mojo
06:24 hoppie Oleg: btw; 0.11 works fine when the app is not using threads (tested with Perl 5.16.3).  Maybe ok, but not liking all the warnings during "make test" (seen with Perl < 5.18).
06:58 rem_lex|pivo joined #mojo
07:03 chansen joined #mojo
07:16 irq joined #mojo
07:50 amon joined #mojo
08:13 Vandal joined #mojo
08:32 sh4 joined #mojo
09:24 denis_boyun joined #mojo
09:24 Oleg joined #mojo
09:46 basiliscos joined #mojo
09:49 Eke- joined #mojo
10:02 denis_boyun_ joined #mojo
10:04 denis_boyun joined #mojo
10:30 jwang joined #mojo
10:56 d4rkie joined #mojo
10:56 d4rkie joined #mojo
11:13 d4rkie joined #mojo
11:13 d4rkie joined #mojo
11:29 d4rkie joined #mojo
11:49 alnewkirk joined #mojo
11:50 hoppie joined #mojo
11:50 Eke- joined #mojo
11:54 hoppie Oleg, interesting... Looks like preprocessor directives should be at the start of the line.
11:55 Oleg windows failed without this
11:57 hoppie will remember that
11:59 hoppie @fh = ();   ...   boy, did not catch that at all
12:00 hoppie ah. ah. ah. ah. ...
12:01 hoppie that has happened to me on many occasions
12:02 Oleg yes, it was my @fh inside loop before, and when i added eval {} i forgot about @fh reinitalization
12:04 hoppie downloading 0.12
12:05 marcus joined #mojo
12:05 marcus o/
12:07 hoppie Oleg: Perl 5.16.3 said \o/ during make test
12:07 d4rkie joined #mojo
12:07 Oleg said what?
12:07 hoppie happy \o/
12:08 hoppie I imagined Perl a person inside the computer and her name is 5.16.3.  She said thank you. :)
12:08 hoppie make test without warnings.
12:08 sri Oleg: does 03_segfault.t do its job without using 210 file descriptors too?
12:09 hoppie oh, let me test that on OS X. her name is Mavericks.
12:09 sri os x has a default limit of 256, so it can be exhausted pretty easily
12:09 Oleg sri: about 140 now, I think
12:10 * marcus just upgraded to Yosemite
12:10 hoppie Oleg; confirmed working
12:10 hoppie on OS X.
12:10 Oleg good
12:10 hoppie will test the 2 scripts now in Linux threads.pl and mce_threads.pl
12:11 Oleg btw, socketpair() creates 2 file descriptors. So for 70 localhost resolving this will be 140 + getaddrinfo may create descriptors for it needs
12:12 hoppie ok, had thought about how many last night (or early morning). forgot to ask. thanks.
12:13 hoppie Oleg: confirmed (both) threads.pl and mce_threads.pl passing with 0.12.
12:13 hoppie \o/ :)
12:13 Oleg super
12:14 sri Oleg++
12:14 sri hoppie++
12:15 hoppie Oleg. are u going to make a 0.13 so the minimum version is 0.13 across the board.  The reason I'm asking is seeing the last commit after releasing 0.12.
12:16 sri hoppie: https://github.com/olegwtf/p5-Net-DNS-Native/tree/0.12
12:17 Oleg now, this commit already included in 0.12. I remembered about windows problem after "bump" commit and fixed it before release
12:17 Oleg s/now/no/
12:18 hoppie awesome. shutting down my simulation engine... :)
12:18 hoppie Oleg++
12:18 rawler joined #mojo
12:18 sri looks like nothing went terribly wrong with mojolicious 5.59 on cpan testers yet either http://www.cpantesters.org/distro/M/Mojolicious.html?oncpan=1&amp;distmat=1&amp;version=5.59
12:19 sri just the damn random travis fail still keeps me nervous
12:19 Oleg because nobody has NDN installed :)
12:19 dod joined #mojo
12:19 sri Oleg: well, actually http://www.cpantesters.org/cpan/report/2c7f71d8-66e0-11e4-b135-0394dfbfc7aa
12:19 sri ;p
12:19 hoppie that made me laugh... thanks.
12:20 Oleg sri: where this warnings comes from? The only check is in Makefile.PL
12:20 sri don't ask me
12:22 Oleg This check was moved to Makefile.PL since 0.09:  https://metacpan.org/changes/distribution/Net-DNS-Native#L17
12:22 Oleg So, how use 0.11 loaded 0.09. Hmm
12:24 denis_boyun joined #mojo
12:31 irq joined #mojo
12:36 Oleg btw, this tester is very strange. Have other unbelievable fails from him
12:40 hoppie sri: will installing Net-DNS-Native-0.12 in travis help stop the random fails?
12:47 Eke- joined #mojo
12:48 hoppie sri: in case forgotten: https://github.com/kraih/mojo/blob/master/lib/Mojo/IOLoop/Client.pm#L13  s/11/12/
13:03 maze joined #mojo
13:04 jberger I'm fairly certain that some of the tester boxes queue dust versions to treat upon release, test those when they have a chance, but then report them as if they were using the newest version
13:04 jberger s/dust/dist/
13:05 jberger s/treat/test/
13:05 jberger I need to stop irc-ing before having coffee
13:13 good_news_everyon joined #mojo
13:13 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/H3_9iw
13:13 good_news_everyon mojo/master 3d10668 Sebastian Riedel: updated Net::DNS::Native requirement to 0.12 for some important bug fixes
13:13 good_news_everyon left #mojo
13:19 sri this is odd, the net_dns_native branch had a similar test failure 3 days ago https://travis-ci.org/kraih/mojo/builds/39948680
13:19 sri and the actual change was to test on travis without Net::DNS::Native Oo
13:19 sri https://github.com/kraih/mojo/compare/2a127c448df0...6db381292a7b
13:21 sri wonder what makes this test case special https://github.com/kraih/mojo/blob/master/t/mojo/reactor_ev.t#L237
13:22 sri i suspect it has something to do with IO::Socket::IP and EV
13:24 sri i've been running this for hours though, and not seen anything while true; do TEST_EV=1 prove -l t/mojo/reactor_ev.t ; done
13:24 sri (on os x yosemite)
13:43 dvinciguerra joined #mojo
13:44 da5id joined #mojo
13:46 Oleg sri: maybe because of this timer after 1 sec?
13:58 jamesaxl joined #mojo
14:00 neyasov joined #mojo
14:00 sri Oleg: hmm, perhaps
14:01 sri although, reactor_poll.t has the same test
14:04 jamesaxl joined #mojo
14:18 good_news_everyon joined #mojo
14:18 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/0OnBOw
14:18 good_news_everyon mojo/master 51b5de5 Sebastian Riedel: the timer is not necessary anymore
14:18 good_news_everyon left #mojo
14:18 sri wonder if there are more tests that depend on timers
14:18 sri they all should be removed
14:19 sri (i thought they had already been removed years ago)
14:21 jberger I have a test in ForkCall that depends on timers, since I need to be sure that I haven't blocked the process, I set a timer that increments once every 0.1s and the forked process returns in like 0.5 seconds, so I should resonably be able to expect at least a couple increments to have happened, even allowing for ordering etc
14:24 sri i mean tests that depend on a timer stopping the event loop
14:24 jberger oh, ok
14:24 sri which can be quite unreliable depending on how fast/slow the test runs
14:25 jberger timing is hard, lets fix the -w on the log directory check
14:25 jberger :-P
14:25 sri "fix"?
14:25 jberger -d
14:25 jberger and rel_dir
14:26 jberger are there tests for Mojo.pm?
14:27 jberger sri: did you see my message before about the log path check?
14:27 KCL joined #mojo
14:27 jberger I had an app fail to come up because I had a file called log in the working directory
14:27 sri yes, but i have no idea what you expect me to say
14:28 jberger why does Mojo.pm check -w $home->rel_file('log') rather than -d $home->rel_dir('log')
14:28 * sri shrugs
14:28 * jberger works on a patch
14:29 * jberger is trying to figure out where to put a test
14:29 sri i question your research though
14:30 jberger the history spelunking?
14:30 sri you've not mentioned this line https://github.com/kraih/mojo/blob/master/lib/Mojolicious.pm#L174
14:31 jberger oh, bollocks
14:31 jberger I saw 'has log' in Mojo.pm and the setup there
14:31 jberger missed that completely
14:31 Eke- joined #mojo
14:32 sri i wouldn't be surprised if the Mojo.pm line could just be removed
14:32 sri seems like a relic from the distant past
14:32 jberger I would be fine with that, in concept
14:33 jberger except that it is documented, so it would probably need to be deprecated :/
14:34 sri it doesn't appear to have tests
14:35 jberger I agree with "its not a feature without documentation or tests" to a point, but an ancient behavior that is documented is quite a thing to remove without deprecation just because there are no test, the users didn't know there weren't tests
14:35 jberger it looks like a feature from their perspective
14:35 sri what users?
14:36 sri i've never seen anyone use a raw Mojo.pm app
14:36 jberger Mojo is in concept an app base
14:36 sri you're being a bit dramatic
14:36 jberger maybe :-)
14:36 * jberger is only just finally drinking his coffee
14:37 jberger in the end I guess I have no opinion on Mojo.pm choosing a log path
14:37 jberger but I do think that an app shouldn't crash due to the presence of a file called 'log' in the working directory
14:39 good_news_everyon joined #mojo
14:39 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/XacFQg
14:39 good_news_everyon mojo/master 013b95e Sebastian Riedel: Mojo does not need to have a log file
14:39 good_news_everyon left #mojo
14:39 sri of course the -w problem is still yours
14:40 jberger k
14:42 rawler joined #mojo
14:47 good_news_everyon joined #mojo
14:47 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/byqEfg
14:47 good_news_everyon mojo/master b4a2919 Sebastian Riedel: Mojo does not actually need a new method
14:47 good_news_everyon left #mojo
15:01 jberger sri: I can't decide if I think this test is sufficient: http://pastie.org/9705166
15:02 jberger passes without the presence of t/mojolicious/log, fails with it
15:03 jberger my only other idea is to build two tests whose homes are either in a deeper directory or in tempdirs and add a log or a log/
15:03 jberger but that seems like an awful lot of infrastructure for this
15:07 sri what's the full patch for that pastie?
15:08 jberger I was only working on the failing test at first
15:08 jberger one moment
15:08 jberger pulling your changes
15:10 jberger http://pastie.org/9705203
15:10 jberger sri: ^^
15:11 sri what happens if the permissions on the directory are wrong?
15:11 sri like you can't create files in it?
15:11 jberger want it to be -w and -d
15:12 sri you tell me what to do ;p
15:12 sri i imagine the reason for using -w in the first place was log directory with bad permissions
15:13 jberger in that case, to test that, it would need the more elaborate test
15:13 jberger except that it wouldn't work on windows
15:13 jberger hmmmm
15:17 jberger http://pastie.org/9705214
15:17 jberger but I'm not sure how to portably test that
15:19 jberger and I haven't actually even tested the positive side of -d either
15:19 jberger grrrr
15:20 * jberger needs to let the OCD calm down
15:21 jberger right, this is more a regression test than a proper unit test
15:23 sri let the OCD flow through you
15:24 bpmedley if -d $home->rel_dir('log') && -w $home->rel_file("log/$mode.log")  ?
15:26 jberger bpmedley: what does that do if the file doesn't exist yet?
15:26 bpmedley Irr.  My bad
15:40 good_news_everyon joined #mojo
15:40 good_news_everyon [mojo] jberger created log_target (+1 new commit): http://git.io/N1kN6Q
15:40 good_news_everyon mojo/log_target 7c2c2ee Joel Berger: Only use log directory if it is in fact a directory
15:40 good_news_everyon left #mojo
15:58 Eke- joined #mojo
16:49 jberger ooooh, I think I have a cute non-blocking bridge example in the works
16:56 jberger ok, so if I made an webapp that only worked if it liked the weather, would it be funnier if it considered the weather at the server location or the weather at the client's location?
16:57 moritz jberger: I hope the data center where the server lives has always nice weather :-)
16:58 jberger moritz: I guess I don't think that anyone is going to deploy the toy app to a datacenter :-P
16:58 jberger but you make a good point, when the user tests locally it doesn't matter which I pick
16:58 jberger so pick the client
17:02 moritz it's more intuitive for sure
17:07 crab seems silly to say "you have rotten weather, so i won't do any work"
17:07 jberger more like, the weather is bad there, I don't want to go there
17:08 jberger as if the server had to visit the location
17:08 jberger hmmm
17:08 jberger crab makes a point
17:08 jberger "no the weather here sucks, I'm not working today"
17:09 jberger maybe make it selectable
17:18 good_news_everyon joined #mojo
17:18 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/xFCpRA
17:18 good_news_everyon mojo/master f711943 Sebastian Riedel: added test for minimal application
17:18 good_news_everyon left #mojo
17:32 nemux joined #mojo
17:41 dod joined #mojo
17:42 dod joined #mojo
17:42 sri bpmedley: re the Mojo::Pg backend for Minion, if you think you can make a kick ass one, please go ahead, i'll gladly merge a patch
17:44 sri the old mango tests should give you an idea for what's expected from a core backend https://github.com/kraih/minion/commit/2dced8910d56521b6cc3513139cc6504445bd339
18:06 marcus joined #mojo
18:09 bpmedley Cool.  I will try.  If anything, I’ll learn some stuff along the way.
18:10 jberger signatures are a little weird when building nonblocking methods with optional parameters
18:13 sri jberger: don't have optional parameters!
18:14 sri (at least not in your closures)
18:14 jberger helper weather => sub ($c, $at_client=0, $cb=sub{}) { ... };
18:15 jberger that method returns the weather at the server unless you pass it $at_client
18:15 sri that dpesm't look so awkward actually
18:15 sri s/p/o/
18:15 jberger except when you call it without $at_client
18:16 jberger $c->weather(cb=> sub{ ... } );
18:16 jberger the sub is considered to be the value for $at_client
18:16 jberger unless you put cb =>
18:16 sri you make it awkward
18:17 * jberger is awkward
18:17 sri simple rule, if you need optional values in the middle use @_
18:17 jberger sure
18:18 jberger I was just making a comment on signatures, for point of reference
18:56 disputin joined #mojo
18:56 jberger current state: http://pastie.org/9705629
18:56 jberger fetches weather based on ip
18:57 jberger defaults to the server's ip
18:57 jberger its only a route for now, going to make it bridge for fun soon
18:57 jberger now, lunch
19:01 berov joined #mojo
19:08 berov marcus:,batman: Any gist for using Mojolicious::Plugin::OAuth2 ?
19:09 berov like how the handler for $c->get_token may look like?
19:15 batman berov: i don't get the question.
19:15 batman is the synopsis incomplete?
19:16 berov $c = $c->get_token($provider_name => \%args, sub { my ($c, $token, $tx) = @_; });
19:17 berov I think an example for the anonimous sub would be perfect
19:18 berov the handler passed to get_token
19:19 berov ahhh
19:19 berov ok
19:19 berov may now I got it :)
19:20 berov I simply did not know these are the same thing
19:36 damaya joined #mojo
19:37 mattastrophe joined #mojo
19:54 marcus lol, rt does 1148 distinct SQL queries to render the frontpage of my new employer. :)
19:59 Eke- joined #mojo
20:00 lb rt is wicked fast
20:20 marcus lb: it's certainly wicked
20:27 lb i had a client where they complained about the load-speed of the new/edit ticket pages
20:27 lb found that one of the dropdowns had thousands of entries, and suggested they modify the page to load that on demand
20:49 dvinciguerra joined #mojo
20:57 berov marcus:, batman: In Mojolicious::Plugin::OAuth2   refuse_handler is deprecated but if I do not pass a  refuse_handler then get_token redirects back to authorize_url. This seems to me is not desired behavior
20:58 berov may be it will be better to call the $cb/$args{callback}, espesially if this will be the future API
20:59 berov looks like the idea is the callback function to replace all the former *_handler calls
21:00 berov https://github.com/marcusramberg/Mojolicious-Plugin-OAuth2/blob/master/lib/Mojolicious/Plugin/OAuth2.pm#L108
21:13 damaya Morning all.
21:14 mattastrophe joined #mojo
21:17 * jberger decides to rewatch TNG
21:18 nemux_ joined #mojo
21:32 damaya TNG?
21:32 damaya Of course
21:32 damaya nothing
21:44 Eke- joined #mojo
22:21 sugar joined #mojo
22:38 fhelmber_ joined #mojo
22:47 purl joined #mojo
22:47 * sri hugs purl
22:47 * purl smiles
22:48 jberger purl!
22:48 jberger botsnack
22:48 purl :)
22:49 Eke- joined #mojo
22:50 sri purl: where have you been?
22:50 purl bugger all, i dunno, sri
22:51 * jberger pats purl
22:51 * purl pats jberger back, harder
23:13 jberger sri: any opinion on recommending a namespace for Mojolicious interfaces to web services
23:13 jberger ie Mojo::WebService::SomeCoolService
23:13 jberger or should it just be Mojo::SomeCoolService (as I have already done with Mojo::FriendFeed)
23:14 jberger I ask because I am thinking to add two more
23:14 jberger having them under a namespace would not only be cleaner, but easier to inventory
23:15 preaction I'd say Mojo::WebService sounds good. it's immediately "an interface to another thing" and not "that thing"
23:38 bpmedley https://github.com/brianmed/minion/blob/master/lib/Minion/Backend/Pg.pm <— Does this look like it’s on the right path?  I can run a worker on my linux box and my os x box.  They do both “work”.
23:39 sri bpmedley: yes and no, selecting all jobs is not good
23:39 bpmedley That’s a great point.  There are quite a few places for optimizations.
23:40 sri and the way you dequeue a job does not work
23:41 bpmedley That was a copy ’n paste function.  Sorry that it didn’t get updated.  I simply copied it and didn’t edit..
23:41 sri you need some sort of locking
23:41 sri transaction + row level locking or so
23:41 bpmedley https://github.com/brianmed/minion/blob/master/lib/Minion/Backend/Pg.pm#L287  <— Like here?
23:42 bpmedley There are other places that need that same attention.
23:42 sri hard to follow
23:43 sri certainly doesn't look optimal
23:43 sri you're using transactions wrong
23:43 bpmedley All the code or some subset?
23:43 bpmedley How so?  How are transactions wrong?
23:43 sri actually there's a lot wrong
23:44 sri you have no idea if you'll be getting the same dbh again
23:44 sri use one dbh per operation, and call $db->begin
23:45 bpmedley I will look into that.
23:46 sri $tx->dbh->do(...) is never a good idea
23:46 sri that is just bad https://github.com/brianmed/minion/blob/master/lib/Minion/Backend/Pg.pm#L274-L279
23:47 bpmedley I did a port fromt Minion::Backend::File.  Did I mis-understand what that version was doing?
23:47 sri File does things very file specific
23:48 sugar_ joined #mojo
23:48 sri at least 50% of the code does not translate
23:48 sri the Mango backend would be closer
23:48 bpmedley Ok; understood.  I’ll cross-reference.
23:49 sri File is basically just key/value, while Pg should be using SQL queries whenever possible
23:50 sri if you have to filter a bunch of jobs in perl, odds are it's wrong
23:50 bpmedley I agree.  This version is a proof of concept.  I just wanted to get some feedback before I went further.  It’s Alpha quality.
23:50 sri you did not mention that before ;p
23:50 bpmedley Can’t you read my mind?
23:50 * sri defaults to brutal reviews
23:50 bpmedley :)
23:51 bpmedley It’s exactly what I was looking for.   I’ll look into getting the transactions working and the dequeue.
23:51 sri Mango should be very close though, it's queries everywhere
23:52 sri the idea is to my $db = $pg->db; once per operation.... and the do $db->do/query and mt $tx = $db->begin; ...; $tx->commit;
23:52 sri s/the/then/
23:52 sri s/mt/my/
23:54 sri once you let go of the $db it goes back to the cache, and you enter an uncertain state
23:54 bpmedley Cool stuff.  Be back in a bit.
23:54 sri godspeed
23:54 purl godspeed is about darkuncle's favorite though. or about a punk bike messenger speedfreak in SF, at http://www.amazon.com/exec/obidos/tg/detail/-/0312286805/qid=1030569969/sr=8-1/ref=sr_8_1/102-9558966-3182555?v=glance&amp;s=books&amp;n=507846 and by (: lynn breedlove) or a track by BT (the Hybrid remix is exceptional) or short for Godspeed You! Black Emperor
23:56 sri bpmedley: i think insert returning is better than last_insert_id
23:57 bpmedley The _stub nonsense needs to go away.  Perhaps a second look after i do some edits.
23:57 sri the AutoCommit=0 too
23:58 bpmedley Why AutoCommit?
23:58 sri so you actually control the transactions
23:58 bpmedley plugin Minion => {Pg => 'postgresql://username:password@localhost/jobs?AutoCommit=0'};
23:59 sri right, i see no reason to ever deactivate autocommit

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