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

IRC log for #mojo, 2015-02-15

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

All times shown according to UTC.

Time Nick Message
00:08 kaare joined #mojo
01:00 jontaylor joined #mojo
01:14 sri hahahaha, testing pubsub is a lot easier than i though due to a funny side effect
01:15 kaare joined #mojo
01:24 jberger http://youtu.be/WfxKtroY-6M
01:24 jberger not actually relevant, but still
01:49 asarch joined #mojo
01:52 kaare joined #mojo
01:59 sri dammit, except for the reconnect bits
02:00 sri those refuse to be tested
02:00 sri some odd stuff happens, i do a select pg_terminate_backend(?) and it replays the last dozen notifications Oo
02:01 jontaylor joined #mojo
02:01 sri if anyone wants to help, i'd be more than happy about more tests
02:01 sri https://github.com/kraih/mojo-pg/compare/pubsub
02:06 sri there already is a connection close test, but it doesn't appear to work https://github.com/kraih/mojo-pg/blob/master/t/database.t#L299
02:06 sri (in pubsub.t)
02:06 sri in database.t it works perfectly fine
02:12 jberger I can try to take a peek
02:14 jberger anyone have a small but easy to use linux distro for throw-away virtual boxes?
02:21 Grinnz i'm a redhat junkie, so i just use fedora or centos depending whether i feel like restarting it once a week and reinstalling it once a year
02:25 jberger sorry, for perl I won't use redhat on principal
02:25 jberger *principle
02:25 kaare joined #mojo
02:26 meredith i just throw debian around like its nothing
02:26 meredith netinst here, debootstrap there...
02:33 Grinnz well i do use a local::lib :P
02:33 jberger Grinnz: with the bastardized system perl?
02:46 Oleg joined #mojo
02:47 Grinnz jberger, i install perl-core
02:50 jberger spliting the package violates the license
02:50 jberger http://dev.perl.org/licenses/artistic.html
02:52 jberger 4c
02:52 klapperl joined #mojo
02:54 jberger (also and more importantly, it screws with newbies)
03:04 Grinnz yeah, but it's either that or they can't include anything that depends on perl in the core
03:05 Grinnz because of that "small" thing you mentioned earlier :P
03:05 cpan_mojo Mojo-Log-Clearable 0.002 by DBOOK - http://metacpan.org/release/DBOOK/Mojo-Log-Clearable-0.002
03:07 noganex_ joined #mojo
03:09 Grinnz and i'm pretty confident in redhat's lawyers, anyway... if there was a license issue it wouldn't be in fedora at all (they're very strict)
03:10 sri hmm, getting closer, the reconnect tests pass if i put them at the beginning of the test file Oo
03:11 Grinnz lol
03:11 sri there is no disconnect
03:11 sri it appears that select pg_terminate_backend(?) just doesn't work if a session has received notifications
03:14 sri allright, committed the tests
03:14 sri https://github.com/kraih/mojo-pg/compare/pubsub#diff-a6761141dd1d76791adc9ae7c703253cR13
03:14 sri move them down and they fail
03:14 jberger drat, and I didn't even get my testbed setup yet
03:15 sri :o
03:15 jberger I don't trust installing databases on my host osx
03:15 sri brew install postgresql
03:16 jberger I can't say I have a ton of faith in brew lately
03:17 sri initdb /Users/sri/test_db; postgres -D /Users/sri/test_db
03:18 sri i think postgresql is even precompiled
03:18 sri so should take 30 seconds tops from 0 to running postgres :)
03:18 * jberger tries
03:19 jberger I had a ton of permission problems with brew a few days ago
03:19 sri i don't have much installed with homebrew, but the stuff i do has always been solid so far
03:19 sri how odd, i never had permission problems
03:19 jberger I was trying to fix imlib2 and borked things up pretty well
03:20 jberger brew requires some pretty lax folder permissions IMO
03:20 sri i never changed any folder permissions
03:20 sri no idea what you've been doing there
03:21 jberger the can bork themselves if you 'make install' things
03:21 sri i don't make install things
03:21 * jberger suggests you don't
03:22 tempire Unfortunately, I don't think I'm going to be at YAPC, for the training or otherwise
03:22 sri i keep everything neatly separated
03:22 * jberger also suggests that you avoid imlib2
03:22 tempire I'm pretty sure that's the same weekend as wwdc
03:22 tempire And iOS is paying the bills righ tnow
03:22 jberger :'(
03:39 sri :,(
03:47 * sri merges the pubsub branch into master
03:57 jberger aparently I don't have any idea what I'm doing
03:59 jberger are you supposed to use the postgres database?
04:00 Grinnz lol
04:02 * jberger figures that one out
04:03 jberger been a very long time since I setup a SQL database
04:06 Grinnz postgres is easier to setup than mysql, which isnt saying much
04:07 Grinnz but after install all i had to do was service postgresql-9.4 initdb, then sudo su - postgres -c psql and add a superuser role for my user
04:07 Grinnz then my user can createdb etc
04:13 sri figuring out what exactly to do took some time
04:13 sri but otherwise setting up postgres has been very easy
04:13 sri from what i hear upgrading databases is not so straight forward though
04:15 Grinnz the easiest way to upgrade a pg database is to do a pg_dump from the old version and then import it into the new version
04:15 Grinnz they usually have an upgrade mechanism too but its not foolproof
04:19 jberger got the chat working \o/
04:21 sri \o/
04:28 Grinnz i just realized... that would be an awesome way to reimplement my friend's online cards against humanity game
05:01 cpan_mojo MojoX-Mysql 0.12 by Kostya Ten - http://metacpan.org/release/KOSTYA/MojoX-Mysql-0.12
05:27 good_news_everyon joined #mojo
05:27 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/NioU
05:27 good_news_everyon mojo/master a326162 Sebastian Riedel: slightly more consistent use of closures in tests
05:27 good_news_everyon left #mojo
05:33 good_news_everyon joined #mojo
05:33 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/Niod
05:33 good_news_everyon mojo/master fa66e86 Sebastian Riedel: no more leaks in tests
05:33 good_news_everyon left #mojo
05:53 cpan_mojo Statocles 0.038 by Doug Bell - http://metacpan.org/release/PREACTION/Statocles-0.038 (depends on Mojolicious)
06:12 sri oh, looks like i fixed the test problem Oo
06:17 sri was a timing problem
06:18 sri i couldn't wait for the return values here, and needed to add a $self->{db} assignment https://github.com/kraih/mojo-pg/blob/master/lib/Mojo/Pg/PubSub.pm#L9
06:19 sri no clue how that caused old notifications to reappear is still a mystery to me though
06:19 sri s/no clue//
06:24 dotandimet joined #mojo
07:00 reneeb joined #mojo
07:13 dotandimet1 joined #mojo
07:27 irq joined #mojo
07:33 reneeb joined #mojo
07:48 Vandal joined #mojo
07:55 dotandimet joined #mojo
07:55 sh4 joined #mojo
08:16 absolut_todd joined #mojo
08:45 absolut_todd joined #mojo
08:58 alnewkirk joined #mojo
09:26 jontaylor_ joined #mojo
09:58 marmez joined #mojo
10:11 amon joined #mojo
10:12 dotandimet joined #mojo
10:47 Oleg joined #mojo
11:19 dotandimet joined #mojo
11:50 punter joined #mojo
11:53 dotan1 joined #mojo
12:22 cpan_mojo Test-Mojo-Session 1.03 by Andrey Khozov - http://metacpan.org/release/AVKHOZOV/Test-Mojo-Session-1.03
12:27 cpan_mojo Mojolicious-Plugin-PlackMiddleware 0.33 by Sugama Keita - http://metacpan.org/release/JAMADAM/Mojolicious-Plugin-PlackMiddleware-0.33
12:33 punter joined #mojo
12:45 basiliscos joined #mojo
12:59 dotandimet joined #mojo
13:43 buu joined #mojo
13:45 Anon021 joined #mojo
13:55 csson joined #mojo
14:39 nicomen heh, http://websocketd.com/
14:48 dod joined #mojo
14:53 dod joined #mojo
14:58 zivester joined #mojo
15:01 irq_ joined #mojo
15:06 bpmedley joined #mojo
15:13 jberger nicomen: yeah, I've come across that before
15:13 jberger same author as ReconnectingWebsocket
15:14 jberger which looked interesting at first, but then you realize how simple it is and just do it yourself
15:14 jberger you know, we could write a websocketd clone in mojo easily enough
15:15 jberger (anytime I say anything like that I usually end up wasting a half a day on a silly project)
15:16 nicomen would be nice to sneak mojo into people just needing a websocketd ;)
15:16 nicomen maybe with some easy way to add stuff
15:16 nicomen and suddenly you are running a mojo app
15:21 bpmedley Not sure I’ve mentioned it before; however, if you want to do mobile with a Mojolicious backend, then Xamarin works real well.  It’s fun.. :)
15:23 sri what makes websocketd special is that it has a pretty website
15:26 Nemix I would like to integrate Linux::Inotify2 into a mojo app (haven't located something built in).  What is the integration point?  IOLoop::Stream?  See examples for other loops in "Callback Interface" section: https://metacpan.org/pod/Linux::Inotify2
15:27 Nemix I would like a callback triggered when file is created in a directory
15:28 sri http://mojolicio.us/perldoc/Mojo/IOLoop#reactor
15:29 Nemix thanks!
15:40 sivoais joined #mojo
15:43 dotandimet joined #mojo
15:46 good_news_everyon joined #mojo
15:46 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/NXQE
15:46 good_news_everyon mojo/master e24f589 Sebastian Riedel: add an example for watching a file descriptor
15:46 good_news_everyon left #mojo
15:49 Nemix that was what I was trying to figure out next :)
16:00 basiliscos joined #mojo
16:15 reneeb joined #mojo
16:18 good_news_everyon joined #mojo
16:18 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/N1vD
16:18 good_news_everyon mojo/master 230bebd Sebastian Riedel: more examples for converting a file descriptor into a handle
16:18 good_news_everyon left #mojo
16:23 good_news_everyon joined #mojo
16:23 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/N1JE
16:23 good_news_everyon mojo/master 1d72d7a Sebastian Riedel: use a more appropriate mode string
16:23 good_news_everyon left #mojo
16:24 sri i always forget how to do it and have to look it up too, so better have it in a few pleaces :)
16:27 sri every now and then i just want to make Mojo::Reactor file descriptor based
16:33 jberger is it possible to make it accept either?
16:33 jberger fds are simple scalars containing numbers
16:34 sri the question is not if it's possible, but how much performance it would cost
16:34 jberger ah
16:39 good_news_everyon joined #mojo
16:39 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/N1LT
16:39 good_news_everyon mojo/master 6d843c7 Sebastian Riedel: just use two I/O watchers in the example
16:39 good_news_everyon left #mojo
16:40 sri this is not really meant to be a user friendly api
16:40 sri so i'd rather make a breaking change and get the best possible performance
16:45 sri it would also avoid the bug
16:45 sri (once you undef $handle it closes the underlying file descriptor)
16:45 sri s/bug/perl quirk/
16:46 mst that's only sort of true. fds are refcounted, and it's the destruction of the last $handle with the same fd that closes it
16:47 mst and I'm not sure what else perl could do, tbh
16:47 sri at least give me a way to avoid that behavior
16:48 sri my $handle = IO::Handle->new_from_fd(...); $handle->do_not_close_me(1);
16:49 sri it's a real problem in Mojo::Pg
16:49 sri https://github.com/kraih/mojo-pg/blob/master/lib/Mojo/Pg/Database.pm#L137
16:50 sri now if i want to put the $dbh into a connection cache on destruction of that object, i have to keep the handle too https://github.com/kraih/mojo-pg/blob/master/lib/Mojo/Pg/Database.pm#L18
16:52 sri i remember, when i was originally complaining about that *a lot* of folks told me how they've stumbled over it too
16:52 mst sri: right, I see what you mean now
16:53 mst when you hand perl an fh from a pre-existing fd it starts the refcount at 0 and you wanted it to start it at 1, effectively
16:53 sri right
16:56 asarch joined #mojo
17:11 jberger well I have gone on quite a loop this morning
17:12 mst sri: I know you can use POSIX::close to close something under perl without it noticing
17:12 mst but of course that's the opposite of what you want
17:12 jberger xamarin -> c# (async/await) -> go (channels/goroutines) -> perl6 (supply/tap etc) -> Inline::Perl5
17:18 sri hmm, another Mojo::Pg::PubSub problem
17:18 sri it can only reconnect if it is listening on a channel
17:19 sri maybe i should just have it always listen to a dummy channel like mojo_pg_pubsub or so
17:24 sri yea, that works https://github.com/kraih/mojo-pg/commit/f85f1ea13e0ad460f73ecf1a58fc4b832bdb5863
17:36 sri hmm, i have some interesting hacks for scaling this stuff :)
17:37 sri SO_REUSEPORT on linux might work extremely well here
17:49 punter joined #mojo
17:56 Grinnz crap, i need to turn off format detection on my app at work
17:56 Grinnz re: mailing list
17:56 purl hmmm... mailing list is a good place to beat the drum.
17:57 Grinnz had no idea it did that...
17:59 cpan_mojo Ado 0.79 by Krasimir Berov - http://metacpan.org/release/BEROV/Ado-0.79 (depends on Mojolicious::Plugin::OAuth2)
18:02 Grinnz_ joined #mojo
18:15 cpan_mojo MojoX-Session 0.32 by Viacheslav Tykhanovskyi - http://metacpan.org/release/VTI/MojoX-Session-0.32
18:16 sri Grinnz_: for a time we were planning to set format detecton to false by default in 4.0 or 5.0, but then it didn't pass the vote
18:21 cpan_mojo Mojo-Reactor-IOAsync 0.002 by DBOOK - http://metacpan.org/release/DBOOK/Mojo-Reactor-IOAsync-0.002
18:21 Grinnz sri, i guess it doesn't really cause any security problem or anything... just unexpected ways to access the app
18:22 sri a security problem would trigger an emergency release with a breaking change :)
18:23 Grinnz :)
18:33 Grinnz batman: i'll make another pull request without the changes to the existing test data, but do you mind if i fix that test data? (there are some errant newlines)
19:13 Grinnz batman or sri: how do you specify to Mojo::IOLoop::Client whether to use ipv6? there are some cases (like from my centos6 server) where i want to explicitly not use ipv6 to connect to irc
19:13 Grinnz because for some reason it doesn't work with some servers
19:24 sri use the v4 address
19:25 Grinnz it's a domain name, there's no ipv6 or ipv4 specific domain in most cases
19:25 sri then you're out of luck
19:26 sri perhaps force a local v4 interface or so with local_address
19:28 batman Grinnz: "fix that test data" ..? do you mean the files in t/data?
19:29 Grinnz yes
19:29 batman but it's a direct capture of what was sent over the line
19:29 batman i don't get how that can be wrong
19:29 Grinnz there are newlines that irc servers wouldn't send
19:30 batman aha! sorry. i just read "lines" :P
19:30 batman Grinnz: no. you don't have to fix that. i always fix it in the test.
19:30 Grinnz batman, no i mean there are newlines in the middle of lines which are causing some to not be seen
19:31 batman please tell me which test and what line.
19:31 Grinnz https://github.com/Grinnz/mojo-irc/blob/master/t/data/join.mojo#L5 for example
19:32 Grinnz i have them fixed in the new pull request for now
19:33 batman what do you mean, that it's not seen?
19:33 Grinnz it doesn't see either of those as valid lines because they aren't complete
19:33 batman i don't get that. can you prove it?
19:34 Grinnz https://github.com/Grinnz/mojo-irc/blob/master/t/data/welcome#L35 when i fixed this line, the lines received became 19 instead of 18, and there are 19 372 numerics in that test data
19:37 batman "19 372 numerics" <-- what does that mean?
19:37 Grinnz the test data contains a 372 response, 19 times
19:37 Grinnz which is rpl_motd
19:37 batman Grinnz: you need to make a failing test. i don't get it
19:38 Grinnz the failing test would be if i changed it test for 19 lines instead of 18
19:38 Grinnz https://github.com/Grinnz/mojo-irc/blob/master/t/join.t#L52 this test
19:47 batman Grinnz: you're absolutely right. i thought i had a test for checking if the data came in different chunks...
19:48 Grinnz even if it comes in different chunks, it won't get /r/n in between
19:48 batman but it doesn't come in different chunks in any of the tests...
19:49 Grinnz i would think it's a difficult thing to simulate
19:49 Grinnz well, you could do it just you couldn't split on newlines
19:53 Grinnz batman, i think i can update my whois test to test for this as well
19:59 Grinnz batman, ah nevermind... the ->write method always appends \r\n, so it would have to be written more manually
20:00 Grinnz oh wait... that is the stream ->write method, not the irc one
20:00 Grinnz hmm
20:02 batman Grinnz: i've pushed two commits now.
20:02 batman hope i've fixed all the typos
20:04 Grinnz batman, ok, looks good
20:11 Grinnz i squashed my pull request to get rid of the excess stuff.
20:12 batman i don't get what that pr is fixing :(
20:13 Grinnz that it would return out of the while loop if it read a numeric that couldn't be converted
20:13 Grinnz in the last pr i just changed it to "next" but based on your comment i tried a different way
20:15 batman i don't get what you mean about "out of the while loop" as in stopping Mojo::IOLoop..?
20:16 Grinnz no, the while loop in that function
20:16 Grinnz so it would stop reading the buffer
20:16 Grinnz until it read something else
20:16 batman aha! i get it now.
20:18 batman Grinnz: sorry for being so incredible stupid.
20:20 punter joined #mojo
20:30 Grinnz i think it is just language :)
20:31 Grinnz hmm there is a typo in your last commit (why doesn't strict catch this?) should be $seen not $send https://github.com/jhthorsen/mojo-irc/commit/2de6cf9fa13bef0fa27810c7aebcaeccf137d9af#diff-b3ed46dd08710450852bde4c1748d418R26
20:31 batman Grinnz: not really. my comment regarding your "next;" is invalid.
20:33 batman Grinnz: will fix it now.
20:41 batman Grinnz: do you want another release on cpan now?
20:43 cpan_mojo Mojo-Pg 1.09 by Sebastian Riedel - http://metacpan.org/release/SRI/Mojo-Pg-1.09
20:44 batman Grinnz: i need to go soon, so i'll make a new release now...
20:45 batman thanks again
20:45 Grinnz ok, cool thanks
20:46 cpan_mojo Mojo-IRC 0.17 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojo-IRC-0.17
20:54 Vertig0 joined #mojo
21:05 Adura joined #mojo
21:12 dotandimet joined #mojo
21:15 reneeb joined #mojo
21:20 dod joined #mojo
21:23 n2plato joined #mojo
21:26 punter joined #mojo
21:46 dotandimet joined #mojo
21:57 davido_lt joined #mojo
22:17 davido___ joined #mojo
22:18 davido_laptop joined #mojo
22:19 Vertig0 joined #mojo
23:45 good_news_everyon joined #mojo
23:45 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/NDtr
23:45 good_news_everyon mojo/master 650af5c Sebastian Riedel: more generic url_for examples
23:45 good_news_everyon left #mojo
23:53 * sri explains Mojo::Pg pub/sub a little more on the list https://groups.google.com/d/msg/mojolicious/c56EygmvMPU/H9sR14O2Ti8J
23:54 bpmedley It’s amazing what can be done in under 50 lines of Mojo..

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