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

IRC log for #mojo, 2014-07-02

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

All times shown according to UTC.

Time Nick Message
00:37 disputin joined #mojo
00:53 laouji joined #mojo
01:02 klapperl joined #mojo
01:03 good_news_everyon joined #mojo
01:03 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/W1sqnw
01:03 good_news_everyon mojo/master efd9831 Sebastian Riedel: link to stream method instead
01:03 good_news_everyon left #mojo
01:07 neyasov joined #mojo
01:12 shmuel joined #mojo
01:12 nishttal2 joined #mojo
01:12 d4rkie joined #mojo
01:12 Averna joined #mojo
01:12 sugar_ joined #mojo
01:12 Negor joined #mojo
01:12 cooper joined #mojo
01:12 bluescreen joined #mojo
01:12 alnewkirk joined #mojo
01:12 kyshtynbai joined #mojo
01:12 Rallias joined #mojo
01:12 bobkare joined #mojo
01:12 Tiger joined #mojo
01:12 KCL joined #mojo
01:12 mishantil joined #mojo
01:12 dotan joined #mojo
01:12 phx joined #mojo
01:12 Insane joined #mojo
01:12 Bender joined #mojo
01:12 mr-foobar joined #mojo
01:12 rwp joined #mojo
01:12 marcus joined #mojo
01:12 cousin_luigi joined #mojo
01:12 Adurah_ joined #mojo
01:12 cpan_mojo joined #mojo
01:12 kbenson joined #mojo
01:12 komodo_ joined #mojo
01:12 inokenty joined #mojo
01:12 yko joined #mojo
01:12 Zx3 joined #mojo
01:12 voegelas joined #mojo
01:12 tempire joined #mojo
01:12 KindOne joined #mojo
01:12 cotto joined #mojo
01:12 tianon joined #mojo
01:12 sri joined #mojo
01:12 sjn joined #mojo
01:12 rofl_ joined #mojo
01:12 ceej joined #mojo
01:12 Claudio joined #mojo
01:12 d^_^b joined #mojo
01:12 priodev joined #mojo
01:12 oetiker joined #mojo
01:12 ua joined #mojo
01:12 da5id joined #mojo
01:12 callumgare joined #mojo
01:12 jberger joined #mojo
01:12 janus joined #mojo
01:12 memowe joined #mojo
01:12 elik joined #mojo
01:12 zz_Foxcool joined #mojo
01:12 jeff joined #mojo
01:12 allison joined #mojo
01:12 genio joined #mojo
01:12 sawtooth joined #mojo
01:12 lestrrat joined #mojo
01:12 charsbar___ joined #mojo
01:12 mikegrb joined #mojo
01:12 Ralesk joined #mojo
01:12 jzawodn joined #mojo
01:12 bjoernfan joined #mojo
01:12 mattp joined #mojo
01:12 diegok joined #mojo
01:12 mudler joined #mojo
01:12 rblackwe joined #mojo
01:12 preaction joined #mojo
01:38 neyasov joined #mojo
01:41 neyasov_ joined #mojo
01:45 laouji joined #mojo
01:53 laouji joined #mojo
01:59 klapperl_ joined #mojo
02:04 d4rkie_ joined #mojo
02:08 fhelmber_ joined #mojo
02:18 rwp joined #mojo
02:19 Ptolemarch joined #mojo
02:40 neyasov_ joined #mojo
02:40 btyler joined #mojo
02:44 d4rkie joined #mojo
02:59 KCL_ joined #mojo
03:13 basic6 joined #mojo
03:25 Ptolemarch joined #mojo
03:45 neyasov_ joined #mojo
03:55 laouji joined #mojo
04:00 d4rkie_ joined #mojo
04:08 jberger sri,  great thought! 5.x is shaping up to be the usability cycle i think
04:18 phx and will it be possible to do a HTTP negotiate kerberos authentication (perferably controlled on a per URI basis)? :)
04:21 sri USABILITY ALL THE THINGS!
04:32 dotandimet joined #mojo
04:40 d4rkie joined #mojo
04:50 laouji joined #mojo
04:55 neyasov_ joined #mojo
05:26 chankey joined #mojo
05:33 tempire http://www.youtube.com/watch?v=EiO9_PJ0h8Q
05:34 dotandimet joined #mojo
05:35 cousin_luigi $dom->find('img[src*="' . $offline . '"]')->parent->parent->remove; <- this fails when nothing is found.
05:35 cousin_luigi I don't quite understand why.
05:40 Insane Mojolicious is using session and stores cookie alwas, so... is there any way to get some unque ID for each client? sessionId or something similar...
05:46 davido_ joined #mojo
05:51 gatitskiy joined #mojo
05:55 gatitskiy Hi all. How to enable reverse_proxy atrr globally? I’m using Starman. MOJO_REVERSE_PROXY=1 not work
06:03 sujithm joined #mojo
06:05 neyasov_ joined #mojo
06:10 chankeypathak joined #mojo
06:12 Vandal joined #mojo
06:23 laouji joined #mojo
06:30 laouji joined #mojo
06:33 laouji joined #mojo
06:45 igorsutton joined #mojo
06:50 dod joined #mojo
06:50 laouji joined #mojo
06:59 mr-foobar joined #mojo
07:15 neyasov_ joined #mojo
07:23 trone joined #mojo
07:43 batman gatitskiy: you need to set it in the config. but you could do $app->config->{hypnotoad}{proxy} = $ENV{MOJO_REVERSE_PROXY} || 0;
07:44 gatitskiy I don't use hypnotoad
07:44 batman oh. sorry about that.
07:45 batman gatitskiy: which version of mojo do you have?
07:46 gatitskiy Now I use $self->req->reverse_proxy(1) in controller after $self->tx->remote_address, but I don't like it)
07:46 gatitskiy Last version 5.10
07:47 batman i don't get it. MOJO_REVERSE_PROXY=1 should work. do you know that starman actually reads the environment variable?
07:49 basiliscos joined #mojo
07:50 batman gatitskiy: try something like app->hook(before_dispatch => sub { app->log->warn("MOJO_REVERSE_PROXY=$ENV{MOJO_REVERSE_PROXY}"); }); just to see that it's actually set
07:52 D4RK-PH0ENiX joined #mojo
07:53 gatitskiy I'ts not a starman problem. Enviroment set correctly, I checked it.  Hypnotoad, Morbo and Daemon (native mojo servers) read env and pass it to application (for example https://github.com/kraih/mojo/search?q=reverse_proxy&amp;ref=cmdform)
07:54 gatitskiy But there is no solution for other servers like Starman
07:54 lb so, i've made some more people interested in hosting mojoconf next year in copenhagen
07:55 lb suckers
07:57 Jonis :D
07:57 Jonis make sure to have it close to a good pub
07:57 Ralesk :D
07:57 lb fsvo close that's no problem
07:58 Jonis :)
07:58 denis_boyun joined #mojo
08:03 mire joined #mojo
08:05 Insane what if I'm using nginx on top of hypnotoad, could I somehow ask nginx to check user uthorization using mojo? ;)
08:08 Insane e.g. I have 2 locations in nginx: / passes to hypnotoad and /files renders directory contants using nginx, and I'm thinking about include authorization into /files and check ->over(authenticated => 1) like mojo do
08:20 dpetrov_ joined #mojo
08:25 neyasov_ joined #mojo
08:46 sugar_ joined #mojo
08:50 batman gatitskiy: did you check it with the code i showed you? how did you check it?
08:51 gatitskiy $self->app->log->debug($ENV{MOJO_REVERSE_PROXY} ? 'REVERSE_PROXY' : 'NOREVERS_PROXY');
08:51 gatitskiy in controller
08:51 batman Insane: http://nginx.org/en/docs/http/ngx_http_auth_request_module.html # maybe something like that?
08:52 batman gatitskiy: did it say "REVERSE_PROXY" or not?
08:52 gatitskiy REVERSE_PROXY
08:53 fhelmber_ joined #mojo
08:53 batman and $c->req->reverse_proxy ?
08:54 edestler joined #mojo
08:57 batman gatitskiy: maybe i don't get what the problem is :/
08:57 gatitskiy $c->req->reverse_proxy if false
08:57 gatitskiy *is
08:58 Gedge joined #mojo
09:04 Dandre Hello,
09:04 Dandre I some of my tests I get this error:
09:04 Dandre (in cleanup) Can't call method "FILENO" on an undefined value at /usr/lib/perl/5.14/IO/Poll.pm line 48 during global destruction.
09:05 Dandre what should be wrong?
09:21 KCL joined #mojo
09:24 sujithm joined #mojo
09:26 mire joined #mojo
09:27 batman gatitskiy: oh! sorry. it is only set when running a daemon. Mojo::Server::PSGI does not care about that variable :/
09:27 batman gatitskiy: why are you using starman..?
09:33 denis_boyun joined #mojo
09:34 gatitskiy I use it for a long time :) I started to use it, when there were no hypnotoad. It's working fast. Why not? :) If I need websokets, I use hypnotoad, in other cases, use the Starman.
09:34 neyasov_ joined #mojo
09:39 denis_boyun joined #mojo
10:00 batman gatitskiy: because it doesn't allow you to do non-blocking. meaning you can only handle on request at-a-time. meaning it's eating resources
10:01 batman but i guess it's fine if you're only handle a couple of requests pr second and don't care to scale beyond that
10:02 batman gatitskiy: https://www.youtube.com/watch?v=nueYDGVQy8g
10:07 batman gatitskiy: i guess it's not quite to the point, but the thing is that non-blocking allow one process to handle more requests than you can fork
10:26 meshl joined #mojo
10:26 batman gatitskiy: sorry if i'm coming on a bit offensive :/
10:37 neyasov_ joined #mojo
10:40 crab so for many years i've wanted to see a scorpion
10:40 crab and today my gf found one IN OUR BED
10:41 crab so if i suddenly disappear from IRC, you may assume that i'm in hospital doped up on morphine
10:51 cousin_luigi crab: Better than some tart!
11:01 batman crab: wow! crazy... :)
11:08 dotandimet joined #mojo
11:11 crab i don't see how a scorpion could possibly be better than a nice tart. preferably a lemon tart.
11:11 * moritz reads "scorpion" and hums "wind of change"
11:17 crab next time a scorpion crawls into our house, i'll kill it with bad 80s rock
11:19 gatitskiy joined #mojo
11:20 cousin_luigi crab: tart as in "promiscuous young woman"
11:20 cousin_luigi you'd be in hot water with the missus, wouldn't you?
11:22 crab huh. so much for my attempt at subtlety.
11:26 cousin_luigi I don't know how regional that expression is
11:32 d4rkie joined #mojo
11:43 john joined #mojo
11:46 cousin_luigi crab: but since you're here
11:46 cousin_luigi (are you?)
11:46 jberger crab vs scorpion, epic battle of the invertebrates!
11:47 jberger crab is in India iirc
11:47 cousin_luigi I have http://pastie.org/private/fn8clytkraokq7bcemi5w and this is my code http://pastie.org/private/ljsnxf9jekv0lxyxxctwfq <- how do I replace the contents of ->parent->text instead of printing it?
11:48 phx left #mojo
11:50 jberger http://mojolicio.us/perldoc/Mojo/DOM#replace
11:50 * lb pokes marcus
11:51 jberger lb++
11:51 cousin_luigi jberger: thing is I'm very confused about the syntax
11:53 sujithm joined #mojo
11:53 crab ->find() the thing you want, call ->replace('something') on it
11:54 crab oh, you want the parent of the thing you find
11:54 cousin_luigi so $_->parent->text->replace('newtext') ?
11:54 d4rkie joined #mojo
11:55 cousin_luigi crab: yes
12:03 dotandimet joined #mojo
12:03 BinGOs crab++
12:12 ver joined #mojo
12:15 Dandre joined #mojo
12:19 powerman joined #mojo
12:20 powerman is it possible to throttle UserAgent to send no more than N simultaneous requests (to same website, or at all)?
12:22 powerman maybe somehow use ->on(start) to control this?
12:39 mire joined #mojo
13:03 john Lo all
13:04 john What the best design to use for handling long running jobs (ie > 5 mins)
13:04 john ie the user makes a request, hypnotaod trots off and does it, but it may take 5 mins+ to generate the result
13:05 john Something using websockets?
13:08 dotandimet joined #mojo
13:10 john I have the toad workers set to max client of 1.
13:11 john I suppose I could split the job up and use ajax to request each piece, but I'm guessing that would use all my workers up pretty quickly
13:13 moritz john: or use a proper task scheduler
13:13 moritz or job queue
13:13 purl job queue is ordered.
13:13 moritz people around here to like Minion
13:14 bjoernfan moritz++
13:14 john How best to tell the user the job has finished?
13:14 john websockets, or ajax polling?
13:15 moritz yes! :-)
13:15 moritz it really depends
13:15 moritz with websockets, you get faster answers, but you have to keep more connections open
13:15 john does the user have to stay on the same page for web sockets to work?
13:15 moritz yes
13:16 moritz with 5min+ jobs, I'd go for ajax polling
13:16 john so if I have 'toad with max client of 1 that means 1 worker per client per websocket?
13:16 genio 5min+ is pretty damn long.  Is there no way to cache that periodically and give the user slightly stale information?
13:17 john The web app is the front end to our internal systems. This can mean processing truck loads of files.
13:17 john I'm happy with the task scheduler approach.
13:17 john I do similar already, just inform the user via email, which isn't overly webbish :)
13:18 moritz john: you can send the email to a ticket system. Now you have an webbish interface! :-)
13:18 john heh :)
13:19 batman john: i would store the job id somewhere, so the client (web browser) can pull for status later on
13:19 batman somewhere = in the backend if the user has a profile, or in the cookie or in the url
13:19 batman everyone of those has drawbacks ^
13:20 mire joined #mojo
13:20 john Ok, so ajax polling is the way to go. If the user moves away from the page, should I try and maintain the polling or act as though they are no longer interested?
13:21 moritz john: act as though they aren't interested anymore
13:21 john I seem to be veering to a dedicated jobs page.
13:21 moritz john: and maybe have an extra page "overview of submitted jobs" or so
13:21 john :)
13:21 tomboh I'd go for whatever's easiest to code and change it if load becomes a problem
13:21 moritz we're in violent agreement, it seems
13:22 batman tomboh++
13:22 john yes!
13:23 john out of interest, (my app is db based, so blocks) what can go wrong with hving a toad client max of > 1?
13:23 batman db blocks
13:24 john so a worker is effectively max client of 1 anyway?
13:24 batman you're saying that you have a hypntoad process running with one worker?
13:25 good_news_everyon joined #mojo
13:25 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/mdK4Kw
13:25 good_news_everyon mojo/master dbe303b Sebastian Riedel: fixed "0" value bug in Mojo::UserAgent::Transactor (closes #641)
13:25 good_news_everyon left #mojo
13:25 john toad process of 20 workers, max client set to 1
13:25 batman no idea. i never fiddle with those settings. sorry :(
13:25 john or more accurately...
13:26 john clients 1
13:27 john I assume that as a worker blocks and therefore ignores more requests, it's the same as clients 1
13:28 john But I've been bitten by assumptions before :)
13:28 genio sri++ # killing bugs quickly.
13:31 hermob joined #mojo
13:32 neilhwatson joined #mojo
13:35 btyler joined #mojo
13:36 hermob hi.  whats the recomended way to inject helpers in a mojo app ?
13:39 moritz hermob: call $app->helper(...) in your startup method
13:40 hermob ok
13:40 bluescreen joined #mojo
13:41 john Does eventsource keep the connection open to the client like websocket?
13:42 john ignore that,
13:43 john I'll do a bit of googling first
14:15 good_news_everyon joined #mojo
14:15 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/3krL1w
14:15 good_news_everyon mojo/master dbcbb11 Sebastian Riedel: moved reverse_proxy attribute from Mojo::Server::Daemon to Mojo::Server
14:15 good_news_everyon left #mojo
14:17 disputin joined #mojo
14:33 crab sri: *grin*
14:33 crab (cgi post)
14:37 dotan joined #mojo
14:46 cousin_luigi I have http://pastie.org/private/fn8clytkraokq7bcemi5w and this is my code http://pastie.org/private/ljsnxf9jekv0lxyxxctwfq <- how do I replace the contents of ->parent->text instead of printing it? (yes, I did read the documentation, but I couldn't make heads or tails of it with this whole ->parent thing)
14:59 sri crab: yea :)
14:59 KCL_ joined #mojo
15:04 meshl joined #mojo
15:10 powerman left #mojo
15:16 mattastrophe joined #mojo
15:18 cousin_luigi oh, why didn't you tell me it was $_->parent->contents->first->remove; ?:)
15:31 tomboh joined #mojo
15:37 neyasov__ joined #mojo
15:38 davido_ joined #mojo
15:53 neyasov___ joined #mojo
15:54 neyasov___ joined #mojo
16:00 meshl joined #mojo
16:00 neyasov joined #mojo
16:07 mire joined #mojo
16:11 nmittal_ joined #mojo
16:12 nmittal_ I'm trying to get the url from $self->req->url->to_abs but it ignores the #test from (http://localhost:3000/?param=sdsd#test) and only returns http://localhost:3000/?param=sdsd
16:12 sri is this a recipe we want in the cookbook? http://pastie.org/9347308
16:13 * sri pokes tempire, jberger, crab and marcus
16:14 tempire it makes sense
16:15 tempire but it seems like it may be a little inaccessible to n00bs
16:15 sri i'm still not a "huge" fan of the convention, but it's the best we got in perl
16:15 sri tempire: feel free to make it more noob friendly
16:18 sri thing is, this translates basically to all classes, Mojo::UserAgent extensions can also easily be dollar underscore methods
16:19 sri mst: do you have a single sentence to explain it to beginners?
16:20 * crab reads
16:21 crab hmm
16:21 crab that looks hideous
16:22 sri it's not like we have alternatives
16:22 sri and dollar underscore methods are becoming a thing on cpan https://metacpan.org/pod/Safe::Isa
16:23 neyasov joined #mojo
16:25 sri i guess just exporting it by default makes it a little better http://pastie.org/9347339
16:27 sri for the record... we've had a similar example for quite some time, just not as visible as a recipe http://mojolicio.us/perldoc/Test/Mojo#success
16:28 sri mst: see, that's the other thing... people start vomiting right away
16:30 crab can't... stop... vomiting...
16:30 mst sri: for that, I think I'd do runtime role application to the test object - you could whip up something similar using imports into a gensym()ed namespace
16:30 sri and that's from a guy that found scorpion in his bed earlier...
16:30 sri *+a
16:30 sh4 joined #mojo
16:31 crab it was an elegant and beautiful scorpion
16:31 mst I think it works for 'special' stuff like Safe::Isa where the method's designed to be cross-cuttingly generic
16:31 mst I don't -mind- using it for general one-off methods like that, but only because I'm aware there's nothing better
16:32 sri interesting, i take that as no votes all around for the cookbook recipe
16:35 chankey joined #mojo
16:38 nmittal_ I'm trying to get the url from $self->req->url->to_abs but it ignores the #test from (http://localhost:3000/?param=sdsd#test) and only returns http://localhost:3000/?param=sdsd
16:38 sri haha, nice summary of the state of http/2... now in working group last call... http://lists.w3.org/Archives/Public/ietf-http-wg/2014JulSep/0197.html
16:39 Bravo13 joined #mojo
16:39 sri you really only have to read the phk posts to understand what's going on
16:39 sri always straight to the point without corporate bullshit
16:40 sri nmittal_: please don't spam
16:40 disputin joined #mojo
16:40 tempire lulz
16:40 sri nmittal_: if your question is not getting answered just elaborate until someone can answer it or you find the answer yourself along the way
16:41 tempire seems like he's channeling you
16:41 tempire (phk)
16:42 nmittal_ sri.. sorry.. i waited before reposting
16:44 nmittal_ sri.. my users can bookmark their current URL.. say http://localhost:3000/?param=sdsd#test .. so when they click on it next.. I need to take them to the section pointed by #test .. however when I try to access the URL from $c->req->url->to_abs.. its missing the #test
16:46 mst nmittal_: #test is client-side only
16:46 Negor joined #mojo
16:46 tomboh tempire: more likely the other way round - phk has been doing this for a long time..
16:47 nmittal_ mst.. i know but it would be nice to show the user the exact section.. (by javascript on the client).. but I need to see it on the server to let JS know
16:48 sri yea, phk has been grumpy on the internet long before my time
16:49 neyasov_ joined #mojo
16:49 denis_boyun joined #mojo
16:50 nmittal_ mst.. so I type http://host.com#test in the browser.. server doesnt even see the #test part? (I was hoping it sees the full URL but ignores the #test since its client side)
16:52 Bravo13 joined #mojo
16:53 tomboh although phk raises interesting points, I admire how Mark Nottingham deals with his hostility
16:57 sri i really don't like how hard mark nottingham is pushing for last call
16:58 * sri wonders if akamai interests are influencing that
16:59 Negor joined #mojo
17:00 tomboh yeah, the process feels rushed at times, but I suspect HTTP/2 was always going to be one of the more awkward standards to conclude given the need to combine technical requirements and political/policy restrictions
17:01 sri it should just have kept the name spdy
17:02 tomboh I think I agree
17:02 stephanj nmittal_: you can parse the url also via js
17:02 stephanj where you would get the fragment part
17:04 nmittal_ stephanj, its a little more complicated.. let me list the steps..
17:04 nmittal_ stephanj, 1) user types http://host.com#test in the browser
17:05 nmittal_ 2) I get the request on the server and see that he has not authenticated.. so I save his desired URL in the session object and redirect him to the login page
17:05 nmittal_ 3) after successful login, I now want to send him to his desired page.. which is http://host.com#test
17:05 stephanj ah that is an information which you didn't provide beforehand
17:05 stephanj i think
17:05 nmittal_ but because I dont see #test in step 2.. i only save http://host.com
17:06 nmittal_ sorry about that
17:06 nmittal_ so do think its doable with mojolicious?
17:06 Bravo13 joined #mojo
17:07 stephanj you could render a html redirection page instead and have js append the fragment(the #...) part to a url param(and f.e. intercept a meta refresh with timer 1)
17:07 stephanj or move your app to get parameters which will also be "seen" by the server
17:08 nmittal_ stephanj, dont quite follow your 1st suggestion.. but second may not work as when the client changes the fragment it would be #test3 say.. then we are back to the same problem
17:09 nmittal_ if I do get paramaters.. then every click to see a fragment would end up on the server .. right?
17:10 stephanj instead of rendering a http redirect render a html page for the redirect(meta refresh) with js logic to capture the fragment and change the refresh accordingly(and then append something like ?backto=urlwith#fragment to the login page url)
17:10 Negor joined #mojo
17:15 nmittal_ stephanj, thanks for explaining.. but i think its too complicated and would simply show the default page now :(
17:28 dod joined #mojo
17:31 Bravo13 joined #mojo
17:34 basiliscos joined #mojo
17:35 neyasov__ joined #mojo
17:37 denis_boyun_ joined #mojo
17:39 d4rkie joined #mojo
17:40 denis_boyun_ joined #mojo
17:50 dod joined #mojo
18:01 sujithm joined #mojo
18:25 kyshtynbai joined #mojo
18:49 bluescreen_ joined #mojo
19:01 neyasov__ joined #mojo
19:09 mire joined #mojo
19:24 meshl joined #mojo
19:38 woz joined #mojo
19:40 woz Is it Oslo PM meet tonight?
19:41 woz If so, hello from Soithampton PM, also first Wednesday of the month
19:46 punter joined #mojo
19:48 woz joined #mojo
20:15 d4rkie joined #mojo
20:31 d4rkie joined #mojo
20:35 berov joined #mojo
20:37 d4rkie joined #mojo
20:42 disputin joined #mojo
20:57 mattp joined #mojo
20:59 mattp joined #mojo
21:47 sri the new react.js based editor in atom is quite a bit nicer
21:52 sugar_ joined #mojo
21:52 tempire atom uses reactjs?
21:56 sri now it does http://blog.atom.io/2014/07/02/moving-atom-to-react.html
21:58 sri cpu usage went waaaaaaay down and it's all very smooth
21:58 tempire virtual dom for the win
22:00 disputin joined #mojo
22:01 batman http://home.thorsen.pm/private/raw/notverysecret/app-git-ship.png # hehe, didn't know ":ship:" actually turned into a ship on github ;)
22:03 woz joined #mojo
22:09 sri lol
22:09 batman i wonder if that's a bug, hehe
22:13 mattastrophe joined #mojo
22:15 jberger_ joined #mojo
22:16 jberger_ sri: the underscore is only a convention around exported methods
22:16 sri jberger_: ?
22:17 jberger_ I guess you example is too nm
22:17 sri it's pretty much the ideal case... and very very very ugly
22:18 jberger_ I don't know if that should be in the guides
22:19 jberger_ That is useful, but probably ought to be limited to those who know what they are doing
22:19 jberger_ The noobs can just use the modules that export it
22:21 sri for a moment i think mst got me to believe that dollar underscore methods might become a thing... but the more i think about the more sure i am that it won't
22:21 sri they are just too ugly
22:23 sri there is a huge ruby refinements shaped hole in the perl eco system :(
22:24 jberger_ Agreed
22:24 sri p5-mop might be the only hope there
22:25 jberger_ There is also the fully qualified dispatch
22:25 jberger_ Which is arguably less ugly
22:25 sri link?
22:27 jberger_ $t->MyTestPackage::location_is(...)
22:27 sri ah yea
22:27 sri was actually thinking the same thing earlier
22:28 sri but long class names kill it
22:28 sri Test::Mojo::Location::location_is(...)
22:28 jberger_ And it doesn't work with aliased
22:28 jberger_ :-/
22:29 sri haha, you could make a global registry for hodge podge methods and dispatch them with AUTOLOAD
22:30 jberger_ Hehe
22:30 sri x::register(foo => sub {...});
22:30 jberger_ Actually, that is how curry.pm works
22:30 sri $t->x::foo(...)
22:30 sri yea
22:31 * jberger_ checks if there is a dispatch.pm
22:32 jberger_ Name is free
22:32 jberger_ :D
22:33 sri mojopatch.pm
22:35 sri of course it kills the lexical aspect :/
22:36 sri might as well just monkey patch Test::Mojo
22:37 jberger_ Not if you want to distribute on cpan
22:37 sri sure you "can"
22:38 jberger_ Sure,  but then sri attacks
22:38 jberger_ Could subclass
22:38 sri the existing modules subclass Test::Mojo
22:39 jberger_ preaction: this is why i want a hackable dispatcher
22:40 batman apply_role_to_object() ftw :)
22:41 * sri sets batman on fire
22:42 batman apply_water_to($batman)
22:46 sri Role::Tiny might be the most sane option atm though
22:49 batman Seriously? Why did you put me on fire then..? :/
22:50 sri i guess it would be a good time for a 5.11 release
22:50 sri batman: habit
22:50 batman Haha
22:51 batman It's cool. It's cool.
22:51 jberger_ sri does that make an anonymous subclass?
22:52 batman jberger_: yes
22:52 sri nope, name based on class and applied roles
22:52 sri so classes get reused
22:52 jberger_ Ah, interesting
22:52 batman jberger_: oh. Did you mean Package::Anon class?
22:53 sri pretty sure he wanted to know if you'll end up leaking classes like crazy
22:53 jberger_ Yep
22:53 sri Package::Anon would be even better
22:54 jberger_ ?
22:54 sri perhaps not for performance though
22:54 * jberger_ looks
22:54 sri you'll like Package::Anon
22:54 batman I think it's cooler, but I'm not sure if it's better :)
22:55 d4rkie joined #mojo
22:55 batman Same stuff. Different wrapping. Or maybe you could say Package::Anon skips the wrapping ;)
22:55 d4rkie joined #mojo
22:55 sri basically packages that can vanish from memory again
22:56 batman Lexical packages that can't be looked up
22:56 * jberger_ wonders how it works
22:56 batman Black magic
22:56 purl Black magic is whatever imcc does.
22:57 batman jberger_: it's not many lines of code. Check it out :)
22:57 jberger_ Holy xs hackery batman!
22:57 batman I need to get some sleep...
22:58 batman Haha ;)
23:02 punter joined #mojo
23:16 Adura joined #mojo
23:43 kyshtynbai joined #mojo

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