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

IRC log for #mojo, 2014-12-16

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

All times shown according to UTC.

Time Nick Message
00:00 * jberger curses vestigial organs
00:09 linagee how do I change pid_file for mojolicious::lite
00:10 linagee why do half my questions seem related to mojolicious::lite. :( maybe I should use the "big boy's" mojolicious. hahha.
00:10 linagee ah, its a hypnotoad setting, n/m
00:12 Grinnz_ yeah it does sound like you should just make a full app already :P
00:23 jberger cfedde: once again, almost no difference between the two
00:23 jberger but yes as soon as you are doing anything non trivial, use full
00:23 * cfedde & commute
00:35 linagee why does this not seem to set a default route? any '/(*)' => sub {    shift->render( text => 'Access denied (404)' );  };
00:35 linagee I go to the / page and it doesn't come up, weird. (but /anything does work)
00:36 linagee ah, I guess this is what the documentation says, so I'll use that. :)   $r->any('/*whatever' => {whatever => ''} => sub {
00:36 Grinnz_ https://metacpan.org/pod/Mojolicious::Guides::Routing#Optional-placeholders
00:36 jberger linagee: exactly
00:36 Grinnz_ yep
00:36 linagee (makes sense, allows the default variable)
00:52 disputin joined #mojo
01:09 good_news_everyon joined #mojo
01:09 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/zy43ag
01:09 good_news_everyon mojo/master b17b998 Sebastian Riedel: a few more collection examples
01:09 good_news_everyon left #mojo
01:26 linagee What's the best way to use Mojolicious::Plugin::PODRenderer? Modify it and make it into my own module?
01:26 linagee (because I want to exclude/include certain documentation/do other fancy things.)
01:33 neyasov_ joined #mojo
01:56 hshong joined #mojo
02:08 akhasanov joined #mojo
02:09 klapperl joined #mojo
02:15 Ptolemarch joined #mojo
02:43 Eke- joined #mojo
03:02 woz joined #mojo
03:05 noganex_ joined #mojo
03:44 jzawodn joined #mojo
03:46 bpmedley http://onlytelecommute.com/  <— Fairly basic, yet functional.. :)
04:08 jzawodn joined #mojo
04:18 linagee is there a way to change the server string from "Mojolicious (Perl)"?
04:19 linagee Aha. Mojo::Headers
04:24 linagee wait, that's request headers...
04:24 preaction should be response headers too
04:25 linagee found it! how evil.
04:25 linagee hard coded!
04:25 linagee Mojo::Server::Daemon in _build_tx
04:29 preaction i might offer "why do you want to change that?" and "are you ashamed of us?"
04:29 linagee preaction: I take it as a security risk
04:29 linagee I think if they hard coded it because they thought I'd be ashamed, that's just silly and dumb security practices.
04:29 preaction then it should be settable by the constructor
04:30 preaction feature request!
04:30 purl feature request is that I need to be able to specify a particular database template in the Postgres driver
04:30 linagee it *should* be, sure. its not.
04:30 preaction purl: forget feature request
04:30 purl preaction: I forgot feature request
04:31 linagee oh crazy. I can just override the method like this? http://stackoverflow.com/questions/9583159/how-to-overwrite-a-function-used-in-a-module-method
04:32 linagee sub Mojo::Server::Daemon::_build_tx { ... }
04:32 linagee nice. muhahaha. :)
04:33 preaction sure, but if you'd make a feature request on the mojo github, it won't be completely destroyed when you overrode a private method
04:34 preaction or even having a $ENV{MOJO_SERVER_NAME} override or something, who knows
04:34 crab just use a hook
04:34 * preaction kicks himself
04:34 linagee crab: a hook? how that does work?
04:35 linagee awesome. I was able to kill the server string! :)
04:36 crab congratulations, your app is now secure
04:37 linagee so secure, that when that function gets updated... lo.
04:37 linagee lol.
04:37 linagee everything will break. :)
04:37 linagee I guess I could change the function in the system library to pull something in from the constructor, but then I'd have to repackage for all servers. what a pain.
04:38 good_news_everyon joined #mojo
04:38 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/rnOFgg
04:38 good_news_everyon mojo/master 2adf68b Sebastian Riedel: fixed RFC links
04:38 good_news_everyon left #mojo
04:39 sh4 joined #mojo
04:40 preaction why are you going through all these hoops before just asking for the feature?
04:41 linagee because that takes lots of time. who says I'm not doing both? :)
04:41 preaction you can make your deploy process find all the Mojo/Server/Daemon.pm and replace the string inside
04:41 linagee I have to wait for someone to approve it in github, I have to wait for it to funnel down to my dist's binary...
04:41 preaction dist's binary? it's pure perl
04:41 linagee .deb
04:41 preaction cpan
04:42 linagee preaction: our admin doesn't understand that. :P
04:42 preaction then make a .deb out of the cpan tarball, or just local::lib it
04:42 linagee I am essentially making a local::lib out of it. :)
04:42 preaction but... .deb
04:42 linagee for that one function. :)
04:43 linagee you're saying maintain an entire library and keep that up to date instead of maintain one function?
04:43 preaction i'm saying deploy your prereqs alongside your code using cpan and local::lib
04:44 linagee I guess the counter argument of that is: but the maintaince of the first one could be automated! (if only I had infinite hours)
04:44 linagee preaction: too bad they just didn't put it in a constructor like what would make sense.
04:44 linagee Apache has it overridable.
04:45 preaction because apache is riddled with holes. indeed, that's one of its features
04:47 jberger linagee: did you try with a hook?
04:47 jberger subclassing private methods is evil
04:47 linagee jberger: I don't know how. :(
04:48 jberger did you find it in the docs?
04:49 linagee that module's docs doesn't say how to change the server header
04:50 linagee (and its not obviously conditional in any way)
04:51 good_news_everyon joined #mojo
04:51 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/xtq6vw
04:51 good_news_everyon mojo/master 4c677d5 Sebastian Riedel: added another hook example
04:51 good_news_everyon left #mojo
04:52 preaction linagee: see the latest commit from the bot. it has an example
04:52 preaction sri++
04:53 sri he's using like... mojolicious 3.x... not a clue if it works there
04:53 linagee 5.54
04:54 linagee was using 3.x, found if I turned off HTTPS it works fine.
04:54 linagee (will have to do HTTP->HTTPS in haproxy or apache)
04:54 linagee (and live with a small amount of insecurity as the bits go around in the server's memory)
04:56 linagee preaction: you are a genius. that works like magic. :)
04:56 preaction i'm not. sri wrote it
04:56 linagee sri: you are a genius, that works like magic.
04:57 linagee fewer lines in code, less breaky of things in the future...
04:57 linagee less ugly!
04:57 purl less ugly is a benefit IMO :)
04:57 linagee if I put it as shift->res>headers, will you guys get mad at me? :)
04:58 sri yes, because that's a syntax error
04:58 jberger hahaha
04:58 jberger not is you turn strict off!
04:58 sri that escalated quickly
04:59 linagee jberger: use strict doesn't seem to care... weird.
04:59 jberger strict is on in mojolicious apps
04:59 * linagee turns sri's masterpiece into a frankenstein monster... :)
04:59 linagee app->hook(after_dispatch => sub { shift->res->headers->remove('Server'); });
05:00 linagee (but left the comment in place of course! how in the world would you know what it does without that. :) )
05:00 jberger erm ....
05:00 * jberger holds tongue
05:01 sri that's actually how i would have written it in an app too
05:01 linagee sri: /s?
05:01 purl somebody said /s was for treating the target string as a "single" line or a nop
05:02 sri no wait, i would have used the hook function
05:02 alnewkirk joined #mojo
05:02 sri http://mojolicio.us/perldoc/Mojolicious/Lite#hook
05:02 linagee lol. :)
05:02 linagee thank you
05:02 linagee jberger: I see why you were holding your tongue now. :)
05:03 jberger close enough
05:04 linagee close enough:
05:04 linagee hook after_dispatch => sub { shift->res->headers->remove('Server'); };
05:04 linagee weird. I broke some part of Mojo::Util that's feeling pain now. lol.
05:05 linagee Use of uninitialized value within @_ in anonymous hash ({}) at /usr/share/perl5/Mojo/Util.pm line 412.
05:05 linagee _stash? hrm.
05:05 linagee I guess it could be some other part of my code.
05:09 linagee hrm, this gets rid of the error, not sure if there's a better way of renaming headers.
05:09 linagee hook after_dispatch => sub { my $h = shift->res->headers; $h->remove('Server'); $h->add('Server' => ''); };
05:09 linagee (I tried ->change
05:09 linagee )
05:10 linagee sorry, that didn't fix it... :(
05:10 linagee might be something else in my code.
05:11 linagee yep, its definitely my code. commented everything else out except static serving.
05:12 linagee found it. :)
05:29 preaction i just decided that i now hate the camel logo for Perl, and the onion logo is only scarcely better...
05:30 jberger velociraptor
05:30 preaction the camel is _horrible_ as a logo. the onion is at least recognizable at 40px
05:53 Ptolemarch joined #mojo
06:02 woz joined #mojo
06:10 preaction I may have done a stupid thing with Mojolicious::Static and the reply->static helper: https://github.com/preaction/Statocles/commit/b12156913ef924afdef222161e9b5b449151d5c9
06:12 preaction reply->asset won't automatically set content-type response headers for you, but reply->static will. so i check if the file exists with $self->static->file( $path ), then if not, try $path . "/index.html", but i still use the static helper to serve the file. is that acceptable?
06:25 rem_lex joined #mojo
07:03 Eke- joined #mojo
07:11 oetiker batman: mojolicious  5.69
07:11 oetiker batman: Mojo::SNMP 0.08
07:12 oetiker batman: want a demo script ?
07:22 dod joined #mojo
07:25 dod joined #mojo
07:42 Ptolemarch joined #mojo
07:51 woz joined #mojo
07:54 fhelmberger joined #mojo
08:15 eseyman joined #mojo
08:15 Vandal joined #mojo
08:22 trone joined #mojo
08:31 batman oetiker: yes please. and a ticket.
08:32 batman did the other fix work for you?
08:35 woz joined #mojo
08:37 disco joined #mojo
08:42 sugar joined #mojo
09:07 basiliscos joined #mojo
09:21 Adura joined #mojo
09:31 Ptolemarch joined #mojo
09:42 Adura Installing 5.69 fails on Strawberry 5.20.1 when Net::DNS::Native is also installed: http://pastie.org/9783642
09:52 Snelius Adura: pls wait, we test it now.
10:03 amon joined #mojo
10:08 Oleg joined #mojo
10:08 Oleg Adura: can confirm, will try to understand what's going on
10:08 Adura Gotcha.
10:34 franzkafka joined #mojo
10:35 franzkafka any possibility of making Mojo::UA croak if scheme eq 'https' and IO::Socket::SSL is not installed?
10:37 franzkafka Also, as far as Mojolicious plugins go, I assume it's probably not best practice for them to croak on exceptions?
10:38 franzkafka Maybe set an error accessor or something?
10:44 basiliscos1 joined #mojo
10:46 oetiker batman: yes the other bit is perfect
10:46 Oleg Adura: looks like this is IO::Socket::IP bug https://gist.github.com/olegwtf/ebfc9dcadb98eafe2216
10:46 batman oetiker: sweet :)
10:46 Oleg Adura: can you confirm that this test script fails for you too?
10:46 oetiker batman: so for testing ... do you have a mockup snmp service, or how do you deal with this ?
10:47 batman i start "snmpd"
10:48 oetiker $self->snmp->get_bulk($host,{},[$oid],sub{ nonexisting() });
10:48 oetiker is all it takes
10:48 oetiker will assume snmpd is running on localhost
10:48 oetiker I would assume that $self->snmp->on(error => sub { ... }); would trigger
10:58 sugar_ joined #mojo
11:09 neyasov_ joined #mojo
11:18 irq joined #mojo
11:19 Ptolemarch joined #mojo
11:23 batman oetiker: no. The error should be the first argument to the callback
11:23 batman Second. ($smmp, $err,...)
11:31 Adura Oleg, can't connect in 10 sec.
11:42 Oleg what is a line length limit if I want to hack on some mojo source code? does anybody know?
11:43 Oleg got it: 79 characters
11:44 sugar__ joined #mojo
11:57 Kripton joined #mojo
12:03 Oleg Adura: found it https://github.com/kraih/mojo/pull/719
12:21 Adura Eeenteresting.
12:23 Adura I looked at the testers first, but I assume they don't ever consider if the optional modules are installed.
12:23 Lee joined #mojo
12:24 Oleg btw, we saw fail report like your on cpan testers before
12:24 Oleg but didn't know what is a reason
12:24 Adura Oh, guess I didn't look at enough versions.
12:27 Lee joined #mojo
12:34 ashimema joined #mojo
12:54 Lee_ joined #mojo
12:59 asarch joined #mojo
13:08 Ptolemarch joined #mojo
13:12 neilhwatson joined #mojo
13:16 sugar joined #mojo
13:43 ignacio_ joined #mojo
13:45 mattastrophe joined #mojo
13:58 good_news_everyon joined #mojo
13:58 good_news_everyon [mojo] kraih pushed 2 new commits to master: http://git.io/bOdTlQ
13:58 good_news_everyon mojo/master 98b821c Oleg: specify `socktype' option for getaddrinfo() to get predictable result
13:58 good_news_everyon mojo/master 8c8e042 Sebastian Riedel: Merge pull request #719 from olegwtf/master...
13:58 good_news_everyon left #mojo
14:07 Ptolemarch joined #mojo
14:14 sri can anyone make sense of this? https://github.com/kraih/mojo/issues/720
14:19 pp joined #mojo
14:19 pp left #mojo
14:21 odc hmm, it's the same data::dumper version that i use and i never had this issue
14:26 odc i can't reproduce it :/
14:32 odc i can't test without libev though
14:59 sri odc: of course you can, MOJO_REACTOR=Mojo::Reactor::Poll
15:03 odc sri, oops! i forgot about that one
15:03 odc anyway, when i disble libev, I can't find "Mojo/Reactor/EV.pm" => undef in the dump
15:04 sri what versions?
15:04 purl versions are perls biggest Crap Ever or set automatically
15:05 odc EV 4.0+                 (4.15)
15:05 odc i also have IO::SOcks and IO::SSL
15:05 sri that's the one version i don't care about ;p
15:05 odc it's mojo 5.68
15:05 sri mojo, perl and dd
15:06 odc it's perl 5.14.2
15:06 odc the debian version
15:06 odc same for DD
15:06 odc just like in the bug report
15:10 Ptolemarch joined #mojo
15:10 good_news_everyon joined #mojo
15:10 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/jzrCKQ
15:10 good_news_everyon mojo/master 7ce419f Sebastian Riedel: updated Changes
15:10 good_news_everyon left #mojo
15:11 odc sri, do you know how is it possible to have "Mojo/Reactor/EV.pm" => undef in %INC ?
15:15 sri no
15:16 sri but apparently there's some plugin involved... so i'm rather sceptical of the report now https://github.com/kraih/mojo/issues/720#issuecomment-67171024
15:18 akhasanov joined #mojo
15:33 sh4 joined #mojo
15:36 Grinnz "dumper plugin"?
15:36 Grinnz lol
15:41 odc then again, DD 2.130 is from 2011 and there have been many bug fixes since then. The latest version even fixes a CVE security bug
15:41 odc https://metacpan.org/changes/distribution/Data-Dumper
15:42 odc but clearly this guy has a bad environment
15:42 genio status=$(ethtool ${index} | grep Link | cut -d':' -f 2 | sed -e 's/^\s*//' -e 's/\s*$//' -e 's/\s\s*/ /')
15:42 purl Since Sat Nov  8 22:47:22 2014, there have been 2198 modifications and 703 questions.  I have been awake for 37 days, 16 hours, 55 minutes, 15 seconds this session, and currently reference 973438 factoids. Addressing is in optional mode.
15:42 genio oops.  errant paste.
15:43 mst odc: undef means "failed to load"
15:43 odc oh i didn't know that
15:45 mst basically eval { require Foo } where Foo exists on disk but doesn't load successfully
15:45 mst results in a Foo => undef entry in %INC
15:46 mst sri: ^^
15:49 neyasov_ joined #mojo
15:50 odc >Make Data::Dumper UTF8- and null-clean with GVs
15:50 odc mst, how would you interpret that? ^
15:52 mst I would interpret it as somebody reading the changelog and guessing randomly
15:53 mst until the user actually tells us what they did, there's not a lot to be done
15:53 * odc hides
15:59 Ptolemarch joined #mojo
16:16 juikuen joined #mojo
16:46 disputin joined #mojo
17:22 sri oh, mongodb bought wiredtiger Oo http://www.mongodb.com/press/wired-tiger
17:22 mst wtf even *is* wired tiger?
17:23 sri apparently the new sleepycat
17:23 mst right
17:24 mst my 'mysql 3.23 without innodb' comparison suddenly got even more accurate
17:24 sri of course the query planner also sucks in mongodb
17:26 sri at least it can now use 2 indexes in 2.8
17:26 mst ...
17:30 Adura joined #mojo
17:30 sh4|2 joined #mojo
17:33 juikuen Hi, can you help me out with some info/links about password hashing in Mojo? Please.
17:35 bwf joined #mojo
17:37 mst juikuen: Authen::Passphrase DBIx::Class::PassphraseColumn
17:37 juikuen up to date and good practice, though
17:37 juikuen aha
17:37 juikuen ok
17:38 juikuen will check out, thanks
17:38 odc i use Crypt::ScryptKDF
17:38 odc pretty great
17:38 odc XS though
17:40 mst I'd tend to use a bcrypt or scrypt backend
17:40 mst but Authen::Passphrase is a nice uniform interface
17:45 genio I've been using Mojolicious::Plugin::Bcrypt
17:46 mst ah, yet another nonsense module because you can't possibly do things without inventing framework-specific plugins
17:46 mst still not as funny as Catalyst::Plugin::DateTime though
17:47 sri btw. i'm still waiting for that monte cristo sandwich jberger :O
17:53 Ptolemarch joined #mojo
18:09 amon joined #mojo
18:13 * Grinnz_ just uses Crypt::Eksblowfish::Bcrypt
18:15 mst Grinnz: Authen::Passphrase's bcrypt backend uses that anyway
18:15 mst it's just a nice uniform interface
18:15 * Grinnz_ is wondering whether MetaCPAN/PAUSE will actually ever send the email to link his account
18:15 mst and more future proof
18:15 Grinnz_ cool
18:16 mst cpan.org mail uses greylisting
18:16 Grinnz_ considering my use of the module is about 10 lines of code, i'm not too concerned ;)
18:16 mst may take a little while to turn up
18:16 mst Authen::Passphrase stores the crypt type along with the crypted stuff
18:16 mst so if you ever need to change schemes later, it Just Works
18:16 Grinnz_ right, any bcrypt does; the trouble is we need to support existing md5'd hashes, so that has to be checked separately anyway
18:16 akhasanov joined #mojo
18:17 * Grinnz_ idly wonders how many active accounts still havent changed their password
18:18 * genio guesses 82%
18:19 mst Grinnz: ah, right. I try and get people to use Authen::Passphrase from the start so they don't have that problem in the first place :)
18:20 Grinnz_ mst: you have to realize, "from the start" was years before I was employed, and was probably done by some CPAN module that had no concept of security
18:21 mst oh, I'm sure
18:21 mst I'm just explaining why I'm recommending Authen::Passphrase to people asking for a recommendation now
18:21 mst and why I think that's superior to using one of the Crypt:: modules directly
18:21 Grinnz_ sure
18:22 mst you have to realize I don't give a fuck about your codebase, and it's completely irrelevant to the question of giving good advice to newbies :D
18:22 mst apart from "don't do what we did"
18:22 Grinnz_ :P
18:22 mst which tends to be the lesson from most codebases
18:22 Grinnz_ 47 accounts have been logge dinto in the last month and are still using an old password
18:22 Grinnz_ not as bad as i thought
18:48 jberger sri: you are trying to kill me, right?
18:49 mst making a sandwich isn't normally fatal
18:49 mst if it is, I think you're probably doing it wrong
18:50 jberger the suspicion is that my gall bladder has turned against me, so actually ....
18:52 Grinnz_ jberger: the gall!
18:52 purl the gall is, like, that yellowish thing you can sometimes see in the poo
18:52 jberger thank you purl, blunt as ever
18:52 Grinnz_ really, you have a factoid for that
18:52 Grinnz_ really
18:56 meredith i had mine popped out a few years ago; i was up all night with a weird ache like right under my rib and by the time 8a rolled around i woke my bf up to say "i'm driving to the hospital"
18:57 meredith later i got a text "where are you? did you really go to the hospital? i half remember.."
18:57 meredith he was on the ball
18:57 jberger hahaha, so, ... that guy was a keeper then ?
18:58 jberger I find out on thursday
18:58 Grinnz_ "did you say you went to the hospital? or the shopping mall?"
18:58 meredith it's more funny, than a failure on his part really. not like i got him to wake up completely or needed help
18:59 Grinnz_ i can sympathize with the only slightly lucid state he was probably in
18:59 meredith the hospital also didn't want me to drive myself home the next day, but i'm a stubborn ass so i let them call a cab then gave the cabbie 10 to drop me around the corner by my car.
19:00 Grinnz_ lol
19:00 jberger hahahaha
19:00 purl LOLCON 4 reached.
19:00 meredith good luck with the gall bladder though, hope it's not hurting you much now
19:01 mst meredith++
19:02 akhasanov joined #mojo
19:02 basiliscos joined #mojo
19:03 jberger meredith: rather uncomfortable, but I'll manage. thanks
19:03 jberger my zeal for king and country keeps me going
19:04 jberger :-P
19:09 Grinnz_ mst: so when you said the email could take a while... like, hours? or days?
19:11 * sri had problems with peptic ulcers and can relate
19:12 jberger no fun
19:12 jberger sri: permission to just close #720?
19:13 sri yea
19:14 mst I suspect it's a genuine Dumper bug, but if he won't show us the code then there's very little to be done
19:15 jberger mst: probably
19:15 Eke- joined #mojo
19:18 sri #717 is another candidate... i've added a self-contained test case so more people can try it https://github.com/kraih/mojo/issues/717#issuecomment-67215057
19:19 Grinnz_ giving it a try... cant try on my server though, cause of the use 5.12.0 :P
19:21 Grinnz_ it passes on my other server...
19:22 sri the use 5.12.0 serves no purpose
19:23 Grinnz_ ah true
19:25 Grinnz_ well, on my 5.10.1 server it fails
19:25 Grinnz_ interesting
19:26 Grinnz_ same result as he shows, undef
19:26 dod joined #mojo
19:27 Grinnz_ and the "Premature connection close" comment
19:27 Grinnz_ perhaps his "desktop workstation" is using an older perl?
19:30 sri passes with 5.10.1 for me
19:31 Grinnz_ i havent gotten it to pass yet...
19:31 oetiker batman: the testcase for the Mojo::SNMP callback issue I was talking about is here https://github.com/jhthorsen/mojo-snmp/issues/6
19:31 Grinnz_ how can we narrow this down?
19:32 sri well, then you're in a unique position to track it down
19:32 Grinnz_ except i have no idea where to start :D
19:32 sri well, you figure out why there's a premature connection close
19:33 sri something triggers it, and it shouldn't
19:34 sri answer should be somewhere in Mojo::IOLoop::Stream/Mojo::Server::Daemon/Mojo::UserAgent/Mojo::Transaction
19:35 sri first thing i would do is figure out if there's some socket error https://github.com/kraih/mojo/blob/master/lib/Mojo/IOLoop/Stream.pm#L98
19:35 sri then i would try to track down what trigger the connection close
19:36 sri and then how it connects to the excessively large request body
19:36 Grinnz_ alright... ill look at that tonight probably, thats a little too indepth to do from work
19:48 irq joined #mojo
19:53 asarch joined #mojo
19:54 jberger Grinnz_: what os?
19:56 Grinnz_ Centos 6.6
20:19 woz joined #mojo
20:26 akhasanov joined #mojo
20:43 Grinnz_ JHTHORSEN is one of you guys right?
20:43 Grinnz_ i need a APNS module and Mojo::APNS came up...
20:44 linagee is an ORM a good idea to help creation of a REST interface with Mojolicious, or a bad idea?
20:48 Grinnz_ sri: you mentioned before using EV then POE and Mojo::IOLoop could be used together somewhat..?
20:48 Grinnz_ cause i might be doing something like this to use Mojo::APNS...
20:50 Grinnz_ on second thought... i'm not sure i want to mess with that
20:55 jberger Grinnz_: that's batman
20:55 Grinnz_ aha
20:55 jberger linagee: its a fine idea
20:55 jberger most are blocking, but if you can live with that
20:56 Grinnz_ if i could use POE's event loop as the event loop for the ioloop that would be perfect...
20:57 jberger Grinnz_: I'm not aware of a Mojo::Reactor::POE
20:57 jberger but if it works with AnyEvent, then the EV reactor should get you there
20:57 * Grinnz_ really doesn't want to touch AnyEvent
20:58 jberger otherwise, I volunteer you to write Mojo::Reactor::POE
20:58 Grinnz_ heh
20:58 jberger its not that hard
20:58 Grinnz_ maybe if i had any idea what i was doing :P
20:58 jberger best way to learn
20:58 purl well, best way to learn is to try.
20:58 Grinnz_ :P
20:58 * jberger pats purl
20:58 purl don't mess with me
20:58 Grinnz_ hahaha
20:59 Grinnz_ well unfortunately, i need to get APNS working faster than it would take me to figure out something like that
20:59 jberger you can use Mojo::IOLoop on its own
21:00 Grinnz_ thats what i was thinking... i dont need to keep any of these connections open, i just need to push a notification
21:00 Grinnz_ well
21:00 jberger you already have some larger application using POE?
21:01 Grinnz_ yes, thats the problem
21:01 jberger pushing a notification is easy
21:01 Grinnz_ and it's not getting converted to Mojo::IOLoop unless a lot of features get implemented :P
21:01 Grinnz_ particularly Wheel::Run
21:01 jberger use POE::Wheel::Run to start a fork and use Mojo::IOLoop and Mojo::APNS to send the notification
21:02 Grinnz_ i was just sthinking something like that... starting a Mojo::IOLoop in the fork probably would work
21:02 jberger Grinnz_: wasn't it you looking at Mojo::IOLoop::ForkCall the other day?
21:02 Grinnz_ yes
21:02 Grinnz_ Wheel::Run is needed for the async stdout and stderr though
21:02 jberger anyway, yeah, start the ioloop in the fork and you are set
21:03 jberger you need two way communication with the children?
21:03 Grinnz_ no, i just need to know as soon as it gets a line of output
21:03 jberger Mojo::IOLoop::ReadWriteFork
21:03 Adura joined #mojo
21:04 jberger is the child done when it gets the line of output?
21:04 Grinnz_ no
21:04 jberger yeah, then see ReadWriteFork
21:04 jberger or stick with Wheel for the time being
21:04 Grinnz_ essentially, i'm running ssh commands, and i have actions performed (for some of them) for every line of output i get back
21:05 Grinnz_ because these ssh commands take several minutes sometimes
21:05 Grinnz_ actually one of them runs for 2 days, but that doesn't record the output :P
21:22 disputin joined #mojo
21:25 stryx` joined #mojo
21:31 nebulous joined #mojo
21:31 nebulous is there an automated builtin for decode_json($c->req->body) ?
21:31 jberger hahahaha
21:31 purl LOLCON 4 reached.
21:32 jberger sorry, I'm reaching a weird state of existence atm
21:33 jberger http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#JSON-web-services
21:35 * nebulous facepalms
21:35 purl facepalms are certainly another important measure
21:36 Grinnz_ indeed.
21:37 tempire joined #mojo
22:13 depesz joined #mojo
22:13 depesz hi
22:14 depesz when I finish handling given request in it's controller method, I'd like to continue in another method. Kinda like redirect_to(), but without http redirect.
22:14 depesz how could I achieve that?
22:16 Grinnz_ call the other method
22:17 Grinnz_ controller is just a regular class
22:17 depesz background. I have page which renders some information, which it gets from database, and has a form for adding new information. when I submit new info, there is post request to "register new data" controller. in case it was added ok, i want to just do redirect_to the first page, but if it failed, i want to call the other controller internally, so it will gather all needed info.
22:17 depesz ah. didn't think about that. thanks.
22:18 Grinnz_ hm, not if its a different controller though
22:18 mst in that case, refactor, maybe use a role or a superclass, or maybe more logic needs to go into the model
22:22 depesz Grinnz_: it's the same controller.
22:44 depesz left #mojo
23:18 woz joined #mojo
23:19 good_news_everyon joined #mojo
23:19 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/f9LEKA
23:19 good_news_everyon mojo/master dee50a7 Sebastian Riedel: fixed a few limit bugs in Mojo::Message
23:19 good_news_everyon left #mojo
23:20 sri not sure if that's the correct way to handle the message size limit
23:26 sri argh... this one is getting a bit silly https://github.com/kraih/mojo/issues/721#issuecomment-67252050
23:38 good_news_everyon joined #mojo
23:38 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/DakORg
23:38 good_news_everyon mojo/master 6c95141 Sebastian Riedel: just stop parsing on errors
23:38 good_news_everyon left #mojo
23:39 sri before the last two commits there was a possibility that even the first chunk would not be parsed if it exceeded the limit
23:40 sri we read chunks of up to 128kb
23:40 sri so if the first 128kb hit a limit, not even the start line would be extracted
23:42 sri it seems much more likely that you're interested in what the start line has to say than avoiding to put 128kb in a buffer
23:43 jberger commented on #721
23:43 sri jberger++
23:43 jberger I'm sorry the guy spent 6hrs on this, but maybe he should have moved on
23:45 jberger see if he responds, if he doesn't by tomorrow I say close it
23:45 jberger I don't want to appear like a jerk, but seriously, this is the definition of "not our problem"
23:46 sri oops, i've closed it... after remembering the FAQ answer
23:46 jberger I'm really thinking we should move to at least 5.16 soonish
23:46 jberger there is so much nice
23:47 jberger __SUB__ and /r would both probably be very useful
23:47 * sri hopes jberger doesn't get assassinated for that proposal
23:47 jberger as long as they shoot me in the gall bladder, I'm game
23:54 good_news_everyon joined #mojo
23:54 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/jSlUXg
23:54 good_news_everyon mojo/master 73e2515 Sebastian Riedel: a few more tests
23:54 good_news_everyon left #mojo
23:54 * sri is almost certain #717 is some sort of timing bug

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