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

IRC log for #mojo, 2014-10-02

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

All times shown according to UTC.

Time Nick Message
00:32 sri allright, got it kinda working... problem was that i was senting notifications over the dbh that i also wanted to receive them with
00:32 sri the docs say that's ok, but i guess it isn't
00:33 sri i bet this will cause quite a few leaks though
00:36 woz joined #mojo
01:08 jberger LEAK ALL THE THINGS!!!
01:08 * jberger commissions Snowden and Assange
01:20 uqurat joined #mojo
01:20 sri lets not do that
01:24 jberger I might have to make a python clone of delay
01:24 jberger Nonblocking is too hard without it
01:25 jberger delay++
01:27 sri why not generators or gevent?
01:29 dvinciguerra_ joined #mojo
01:32 jberger hmm haven't tried generators
01:33 jberger can't use "yield from" though
01:37 woz joined #mojo
01:45 jberger also it's not my event loop to control
01:45 jberger part of a much larger application
02:04 marty joined #mojo
02:06 noganex joined #mojo
02:39 woz joined #mojo
02:57 * jberger gingerly starts a conversation on the as-yet-unused #signatures
03:01 jberger I'm thinking about making a blog post about my tiny pubsub chat example: https://gist.github.com/jberger/78d7c1649d7acbab6a94
03:03 firnsy jberger: it's definitely a cute example
03:04 jberger if anyone knows a simple way to keep the viewport scrolled to the bottom correctly I would reverse the direction of stuff
03:04 firnsy the aeshetic in me always shudders when i see modules ending in numbers (ie ::Redis2)
03:05 jberger to use input at the bottom and old chat lines moving up the page
03:05 jberger firnsy: there is a major compatibility break in that module
03:06 firnsy oh that i know, i understand it was completely re-thunk and improved but it just feels unclean
03:07 laouji joined #mojo
03:07 jberger yeah, agreed, but what is the alternative, a name which is harder to find (Mojo::BetterRedis?), a VERSION method which does import magic?
03:08 jberger I do like the Mojolicious ethos of making the user responsible for upgrading past major version numbers, but it does irk people on occaison (though not for a while I must say)
03:09 firnsy i would think that's what version number suggests, if i move from 1.0 to 2.0 i'm responsible for updating my code
03:09 firnsy can you image version 3.0 of Mojo::Redis2, /me confused
03:09 firnsy Mojo ethos++
03:09 jberger the problem is that cpan clients don't do help with that
03:09 firnsy semver FTW!
03:10 jberger carton FTW!
03:10 jberger and cpanfile
03:10 purl i think cpanfile is much more versatile but harder for non-perl to read
03:10 * jberger pats purl
03:10 * purl purrs
03:10 * firnsy only uses system packages
03:10 firnsy and if it's not packaged, packages what's required
03:11 jberger firnsy: at least you take that second step
03:11 jberger I looked at getting into ubuntu packaging and it just looked like too much
03:12 jberger (then I went the other way and start the Alien::Base project :o)
03:12 firnsy RPM is way easier than debian packaging
03:12 firnsy s/debian/DPKG/
03:12 fhelmber_ joined #mojo
03:15 jberger every now and I again, though, it scares me that the most popular open source thing I have ever (and likely will ever) write is this: http://goo.gl/5dLSe
03:16 jberger was up to 7000 users a few years ago
03:16 jberger sigh
03:16 jberger its always about the shiny
03:17 firnsy lol
03:17 jberger actually I'm amazed that 2000 people still use it
03:18 jberger it was made when chrome looked awful when using the ubuntu dust theme
03:18 jberger now no one uses dust since brown ubuntu went away and "dust" became the de-facto colorscheme
03:18 jberger and then chrome got better at using system colors anyway
03:19 * jberger goes on a wild tanget
03:19 jberger the internet is boring today
03:40 woz joined #mojo
03:58 * sri agrees with firnsy, if Mojo::Redis was my module i would just bump the major version number and break the api
03:59 basic6 joined #mojo
04:02 sri funny thing, Mojo::Redis is not even 1.0
04:10 zivester joined #mojo
04:11 preaction joined #mojo
04:12 sri i kinda would like to be able to hide file in the DATA section :)
04:12 sri s/file/files/
04:13 sri like migration sql files :o
04:14 sri @@ 01_the_beginning.sql (hidden)
04:15 sri some kind of flag that prevents a file from being considered static or template
04:26 zivester joined #mojo
04:36 sri guess it's unrealistic
04:41 woz joined #mojo
04:53 jzawodn_ ooh, I haven't paid any attention to the Mojo::{Redis,Redis2} modules.  could be quite handy soon
04:54 preaction was Riak ever discussed as a possible alternative to Mongo?
05:01 sri i've used riak a few times... but it doesn't feel right
05:01 sri you're always fighting with the api
05:04 sri the rest api is kinda ok, but last i tried it was bleeding erlang everywhere
05:05 sri config files, cluster setup console, map/reduce doc examples...
05:05 sujithm joined #mojo
05:06 amijares joined #mojo
05:07 preaction heh, like postgres the last time i tried it, 6 years ago ;) configs, schema/database/table
05:08 amijares hi there..
05:10 sri o/
05:10 * sri still enjoys postgres
05:11 sri listen/notify was a bit odd though
05:11 amijares one simple question: what's the easiest way to test a Mojo app? I don't understand how to use Test::Mojo
05:11 preaction Test::Mojo is the easiest way
05:12 preaction what part are you having trouble with?
05:12 amijares mmm... can you point me to a guide?
05:12 amijares not the POD
05:12 amijares don't know how to use it
05:12 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Growing
05:13 preaction what about the synopsis in the pod? what's unclear?
05:13 purl Clear as crystal. And twice as fragile.
05:13 amijares ok, i'll go there as a first step... thank you
05:13 sri and if you've not used the guides yet, start at the beginning http://mojolicio.us/perldoc
05:13 preaction if you have specific questions, we can answer them
05:14 amijares preaction, ok
05:14 preaction there's also tempire's mojoexample, which includes tests: https://github.com/tempire/MojoExample, and there's a blog post by the same person: http://blogs.perl.org/users/tempire/2011/02/testing-your-mojo-with-testmojo.html
05:16 sri did i mention how much i love person of interest? that show just can't make bad episodes
05:17 amijares my app is in app.pl, for example... I tried $t = Test::Mojo->new(app.pl) and, of course, this is not the way... perhaps I need to read twice
05:17 preaction i think that's where the Growing guide comes in
05:18 d4rkie joined #mojo
05:19 amijares great... i'll read it and come back if i need to... thank you... not my first time with mojolicious but it's my firt time wirting a test
05:19 preaction sri: the premise sounds interesting... i'm in the middle of Fringe, but this might be a good followup
05:20 preaction heh, it's produced by JJ Abram's company, who also produced Fringe
05:20 KCL_ joined #mojo
05:26 KCL_ joined #mojo
05:27 batman firnsy: if you suggest a better name, I will rename ::Redis2 :)
05:28 firnsy batman: Mojo::Redis, but i also understand you have your own reasons :P
05:29 batman sri: ::Redis2 was your idea.
05:29 batman firnsy: how will you enable existing apps to work?
05:29 batman It's not a minor change. Everything breaks.
05:30 firnsy yeah that's what bumping the major number implies, api breakage
05:31 firnsy if i as the downstream user of your package don't want to change my code, then i have to specify the hard dep
05:31 batman So you suggest I rewrite 10000 lines of code because I have to to be able to use the new version?
05:31 batman That's not cool.
05:32 firnsy why do you have to rewrite 10000 LOC?
05:32 batman Because I want to use the new version that actually works in new parts of my program
05:33 firnsy ok so are you talking about you as the upstream (creator of the tool) or the downstream (user of the tool)
05:33 batman It's not possible to load two versions of the same module in Perl
05:33 firnsy why do i want to do that?
05:33 batman User
05:34 firnsy kk, then hell yeah, tell the user to rewrite the 10000 LOC
05:34 batman Because I want to use the new version, but I already have existing code that rely on the broken version
05:34 firnsy they shouldn't be investing _that_ heavy into something that is not even 1.0
05:34 firnsy < 1.0 ... API is not stable
05:34 preaction like node.js, currently on 0.10
05:35 firnsy exactly
05:35 batman Then I have to renumber all my modules
05:35 amijares sri and preaction: you were right and the name of the guide fits perfectly to me... i need to get rid of Mojolicious::Lite and grow to a real app
05:35 amijares a second question: what if a want to test my current app with Mojolicious::Lite, what can I use?
05:36 preaction firnsy: that was a wonderful thing when JSON.pm did it (with a major version change from 1 -> 2). and when Module::Runtime did it (still in its 0. series)
05:36 batman firnsy: have you looked at the kind of change the module has gone through?
05:37 preaction if you're using Carton, it's not such a big deal, pin the module version, but most people aren't using Carton
05:37 firnsy batman: i've skimmed enough to see it's major breakage, but that's part of the territory
05:37 batman Carton doesn't help.
05:38 firnsy ... as good user i understand to tread lightly with < 1.0
05:38 preaction it would help the people who have to do "cpan MyModule" and expect to get the old one that works with their existing app
05:38 firnsy as a good tool writer you wouldn't have that level of breakage with every major bump
05:38 batman preaction: but it doesn't help when you want to use both versions
05:39 batman firnsy: I didn't write Mojo::Redis
05:39 batman s/write/design/
05:40 firnsy that's cool, then even easier to say pffft ... 1.0 breakage time
05:41 batman firnsy: it's impossible to convince me here, unless there's a way to load both versions.
05:41 batman I really wish I could, but there's simply to much code that relies on the old version
05:42 woz joined #mojo
05:43 firnsy batman: understood, i look forward to seeing code the track that include Mojo::Redis, Mojo::Redis2 ... Mojo::RedisN :P
05:45 * firnsy is just venting because his dev team can't grasp versioning
05:45 batman I hope you don't like 1.2.3 versions as well...
05:46 firnsy major.minor.rev?
05:46 batman Yeah
05:46 * batman ends. On my way to work.
05:47 firnsy yeah ... that is my point, semantic versioning makes sense when used properly
05:48 batman Redis2 is not a new version if Redis. It's a new module with A bad name.
05:51 amijares goodbye guys, I'll be back later when i understand better the testing issue
05:58 uqurat_ joined #mojo
05:59 preaction joined #mojo
06:08 dod joined #mojo
06:19 Vandal joined #mojo
06:24 Lee joined #mojo
06:35 bobkare joined #mojo
06:43 woz joined #mojo
06:48 jamesaxl joined #mojo
07:08 Dandre joined #mojo
07:13 fhelmber_ joined #mojo
07:29 dod joined #mojo
07:41 trone joined #mojo
07:44 woz joined #mojo
08:05 laouji_ joined #mojo
08:08 dod joined #mojo
08:28 Guest joined #mojo
08:46 woz joined #mojo
09:00 basiliscos joined #mojo
09:03 batman mst: is there a good blog or something that describes how to deal with mysql and DATETIME?
09:04 batman i got issues where i'm trying to compare the column with perl's time() and it fails because the conversion (using DBIC+DateTime) think i live in Great Britain and not in norway...
09:05 batman if ($datetime_parser->parse_datetime($row->updated)->epoch < time - 60) ...
09:05 nicomen batman: wouldn't that depend on what is stored in the db, and what you use as timezone locally?
09:06 batman nicomen: the db is in the same timezone as the program. DateTime::Format::MySQL + DateTime on the other hand thinks i'm somewhere else.
09:07 batman probably because i'm using it wrong, but i don't get how to do it right
09:07 batman i tried to do $dt->time_zone("Europe/Oslo"); before $dt->epoch, but that didn't help much
09:09 nicomen I _think_ epoch tries to return UTC no matter what
09:09 nicomen so you might need to make sure the mysql date is converted to UTC also before converting?
09:10 nicomen ah wait
09:10 bpmedley batman: http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html <— Might this help?
09:11 nicomen the datetime in mysql does not have a timezone attached right? (I _always_ recommend everyone always to use UTC, any local date conversation should be done as clsoe to the user as possible)
09:12 batman bpmedley: it would help if i used UNIX_TIMESTAMP(). trying to avoid that though, since it will break my unit tests which use sqlite
09:12 batman nicomen: yeah, not going to happen. we already have millions of rows with local timezone :(
09:12 batman nicomen: i do agree though
09:14 nicomen $ perl -wle 'use DateTime::Format::MySQL; my $dt = DateTime::Format::MySQL->parse_datetime("2014-10-02 11:14:01"); print $dt->epoch; print $dt->set_time_zone("Europe/Oslo")->epoch; print time;'
09:14 nicomen 1412248441
09:14 nicomen 1412241241
09:14 nicomen 1412241263
09:15 nicomen (setting timezone seems to help here at least?)
09:15 batman oh crap! i did $dt->time_zone() /("/&%!#(!#
09:15 batman thanks nicomen
09:15 batman *testing*
09:16 nicomen batman: since your mysql datetime field does not have an idea about timezone, the unix_timestamp() method would return the wrong timestamp anyway
09:16 batman nicomen: incorrect. it use the timezone from the server which in our case is correct.
09:16 nicomen batman: problems will arise around timezone shifts though
09:17 nicomen not sure how clever DateTime is when applying time_zone in that sense, I _think_ it's supposed to apply the correct timezone after judging the actual date
09:17 nicomen batman: ah right
09:18 basiliscos joined #mojo
09:24 * batman tries Date::Parse
09:24 batman i'm no fan of DateTime :(
09:26 Dandre left #mojo
09:28 fhelmber_ joined #mojo
09:32 dod joined #mojo
09:40 mishantil batman: What bugs you about DateTime?
09:41 batman i just think it's too much.
09:41 batman and the api is clunky. set_foo() vs foo() and the i always have to look up the constructors to see what i need to pass in
09:41 batman s/the i/i/
09:42 mishantil yeah, it is sort of clunky. But it does (AFAIK) handle time i a pretty sensible manner. And it supports doing arithmetrics fairly easily.
09:42 batman on my spare time, i try to only work with epoch. it's probably broken as well, but at least it doesn't keep me up at night (yet)
09:43 mishantil Every implementation of time has it's flaws.
09:44 batman yeah, they probably do.
09:44 mishantil Thankfully I have yet to use a perl module that breaks time as bad as joda-time in Java.
09:44 mishantil *shudders*
09:44 batman can't remember what bugged me about epoch but we had (have?) some issues in convos :(
09:45 batman haha... yeah, i've heard ruby (used to) had issues as well... overlapping namespaces
09:45 mishantil Hehe. Yeah, Ruby is certainly ..interesting.. in many ways.
09:47 woz joined #mojo
10:18 denis_boyun joined #mojo
10:25 D4RK-PH0ENiX joined #mojo
10:30 alanminter batman: Can you do the comparison within the db, comparing to NOW() ?
10:34 alanminter Time::Moment is nice if you're looking for bare bones
10:43 D4RK-PH0ENiX joined #mojo
10:48 woz joined #mojo
10:55 Jonis hooray for all things postgresql
11:17 mishantil Amen!
11:18 mishantil Not so much hooray for writing contracts.
11:20 basiliscos1 joined #mojo
11:24 batman alanminter: now, as i said: i'm running my tests against sqlite
11:24 batman s/now/no/
11:29 batman alanminter: not sure if Time::Moment could work for me: "The string must consist of a complete date representation and time of day followed by a time zone designator"
11:29 batman don't have time zone in mysql :(
11:31 d4rkie joined #mojo
11:32 Akron joined #mojo
11:36 ladnaV joined #mojo
11:38 jberger wow that blog post by tempire is out of date!
11:39 jberger post_form using Mojo::Client!
11:41 Vandal joined #mojo
11:42 Zx3 joined #mojo
11:42 mishantil tempire is SO last century
11:46 neilhwatson joined #mojo
11:50 woz joined #mojo
12:00 GillesM joined #mojo
12:26 azawawi joined #mojo
12:26 azawawi left #mojo
12:51 woz joined #mojo
12:59 Guest joined #mojo
13:06 zivester joined #mojo
13:22 ignacio_ joined #mojo
13:35 marty_ joined #mojo
13:37 lipizzan joined #mojo
13:49 arthas joined #mojo
13:51 basiliscos joined #mojo
13:52 woz joined #mojo
14:03 sri batman: don't blame me for Redis2, i always allow breaking changes in my modules based on the major version number
14:04 andrefs joined #mojo
14:12 sh4 joined #mojo
14:14 _eugen joined #mojo
14:17 batman that's true. i just blamed you for the actual name ;)
14:17 dod joined #mojo
14:18 batman anyway. i still consider Redis2 not to be the successor of Mojo::Redis. it's a completely different module
14:20 sri that makes the name choice a terrible one
14:21 dod joined #mojo
14:21 batman *shrug*
14:21 batman then what should it be called??
14:21 sri like Perl 6 is not the successor to Perl 5 -.-
14:22 batman if it could replace Mojo::Redis, then i would.
14:22 batman if anyone can see a way it could, without making Mojo::Redis even slower, then please tell me
14:23 genio put disclaimers in Mojo::Redis that it's changing.  completely change it out for Redis2 after a predetermined time?
14:24 batman i can't, since i (and others) have too much code depending on the way it works
14:24 batman can't = wont
14:25 genio Well, doesn't the predetermined time give the opportunity to move all of that code to Redis2, where at the designated time, you change "use Mojo::Redis2;" to "use Mojo::Redis;"
14:25 batman oh. didn't think about that.
14:25 batman marcus: what do you think about that idea?
14:27 genio The predetermined time just needs to be far enough in the future so that you can convert all your apps using Mojo::Redis to Mojo::Redis2
14:28 batman yeah.
14:28 batman i like it.
14:28 batman marcus: say "yay" and i will release a new version of Mojo::Redis with a warning
14:34 marty joined #mojo
14:35 marty_ joined #mojo
14:38 marty joined #mojo
14:38 marcus batman: yay
14:38 batman \o/
14:39 marcus nobody should start using that module.
14:39 batman genio++
14:39 batman haha
14:39 batman marcus++
14:41 sh4 joined #mojo
14:43 sh4|2 joined #mojo
14:44 Dandre joined #mojo
14:45 chansen batman: Do you store your timestamps in local (CET/CEST) zone or in UTC zone?
14:46 batman chansen: i (as in me on my spare time) store epoch
14:46 marcus How many timestamps have you collected by now, batman?
14:46 batman marcus: huh?
14:46 genio UTC and then store people's offsets by name (not hour difference) in their settings.  display times as they like to see them
14:46 batman genio: nah. we're going a different direction in convos: render the ecoch time using javascript on client side.
14:47 marcus batman: I assumed you were collecting timestamps as a hobby in your spare time?
14:47 marcus :D
14:47 batman haha
14:47 genio batman: you don't give the user their local time?
14:47 dvinciguerra_ joined #mojo
14:47 chansen batman: Epoch is defined to be in the UTC zone, so use Time::Moment->from_epoch($epoch) or if you have a string representation Time::Moment->from_string($string . 'Z', lenient => 1)
14:48 batman genio: sure. new Date(<%= $epoch %>0000); # not quite, but close enough
14:48 batman chansen: but i don't want to do time on the server.
14:49 genio but I see it looks like you're storing the offest in the session as being hour based.  that makes standard time and daylight savings hard to deal with
14:50 batman genio: no shit.
14:50 purl no shit is valid (although it won't be in 5.16)
14:50 batman hehe
14:50 batman that's why i want to do it all in the client using javascript
14:50 genio whereas "America/New_York" for example makes it less work on your end (if you're using a good datetime library)
14:51 batman where will you get that information from? (timezone)
14:51 genio DateTime::TimeZone
14:51 genio they also have lists of the various time zone names
14:52 batman uhm... i mean, do you expect the user to set the timezone?
14:52 genio yes
14:52 batman oh. i don't.
14:52 batman marcus: https://github.com/marcusramberg/mojo-redis # ok?
14:52 genio you pick a default, and then have that as a setting for them to change
14:53 batman sounds pretty broken when you have a service that is world wide :(
14:53 sri hmm, the fact that unicode just works with DBD::Pg is a pleasant surprise
14:53 batman if i knew i was always behind cloudflare, i would use the "geo" header to set the default.
14:53 genio well, you can do some intelligent figuring on signup
14:54 woz joined #mojo
14:54 batman genio: and then when the user is traveling?
14:54 genio if they have something set in their personal settings, you display what their settings are.   "2014-10-02 12:34:49 EST"
14:55 mikegrb can we have support for this in next mojolicious release? http://pic.dhe.ibm.com/infocenter/wsdatap/v3r8m1/index.jsp?topic=/xs40/convertingbetweenjsonandjsonx05.htm
14:55 batman genio: when i'm in new york, i want to see new york time. not oslo time.
14:55 * mikegrb runs
14:55 genio If their location is wildly different from their settings, a popup asking them if they want to temporarily use their new location could be done
14:55 batman genio: then why not just make it automatic?
14:56 batman settings-- # makes everything hard
14:56 genio because lots of times when I travel and I'm still dealing with people back at work, I need to be on their time.  maybe I'm weird
14:57 batman i'm definitely weird ;)
14:58 genio Right now I'm in FL (America/New_York).  In a week and a half, I'll be in Paris (no idea what timezone name).  But, I'll be doing some work while over there and need to see when people are replying to certain things with regard to the America/New_York timezone
14:58 batman but i really don't want to see the localtime of someone else.
14:58 batman i don't get that genio. sorry.
14:59 genio meh.  we just work differently and I probably travel less than you do... so maybe I should just shut up as I'm probably not nearly as good of a test candidate on this type of thing.
15:00 batman genio: no. i just don't see the killer argument here. doesn't mean you're wrong.
15:00 batman or actually: you're of course not wrong, since you like it that way.
15:01 batman but the thing is that i want to have a solution that works for most people, and when i don't see your point, then i think you're not "most people".
15:01 batman my logic is of course flawed, since "my point" is not equal to "most people" either :)
15:02 genio Well, I'm USian, where we do things different from most other people as we don't tend to travel across too many timezones frequently (unless we live near a timezone border).  This is a gross generalization, mind you.  So, with regard to doing this properly for people who actually travel, I'm probably not "most people" as you stated.
15:03 marcus Heh, your country has more time zones by itself than most.
15:03 sri mikegrb: YOU BETTER KEEP RUNNING
15:03 batman sri: haha
15:04 batman marcus: have you read?
15:04 mikegrb <3
15:10 genio let's just force everyone to stop doing the stupid time change thing where we jump back and forth an hour and everything will be much easier
15:10 batman ONE TIME TO RULE THEM ALL!
15:11 batman doesn't exist yet though... :(
15:11 chansen It's named UTC!
15:11 disputin joined #mojo
15:12 batman no it's not. it's scientifically incorrect. (i will stop there)
15:12 chansen uh, "scientifically incorrect" ?
15:14 sri postgres seems pretty smart about interpreting dates and times :o http://www.postgresql.org/docs/9.4/static/datetime-input-rules.html
15:15 chansen batman: "Coordinated Universal Time is the primary time standard by which the world regulates clocks and time" <http://en.wikipedia.org/wiki/Coordinated_Universal_Time>
15:18 chansen sri: yeah, looks sensible
15:22 marcus I like UTC
15:33 batman jberger: cpan_new is dead..?
15:35 basiliscos joined #mojo
15:55 woz joined #mojo
16:06 Vandal joined #mojo
16:10 hernan604 joined #mojo
16:10 hernan604 hi!!
16:10 hernan604 is there a simple way to show requests for /public static files?
16:10 hernan604 on the dev server
16:10 purl on the dev server is working
16:11 fhelmber_ joined #mojo
16:17 ladnaV joined #mojo
16:19 hernan604 brb
16:21 Oleg joined #mojo
16:23 Oleg As i promised some time ago: http://irclog.perlgeek.de/mojo/2013-11-13#i_7855140
16:24 Oleg My thought about non-blocking dns resolver for mojolicious: http://rec.data-flow.ru/articles/2014/10/mojo-dns-thought.html
16:25 Oleg what do others thinks about this? especially sri. Any chanse to get non-blocking dns resolver with Mojolicious? :)
16:27 Vandal joined #mojo
16:29 basiliscos joined #mojo
16:30 odc me gusta
16:31 sri Oleg: Net::DNS::Native looks nice
16:31 napoleon joined #mojo
16:31 ladnaV joined #mojo
16:31 napoleon I need good template system for perl?
16:33 Oleg sri: thanks
16:33 tianon I really hope that's some kind of cruel joke, napoleon :)
16:33 tianon http://mojolicio.us/perldoc/Mojo/Template
16:33 napoleon I use edit_file
16:33 napoleon File Slurp
16:33 purl rumour has it File Slurp is requiring modules now
16:34 sri Oleg: rest of the blog post is a little low on details for me to get a good picture
16:38 Oleg sri: pull request may has more details, but i need to know that direction is right, before I'll do it
16:39 Oleg the idea is to make as similar to Mojo::Reactor API as possible
16:39 sri the question is will there ever be alternatives?
16:40 Oleg alternative resolvers? If anyone will implement it. Why not?
16:40 sri trying to figure out of Mojo::Resolver makes sense or if this would be better off inside Mojo::Reactor
16:41 odc well, there are many dns resolving libraries, so yes (potentially)
16:41 sri say we will have a good libuv binding at some point, it would provide its own resolver api
16:41 odc urgh
16:42 sri odc: it's not as simple as it may look ;)
16:42 sri pure dns resolvers are mostly shit, i doubt anyone would want those if they can also have something nice like Net::DNS::Native
16:43 sri big question really is how to fit more powerful event loops like libuv in
16:43 odc use perl6 ;)
16:44 sri Oleg actually linked to a conversation where it's better explained http://irclog.perlgeek.de/mojo/2013-11-13#i_7855044
16:47 jb360 joined #mojo
16:47 sri Oleg: also no details on how you'd handle the fallback code
16:48 Oleg For libuv somebody will just implement Mojo::Resolver::UV which will depend on Mojo::Reactor::UV, I think
16:50 sri the ->cancel stuff doesn't feel right if there's a blocking fallback, leads to wrong assumptions and hard to explain stuff in the docs
16:52 sri bottom line, i have no idea what the right direction might be here :/
16:52 sri perhaps tempire, marcus, crab, batman or jberger want to chime in too
16:54 Oleg may be return some object instead, and when refcnt to this object == 0 it will stop resolving operation automatically (if can)
16:55 batman i can't say i've ever needed an async dns resolver, i also don't know much about the topic :(
16:55 batman i'm curious if a perl-dns-resolver is any faster overall
16:55 sri a what?
16:55 purl rumour has it a is b, b=>a => what it's testing
16:56 batman sri: a dns resolver written in perl
16:56 woz joined #mojo
16:56 sri batman: see http://irclog.perlgeek.de/mojo/2013-11-13#i_7855044
16:57 sri wow, that was almost a year ago :o
16:58 sri maybe at some point i should stop hoping for a good libuv binding...
16:58 batman i will try to explain... perl has in the "perl gut" a thing that does blocking DNS resolving now, right..?
16:58 sri no
16:59 sri you operating system has a few syscalls perl uses
16:59 batman gethostbyname() ?
16:59 purl gethostbyname() is a core perl function.
16:59 batman right
17:00 Oleg yes
17:00 sri Net::DNS::Native uses the same, just in a thread pool, to erform a few concurrently
17:00 batman i'm thinking if you make a Whatever::DNS::Resolver, it must be slower in the normal case --- with the exception of when the DNS server is slow...?
17:04 sri oops, Net::DNS::Native doesn't install for me
17:04 sri ***This perl may crash while using this module. See `WARNING' section in the documentation*** -> N/A
17:04 Oleg in fact it shouldn't be notably slower. The overhead here is: socketpair() and threads
17:05 sri oooh, it requires a perl with threads
17:05 sri that is kinda bad
17:05 batman Oleg: ok.
17:05 Oleg sri: no, linked with pthreads is also enough
17:05 sri yea, but who actually does that?
17:06 sri i can't tell a normal user to do that... would have to tell them they need a threaded perl
17:07 Oleg yes this may be the problem. Hmm, and can you just comment check inside Makefile.PL and run tests? Is it segfaults?
17:08 sri lets see
17:08 Oleg May be I need more research here
17:08 Oleg But I found this info on stackoverflow
17:09 sri yea, commented out the check and everything worked flawless
17:09 Oleg no segfaults?
17:09 sri nope, all tests pass
17:10 Oleg Good
17:10 marcus Too bad perl threads are so bad.
17:10 marcus Wonder if it would be possible to use grand central dispatch with perl somehow.
17:10 sri https://gist.github.com/anonymous/2588fc68c742d918a2b1
17:12 marcus https://github.com/nickhutchinson/libdispatch + ffi?
17:14 sri hmm... the node.js dns api is super minimalistic http://nodejs.org/api/dns.html
17:15 sri ote the lack of a timeout
17:15 sri *+n
17:16 sri that also works better with a blocking fallback
17:17 Oleg getaddrinfo() timeout on my system is about 40 sec
17:20 Oleg So, i'll test more net-dns-native with non-threaded perl tommorow
17:20 KCL joined #mojo
17:22 dod joined #mojo
17:26 sri think i'll leave the final decision up to a majority vote, but to sum up my concerns a) threaded perl requirement seems like a non-starter (should be fixable, as we just saw), b) timeouts don't translate well to a blocking fallback (especially the documentation needs to simple in the end), c) whole bew pluggable layer with Mojo::Resolver seems a bit much, considering the lack of available alternatives, d) an event loop with native resolver api like libuv needs to
17:27 sri jberger, marcus, batman, crab, tempire: so put some thought into it, maybe do some research on the topic, you'll get to decide
17:30 azawawi joined #mojo
17:31 azawawi hi
17:31 jzawodn_ threaded perl--
17:32 Oleg nobody likes threaded perl :(
17:32 jamesaxl joined #mojo
17:33 sri Oleg: i know i brought up the whole pluggable resolver topic, but if Net::DNS::Native is good enough i think we could also handle it as an internal optimization until there actually are real alternatives :)
17:35 sri the whole timeout stuff made me really nervous
17:35 Oleg this is a good solution for me, also
17:37 Oleg Yes timeout is a problem, in net-dns-native it is also no real timeout option, just workaround.
17:37 sri right, i think that's what bugs me
17:38 D4RK-PH0ENiX joined #mojo
17:38 sri Mojo::Resolver would be meant as a generic api, but add a custom concept like timeouts that most resolvers just don't support natively
17:38 genio why hasn't threaded Perl just been gutted at this point?
17:39 sri because fork emulation on windows
17:39 jzawodn_ threaded Perl sounds good in theory but sucks in practice
17:39 sri it's pretty good for that
17:40 sri Oleg++ # btw.
17:41 sri if you can get that thing portable enough it will be pretty awesome
17:45 basiliscos joined #mojo
17:45 Oleg today i ported it to NetBSD and NetBSD runs everywhere :) So the main question now: is it really need threaded perl
17:50 sri if you want to send a pull request to get the real discussion started, maybe go with the most minimalistic solution you can think of, then we can build up on that
17:51 azawawi Oleg++
17:51 azawawi hi sri
17:51 sri o/
17:51 Oleg ok
17:53 sri in general i'm +1-ish on non-blocking resolver support btw., just need to figure out the how :)
17:53 sri especially for Mojo::UserAgent it can be a pretty big optimization, open up many new use cases
17:58 woz joined #mojo
17:58 Vandal joined #mojo
17:59 disputin joined #mojo
18:02 ladnaV joined #mojo
18:03 thowe joined #mojo
18:04 thowe I totally get to do a Mojo project for work \o/
18:04 sri \o/
18:05 jzawodn_ and I got the green light to increase traffic to my first real production mojo service by like 50x soon.  yay for mojo @ work
18:05 thowe jzawodn_, Hooray!
18:06 thowe It's not a big complicated thing, so I will even just release it on github.  In fact, it will be of sufficient general use that perhaps I should consider a CPAN release...
18:07 thowe It's just a timecard application for our remote offices.
18:07 thowe Perhaps with some kind of exports that work with Quickbooks or something
18:08 thowe Not totally sure yet.  I'm going to sit down with the book keeper and see what she needs.
18:08 thowe It seemed like a good small-scale thing for me to cut my teeth on.
18:10 thowe jzawodn_, what is your work thing?
18:16 jzawodn_ thowe: I work at craigslist
18:16 jzawodn_ I'm transitioning some of our stuff off mod_perl
18:16 thowe Nifty!
18:17 jzawodn_ keeps me busy :-)
18:17 thowe love me some best-of-craigslist
18:18 jzawodn_ we're hiring too... spread the word!
18:18 jzawodn_ (who isn't?)
18:19 thowe I usually spread the work about hiring on Craigslist
18:19 thowe er word
18:31 thowe So, like, what kind of jobs and where?  I have crazy skills from working at/building multiple ISPs and wish I could spend more of my time coding and stuff.  I do everything from build/admin servers to run Tier 2 transit networks.  I like long walks on the beach, gardening, and beer.  I've dabbled in Perl and Javascript as required...  Would I have to move to SF?
18:33 neilhwatson Lot's devs and devops being hired in Toronto. Some will consider remote workers.
18:38 jzawodn_ thowe: yeah, we're based in SF
18:38 jzawodn_ if you're interested, pass me a resume: z@craigslist.org
18:39 jzawodn_ we need good sysadmins/netadmins/coders
18:39 r0b3rt http://sfbay.craigslist.org/search/sfc/jjj?nh=8&amp;query=craigslist&amp;srchType=T
18:39 jzawodn_ yup
18:59 disputin joined #mojo
18:59 woz joined #mojo
19:02 basic6_ joined #mojo
19:03 jberger_ jzawodn_: do you allow remote?
19:03 jberger_ I would love to actually get to use Mojo for work
19:04 jberger_ batman: cpan_mojo does that
19:04 jberger_ i think it's a reconnect problem
19:05 jberger_ it's just running on a desktop in my house
19:05 batman oh :(
19:05 jberger_ but then again the same desktop hosts my convos
19:05 jberger_ And that doesn't have reconnect problems
19:05 batman can i run cpan_mojo?
19:05 jberger_ yeah
19:06 jberger_ it's an example app in Mojo::FriendFeed
19:06 jberger_ the config file is in the github repo but it doesn't ship that too cpan
19:06 jberger_ to
19:07 batman ok. i'll clone the github repo
19:07 jberger_ I didn't want people to fire up their own in our channel all the time
19:08 batman hehe.
19:08 azawawi jberger_: hi :)
19:08 batman can it do anything scare with my system that you know of?
19:08 jzawodn_ jberger_: we do have a couple remote workers, but the catch is they need to be in California.  (I'm one of them, actually.)
19:08 jzawodn_ taxes, accounting, grumble, grumble
19:09 basic6 joined #mojo
19:12 batman jberger_: is deps => qr/^Mojo/ a good regex?
19:12 batman hm... i guess "Mojolicious"
19:13 jberger_ azawawi: o/ long time no see
19:14 jberger_ batman: not sure, but, your server your pattern I guess
19:14 batman jberger_: oh! i saw the mojo.conf now :)
19:15 jberger_ also, deps isn't tremendously reliable
19:15 azawawi jberger_: im back in #pdl
19:15 jberger_ it relies on metacpan but friend feed is faster than metacpan
19:17 basic6_ joined #mojo
19:18 azawawi jberger_: can we talk in #pdl?
19:19 jberger_ jzawodn_: Chicago :(
19:20 jzawodn_ yeah, sigh.  I've made my feelings known about our state boundary problem for employment
19:20 jzawodn_ I keep pushing on the issue as I can
19:24 cpan_mojo joined #mojo
19:25 jberger_ jzawodn_: I won't commit obviously, but if you are having trouble finding people and you get that restriction lifted I would be VERY interested
19:27 cpan_mojo joined #mojo
19:27 basic6 joined #mojo
19:28 batman last time now :P
19:28 cpan_mojo joined #mojo
19:28 batman almost like i have to make a new Mojo::Redis release just to test cpan_mojo :)
19:29 azawawi_ joined #mojo
19:29 batman thanks jberger_ :)
19:30 azawawi_ left #mojo
19:32 jberger_ batman: hopefully it will be more stable for you
19:32 cpan_mojo Mojolicious-Plugin-CGI 0.10 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-CGI-0.10
19:32 batman depends on the bug
19:33 jberger_ if not I would be interested if you have any ideas
19:33 jberger_ the script code is pretty simple, when you have a chance, take a look
19:33 batman i got it running with "single" in crontab, so if it actually dies, it will get restarted
19:33 batman i will if it dies :)
19:34 jberger_ but convos doesn't need that
19:34 batman doesn't need what?
19:34 batman single?
19:34 purl single is faster.
19:37 jberger_ batman: doesn't need external restarting
19:37 jberger_ anyway batman++ # hosting cpan_mojo
19:38 batman i do that for convos as well, but i've never actually needed it :P
19:45 jberger_ batman: I was hosting both on the sane box
19:45 jberger_ same
19:45 jberger_ convos was solid, cpan_mojo was not
19:46 batman i see
19:49 jzawodn_ jberger_: yeah. I know of like 4-6 people we could easily hire if geography became a non-issue
19:53 marcus jzawodn_: hire sri! :)
19:53 jzawodn_ yes!
19:54 basic6_ joined #mojo
19:55 sri hire me!
19:55 marcus junior artist in residence \o/
19:55 * sri paints marcus blue
19:56 jzawodn_ there goes that artist temper again...
19:57 moritz anybody need a Perl job? :-)
19:57 neyasov joined #mojo
19:58 * marcus floats away into the sky
20:00 woz joined #mojo
20:02 basic6 joined #mojo
20:04 * marcus is getting drunk, on an ordinary thursday.
20:04 marcus First I found a bottle of my homebrew from january. And then we made a pretty stiff G/T while watching Outlander.
20:08 basic6_ joined #mojo
20:11 fhelmber_ joined #mojo
20:13 Akron joined #mojo
20:14 Akron marcus: Feel free to feel german - in that case it's not an ordinary thursday.
20:14 basiliscos joined #mojo
20:17 basic6 joined #mojo
20:23 basic6_ joined #mojo
20:26 marcus Akron: Feels good to feel german.
20:30 basic6 joined #mojo
20:33 Akron :)
20:34 Akron Although our national holiday is one of those rare holidays not everybody gets drunk ... don't know why.
20:39 basic6_ joined #mojo
20:48 basic6 joined #mojo
21:02 woz joined #mojo
21:07 dvinciguerra_ joined #mojo
21:08 Akron joined #mojo
21:13 cpan_mojo Mojolicious-Plugin-BootstrapHelpers 0.0185 by CSSON - http://metacpan.org/release/CSSON/Mojolicious-Plugin-BootstrapHelpers-0.0185
21:18 basiliscos joined #mojo
21:35 sri anyone know how PG_OLDQUERY_WAIT actually works?
21:40 sri oh, i might get it
21:40 disputin joined #mojo
21:41 sri you can prepare multiple async statements, but not execute them at the same time
21:41 sri i might be able to use that for an operation queue
22:00 * ralesk_ scrolls back and is glad sri encountered Postgres Time Stuff :)
22:01 marcus oh shit, cpan_mojo has batman's avatar now. That's going to be annoying
22:03 woz joined #mojo
22:04 sri hmm
22:07 sri somehow i can now fake concurrent selects on the same dbh, but that fricking PG_OLDQUERY_WAIT doesn't seem to do anything Oo
22:07 sri https://gist.github.com/anonymous/6911e071b2bdb386a252
22:10 jberger_ moritz: what's the gig?
22:10 purl the gig is a lot of downlaod
22:26 marty joined #mojo
22:31 dvinciguerra_ joined #mojo
22:35 davido___ joined #mojo
22:54 davido__ joined #mojo
23:02 davido___ joined #mojo
23:04 woz joined #mojo
23:18 berov joined #mojo
23:44 bpmedley joined #mojo

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