Camelia, the Perl 6 bug

IRC log for #mojo, 2012-08-17

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

All times shown according to UTC.

Time Nick Message
00:11 berov left #mojo
00:58 laouji joined #mojo
00:59 scott joined #mojo
01:16 scott joined #mojo
01:32 daniel_ joined #mojo
01:36 jnap joined #mojo
02:16 xaka joined #mojo
02:52 noganex_ joined #mojo
03:28 davido joined #mojo
03:41 l3l1p joined #mojo
03:47 l3l1p joined #mojo
04:05 l3l1p joined #mojo
04:58 rem_lex joined #mojo
05:02 laouji joined #mojo
05:23 laouji joined #mojo
05:37 newbie joined #mojo
06:02 davido joined #mojo
06:04 spleenjack joined #mojo
06:04 davido joined #mojo
06:11 arpadszasz joined #mojo
06:11 cosmincx joined #mojo
06:11 jeen joined #mojo
06:13 newbie1 joined #mojo
06:57 Vandal joined #mojo
07:06 * sri yawns
07:09 batman good morning
07:09 davido Howdy.
07:10 batman could it be possible to set not_found and exception templates in the stash?
07:10 sri good morning fellow conquerors
07:11 batman i was thinking that i might want to render a different template (more minimalistic) if the request came from curl or something
07:12 sri best practice is using a different format, like exception.production.iphone.ep
07:13 sri and app->types->type(iphone => 'text/html')
07:13 batman ok
07:13 batman i was considering that, but i thought it was a hack :)
07:14 batman also, where is the list of protected stash keys? i can't seem to find the manual...
07:15 sri oh shit, twitter tries to kill 3rd party apps :o
07:15 batman why?
07:16 sri batman: http://mojolicio.us/perldoc/​Mojolicious/Controller#stash
07:16 sri also http://thenextweb.com/twit​ter/2012/08/17/twitter-4/
07:16 batman ah! i thought there was a separate document for that :/
07:17 sri 100k users max per app... that should kill tweetbot
07:18 davido Wow, that's heavy handed.
07:18 * alnewkirk is having fun with mojolicious again
07:19 batman so where do i go if i want to know more about "extends" or any of the other keys?
07:25 crab to the githubmobile!
07:25 crab or sourcemobile, maybe.
07:32 batman :P
07:35 davido alnewkirk: What type of Mojolicious fun are you having lately?
07:35 Leandr joined #mojo
07:35 marcus sri: they get twice what they have today.
07:37 * marcus taps that ass
07:37 alnewkirk davido: customizing the framework for a new development team and project
07:38 marcus sri: I'm wondering about steps argument handling.
07:38 alnewkirk Mojolicious is the *only* modern Perl framework that allows me to easily give each developer an apache cgi-based sandbox but run self-contained in production
07:38 alnewkirk ... no mod-perl
07:38 marcus sri: would it be possible to get it in definition order rather than calling order?
07:39 marcus sri: for instance, if I do two http requests in a step, I don't know which one is going to complete first, so I don't know the order.
07:39 marcus unless I misunderstood the unit tests :)
07:40 judofyr joined #mojo
07:40 sri marcus: seems like it would suck to implement and test, but knock yourself out ;p
07:41 sri it is calling order atm
07:42 sri it would make delays and seps overlap a lot less i guess
07:42 sri *steps
07:43 marcus seems it would be tested quite well by just switching the arguments in the second steps.t, but I agree about the implementation
07:43 marcus second test in
07:43 sri hmm
07:45 judofyr sri: http://pastie.org/4531290
07:46 judofyr marcus: ^
07:46 sri hahahaha
07:46 sri i was just thinking about the exact same solution
07:46 marcus me too
07:47 marcus I was halfway :p
07:47 sri judofyr++
07:47 marcus judofyr++ #fast
07:47 judofyr \o/
07:48 batman could it be possible that the argument list change?
07:48 marcus batman: not with this patch.
07:48 batman would it be safer to do my($step, [@arg0], [@arg1], ...) = @_;
07:48 batman what if the callback receives one arg on error and two args on success?
07:49 batman not sure if that's a real problem, or if i'm just inventing one :)
07:50 sri you're inventing one
07:50 marcus it makes the simple cases more ugly too
07:50 sri and making the api ugly
07:50 * sri nods
07:50 sri we don't do ugly! ;p
07:51 marcus sri: are you applying judofyr's patch or should I?
07:51 sri the next method really needs a better description though
07:51 sri marcus: already on it
07:51 marcus ait
07:52 marcus batman: at least this removes the need for your helper in the wirc sourcecode :)
07:52 marcus I think it also removes my need for parallol
07:52 marcus although it would be nice with a convenience helper to handle the rendering
07:53 batman marcus: about the helper: yes! i was thinking about it yesterday :)
07:54 batman we could just do sub { $self->render } as the last item in the callback list?
07:55 marcus yeah, I figured the helper would just be something like $c->render_later; ->steps(@_,sub { $c->render));
07:56 marcus not sure if that's core material tho.
07:58 sri Generate callback to next step, which will only be reached after all generated callbacks have been invoked. The order in which callbacks have been generated is preserved, and all arguments, except for the first one, will be queued and passed through to the next step.
07:58 sri that sounds ok?
07:59 marcus yes
07:59 marcus http://i0.kym-cdn.com/photos/images/original​/000/002/120/Epic-LongBattle.jpg?1318992465
08:00 sri i see you've found the Mojo::Base synopsis :D
08:00 marcus yes
08:00 metys joined #mojo
08:02 good_news_everyone joined #mojo
08:02 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/BVKHPA
08:02 good_news_everyone [mojo/master] preserve order of arguments in Mojo::IOLoop::Steps - Sebastian Riedel
08:02 good_news_everyone left #mojo
08:04 metys Hi! Can someone help me with one thing?
08:04 * sri runs away for breakfast
08:04 batman metys: not unless you tell us what you need help with...
08:05 taryk joined #mojo
08:06 judofyr metys: it's better to ask than to ask to ask :)
08:07 metys I'm working on Mojolicious based application, much more complicated than examples in Mojo* docs...
08:08 judofyr and?
08:09 metys I have some "modules" that needs access to app object... example: MyApp::Model - needs app (or controller) instance, to be able to use ->db ->cache ->mail and so...
08:09 metys other example: MyApp::ShoppingCart, must be able to query db, access session/stash...
08:11 metys I have MyApp::Plugin's classes, that prepares objects to use... example: $c->shopping_cart returns ready to use instance of MyApp::ShoppingCart
08:11 judofyr metys: why not put that logic straight in the controller? if something needs to touch several parts (db, cache, mailing server) and request/response (session, stash) it seems like something the controller should do. the controller can still delegate work to other modules of course
08:13 batman or construct the modules with the appropriate arguments MyApp::ShoppingCart->new(db => $app->db, cache => $app->cache);
08:14 batman you probably don't want the modules to be hard coupled with your $app. that will make it difficult to re-use it in another context
08:15 metys "why not put that logic straight in the controller" - because I want to be able to call $c->shopping_cart->add( ... )
08:16 judofyr metys: why does that need access to stash/session?
08:16 judofyr data models shouldn't worry about the req/res
08:17 batman judofyr: did he say anything about the stash/session..?
08:17 judofyr batman: "10:09 metys: other example: MyApp::ShoppingCart, must be able to query db, access session/stash..."
08:17 batman ah. sorry. just read the first part :)
08:18 metys "or construct the modules with the appropriate arguments" - I currently do this, example: my $m = Model->new; $m->controller( $c ); return $m;
08:18 batman i agree with judofyr: your models should only worry about datastructures: ->add($c->stash) could potentially work...
08:19 Psyche^ joined #mojo
08:19 batman a controller is not what i would call "appropriate" :/
08:19 judofyr metys: either make it strictly input/output: $cart = Cart->new(content => $self->session('cart')). (do shit with $cart). $self->session(cart => $cart->to_array)
08:19 metys ...then, inside "Model" I can access $self->controller->db $self->controller->cache; ... AND, for example: $self->controller->l( ... )
08:19 batman it's too web app specific
08:20 judofyr metys: I'd say it's generally a bad idea to pass the controller around. the controller should only pass data into other modules, not itself.
08:20 batman +1
08:21 metys judofyr: I agree, that is why I asking, I try to find better way...
08:21 batman https://gist.github.com/3376964 <-- anyway this could not kill or print a warning?
08:22 batman not really a mojo issues, but i'm curious since i got defunct children and no warnings :(
08:24 metys my Model is simple, requires cache/db/condig - I can just pass all them as arguments
08:25 batman i would do that. don't pass app or controller...
08:25 metys but what to do, when I need to access translator/session/stash inside my component? like ShopingCart I mention above?
08:25 marcus don't bogart that controller.
08:25 batman i ask myself: will this work from the command line or from a desktop ui? if the answer is no, then i need to rearrange my objects...
08:26 batman metys: rearrange so you don't need it
08:26 metys marcus: "bogart"?
08:27 marcus metys: ignore me, I was making a joke.
08:27 metys I don;t know how to "ingone" on irssi... ;-)
08:28 metys "ignore" on irssi - 2fast, damn...
08:34 metys I gotta go, thx, have a nice day, ca...
08:36 marcus bai
08:37 davido Doesn't sound like a healthy separation of concerns.
08:38 berov joined #mojo
08:41 jontaylor joined #mojo
08:49 Netfeed what happened with the i18n-plugin that was shipped with mojo?
08:49 rem_lex|pivo joined #mojo
08:53 judofyr Netfeed: https://metacpan.org/module​/Mojolicious::Plugin::I18N
08:53 rem_lex| joined #mojo
08:54 Netfeed thanks
09:04 * sri wonders if steps and delays could be merged
09:38 sri hmm
09:39 sri it seems possible
09:39 sri one callback would be a finish event, and multiple a chain of steps
09:40 judofyr sri: but how do handle that both $delay->end and $delay->begin->() is supported?
09:40 sri i don't see a problem there
09:41 sri $delay->end would of course break order
09:41 sri but that can be documented
09:43 sri i guess mixing them is not exactly elegant, but it bugs me less than having both with overlapping functionality
09:44 kmx joined #mojo
09:45 sri judofyr: there's a problem with preserving order btw
09:45 judofyr oh?
09:47 sri if you do $steps->next in a nested callback say Mojo::IOLoop->timer(10 => sub { Mojo::IOLoop->timer(10 => $steps->next) });
09:47 sri it might reuse the same counter
09:48 judofyr I don't see how it might reuse the same counter…
09:48 sri if there are other callbacks that finish before that one started
09:48 sri since creation of the nested one is delayed
09:49 judofyr ah, but that will also cause it to jump to the next step
09:50 judofyr Mojo::IOLoop->timer(10 => sub { $steps->next }); $steps->next->()
09:50 tl joined #mojo
09:51 sri http://hastebin.com/raw/giyojatapo
09:52 judofyr if you remove the 15-timer, it will continue to the next step after 10 seconds
09:52 sri right
09:52 sri if you don't it reuses the arg slot
09:52 judofyr no, 5 seconds?
09:52 sri 5
09:52 judofyr yeah, 5
09:53 judofyr I guess you just have to do: my $cb = $steps->next;
09:53 sri it's stuff like this that makes me really not want to have both, delays and steps :S
09:53 judofyr doesn't Delay have the same problem?
09:54 sri it does
09:54 sri they share like half of their code
09:54 judofyr I'd say Steps is more versatile
09:54 sri but we can't just remove delays
09:54 judofyr are there any use cases where Delay is cleaner than Steps?
09:55 sri yes
09:55 sri for $delay->wait
09:55 sri emulating blocking
09:55 judofyr Mojo::IOLoop->steps()->wait ?
09:55 sri ...
09:55 sri lets duplicate more code!
09:55 judofyr :)
09:56 judofyr and depricate Delay
09:56 sri or just merge steps into delay
09:56 judofyr ah
09:56 judofyr now I see what you mean
09:57 sri only little annoyance i can see would be number of callbacks passed to new deciding what happens with them
09:57 sri one for subscribe to finish event, multiple for steps
09:58 judofyr Steps can always emit a finish, no?
09:58 sri always?
09:58 judofyr why not?
09:58 judofyr then the only difference is: $self->next->() if @_;
09:59 judofyr should you be able to use both begin/end and next in the same Delay/Steps?
09:59 sri next would be replaced with begin
09:59 sri it would be consistently ->begin
10:04 sri ordered arguments is the only thing causing me headaches
10:04 sri due to ->end
10:05 sri i'll try merging without ordered args first
10:20 nic Anyone using html tidy (the c++ app)?
10:20 nic I've tried the standard one and the html5 fork, and I'm struggling to get anything 'tidy' out of them
10:21 nic It's pretty popular, so there must be some magic incantation
10:23 judofyr sri: I solved it by using a separate arrays for ordered and unordered: http://pastie.org/4531797
10:23 judofyr not very pretty :/
10:24 sri judofyr: are you reading my mind?
10:25 sri it may not be pretty, but it's also not ugly
10:26 sri judofyr++ # once again beat me by about 30 minutes
10:26 mire joined #mojo
10:33 sri oh, one small difference though
10:34 sri i had no else for the finish event
10:34 sri since it may have to fire right after the last step
10:46 judofyr \o/
11:14 judofyr purl?
11:14 judofyr where did he go?
11:17 sri she
11:17 batman :)
11:17 sri and she vanishes every now and then :(
11:18 * sri pokes marcus
11:18 marcus hachi
11:18 marcus is the purl botmaster
11:19 * sri pokes hachi
11:21 * marcus poked hachi too
11:24 sri everybody poke hachi!
11:25 * bjoernfan pokes sri
11:25 sri you're doing it wrong!
11:25 bjoernfan Has anybody created The Greatest Webmail Client Ever using Mojolicious yet?
11:26 bjoernfan I really don't want to run any PHP at all. I'm looking for something other than roundcube.
11:31 jeen joined #mojo
11:39 marcus squareball
11:39 cosimo joined #mojo
11:47 bjoernfan marcus: That's exactly what I was thinking.
11:48 bjoernfan If I say hypnotoad throws a dinosaur, and morbo runs fine, what's your response?
11:49 crab you're doing something wrong
11:53 bjoernfan Yeah, sure, I'm just wondering if it's ("should be") possible at all for morbo to work and hypnotoad not to work on the same code.
11:53 * sri concurs with crabs assessment
11:54 judofyr sri: will you merge Delay & Steps btw?
11:54 sri judofyr: think so
11:55 sri working on the documentation... explaining it is always the hardest part :S
11:56 sri not even sure yet about the synopsis example
11:59 judofyr specially when it has several use cases :/
11:59 judofyr or, ways of usage
11:59 judofyr or whatever
12:00 sri i just got rid of sub new, and replaced it with sub steps
12:00 sri that leaves a little more room for explanations
12:00 judofyr yeah
12:21 marcus bjoernfan: likely it has something to do with morbo being singlethreaded.
12:21 sri hmm
12:21 sri why don't we call Mojo::Base->tap just Mojo::Base->k? :)
12:21 marcus mkay?
12:21 sri since it's the k combinator
12:22 marcus $foo->k(sub { shift->suffer('lightly') })
12:36 good_news_everyone joined #mojo
12:36 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/lWbwHA
12:36 good_news_everyone [mojo/master] merged Mojo::IOLoop::Steps and Mojo::IOLoop::Delay - Sebastian Riedel
12:36 good_news_everyone left #mojo
12:38 good_news_everyone joined #mojo
12:38 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/XVA16g
12:38 good_news_everyone [mojo/master] fixed step example - Sebastian Riedel
12:38 good_news_everyone left #mojo
12:49 judofyr marcus: it's $_, not shift :)
12:50 judofyr ooo, I can play music on marcus' laptop by mentioning him
12:50 judofyr marcus
12:50 judofyr nice
12:50 sri marcus
12:50 judofyr (he's not here)
12:50 sri :/
12:50 judofyr DING!
12:52 jeen joined #mojo
12:53 judofyr sri: I'm really digging ->steps
12:53 sri \o/
13:09 inokenty joined #mojo
13:13 jnap joined #mojo
13:24 CromeDome joined #mojo
13:44 andrefs joined #mojo
13:47 marcus me too
13:50 good_news_everyone joined #mojo
13:50 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/gHv8aw
13:50 good_news_everyone [mojo/master] added step example to cookbook - Sebastian Riedel
13:50 good_news_everyone left #mojo
13:50 sri it does look pretty nice in examples
13:51 sri oh wait, i can show that the results preserve order too \o/
13:55 good_news_everyone joined #mojo
13:55 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/PWCfyQ
13:55 good_news_everyone [mojo/master] show that order is preserved in step example - Sebastian Riedel
13:55 good_news_everyone left #mojo
13:56 judofyr nice
13:58 rem_lex joined #mojo
14:02 alester joined #mojo
14:33 Lucas1 joined #mojo
14:44 alester_ joined #mojo
14:50 marcus steps are making me happy - https://gist.github.com/3379405
15:01 sri marcus: make sure to try the delay version
15:02 sri i don't want any complaints *after* the release ;p
15:08 judofyr sri: the 'finish' event isn't called if there's no $delay->begin in a step. e.g. see marcus' code when @$photos is empty.
15:08 judofyr I'm not sure if it's a feature or a bug though
15:08 sri hmm
15:10 judofyr or wait
15:12 judofyr sri: done is now called after each step is completed. is that intended?
15:12 judofyr err, s/done/finish/
15:12 sri i don't think that's the case
15:12 sri it checks if there are more steps
15:13 judofyr sri: http://hastebin.com/hihipuboco.pl I'm seeing three done's
15:13 judofyr but that might be because it's not in a callback
15:14 judofyr sri: this code says "done" twice: http://hastebin.com/nacehoyone.pl
15:20 sri confirmed
15:23 judofyr sri: unless $cb || @{$self->{steps}} seems to fix it
15:23 sri that breaks tests
15:24 CromeDome joined #mojo
15:27 sri it gets a little awkward with recursion
15:28 judofyr hm… but does using ->begin in the final step make sense?
15:29 sri no
15:30 judofyr sri: but do you think that this should call the finish event?
15:30 judofyr http://hastebin.com/hudabojari.pl
15:30 sri i can replicate the problem already
15:30 sri i just don't know how to fix it
15:31 judofyr unless @{$self->{steps}} && $self->{counter} seems to fix it
15:31 judofyr and tests still pass
15:31 judofyr though unless + && makes my head dizzy
15:31 judofyr so I don't quite get why it works
15:32 sri only part of it
15:32 ladnaV joined #mojo
15:32 judofyr more edge cases?
15:32 sri we still have a recursion problem with $delay->begin->()
15:32 sri since the next step happens before this step is finished
15:33 judofyr that's only for sync code though
15:33 judofyr Mojo::IOLoop->timer(0 => $delay->begin) works fine
15:34 judofyr what's the usecase for $delay->begin->()? oh, maybe to force it to run the next step even though there's no async operations to do
15:34 sri it still complicates the whole thing
15:35 sri yes, that's what the tests use it for
15:35 sri maybe we should just bail and croak in that case
15:35 judofyr it all depends on what we want to use `sub { }` for: should it continue to the next step or bail out.
15:36 judofyr `sub { }` could mean "bail out" (or return, or whatever) and `sub { shift->begin->() }` could mean "continue"
15:37 judofyr or `sub { }` could mean continue and `sub { shift->bail }` could bail out
15:37 judofyr (err, by "bail out" I just mean: don't execute the rest of the steps and *maybe* emit the finish event)
15:37 sri my head hurts
15:40 sri problem seems to solve itself if we emit the finish event before the last sub :S
15:42 newbie1 joined #mojo
15:42 judofyr 'finish' doesn't really make sense with steps though; the last sub is the finish event…
15:43 bjoernfan http://youtu.be/1x9-Etj1Ew4 was pretty funky
15:44 judofyr sri: it still fires twice if you use $delay->begin->() in the last sub. there should probably be a warning that it doesn't make sense to use it then.
15:45 sri i don't understand the motivation to try $delay->begin->() in the final sub
15:46 judofyr some might want to use the 'finish' event instead of a final sub
15:47 sri i don't like preemptive warnings, if it becomes a problem we can add it later
15:47 judofyr yeah, it's really an edge case
15:57 good_news_everyone joined #mojo
15:57 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/9L-dyA
15:57 good_news_everyone [mojo/master] fixed a few edge cases in Mojo::IOLoop::Delay - Sebastian Riedel
15:57 good_news_everyone left #mojo
16:07 sri emitting finish on DESTROY might be nice
16:08 sri so you get to render something even if your non-blocking stuff goes wrong
16:12 Leandr joined #mojo
16:12 sri then again, that's not very reliable
17:22 vel joined #mojo
17:30 andrefs joined #mojo
17:48 tabbi joined #mojo
17:55 labrown joined #mojo
18:09 buu joined #mojo
18:09 buu Hey!
18:10 buu Two questions, one simple, one conceptual. Controllers in mojo are *only* instantiated if they're called as a result of a route matching a request, right?
18:11 zivester_ joined #mojo
18:11 buu And more of a design question, I'm working on a mojo app intended to provide services via rest/http/json and so on, what's the best way to handle keeping the list of all the services I respond to? Aka the possibly giant route table.
18:12 purl joined #mojo
18:15 buu sri: You can't fool me, I know you're here
18:35 good_news_everyone joined #mojo
18:35 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/b5u-Bg
18:35 good_news_everyone [mojo/master] added squish method to Mojo::ByteStream - Sebastian Riedel
18:35 good_news_everyone left #mojo
18:35 buu =[
18:39 good_news_everyone joined #mojo
18:39 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/hS6zYg
18:39 good_news_everyone [mojo/master] better squish tests - Sebastian Riedel
18:39 good_news_everyone left #mojo
18:41 sri why the hurry mr buu?
18:41 buu I'm young and impatient?
18:42 sri i see
18:42 * sri can confirm the first question
18:43 buu Yay
18:43 buu While I'm picking your brain, the covention is App::Name; instead of App::Controller::Name for controllers?
18:44 sri the default, i don't think there's a clear convention
18:44 sri both have followers
18:44 Netfeed i like the second one
18:45 buu Yeah, I think I want the latter as well
18:45 buu But anyway, how do you handle lots of routes?
18:45 buu Most of which are independent
18:47 sri don't think i've ever used more than 50-100 independent routes
18:47 sri and if they follow a pattern i write a shortcut to generate the routes for me
18:47 buu I suspect I'll end up around 100
18:47 buu Hrm. Maybe less actually.
18:48 buu Maybe I can just be clever instead.
18:48 davido joined #mojo
18:53 mire joined #mojo
18:56 davido buu: I'm in the MyApp::Controller::Name camp too.  It leaves lib/MyApp a little less cluttered, which comes in handy if I want to move things like authentication callbacks out of MyApp.pm.  ...and then MyApp::Model::Name works well if I want to place some model modules under the same lib/ heirarchy.  ...but that's just me.
19:00 * sri hugs purl
19:00 * purl smiles
19:00 sri botsnack!
19:00 purl :)
19:08 davido Although conceptually the models fit better under lib/ than under lib/MyApp (separation of concerns, etc) ;)
19:11 davido dotCloud is suggesting their "Perl Worker" platform as a means to websocket support for Perl / Mojolicious applications because the "worker" type of service doesn't force nginx/uWSGI on the user.
19:12 davido Not sure how one would deal with horizontal scaling in that type of setup though.
19:12 sri at some point everything will just use the worker type, like on heroku
19:13 davido They've also exposed the ability to configure the Perl version now; 5.12.x, 5.14.x, 5.16.x in their Perl services.
19:14 * sri prefers the heroku model in general
19:15 davido I guess I'll have to dig deeper with heroku.  I've been working on an app for a client and have from the start been thinking in terms of dotCloud.  ...but I should be able to drop it into either one when I'm done.
19:16 davido Whichever one gives me a better feel for horizontal scaling to achieve higher availability (traffic isn't an issue).
19:16 sri why would you have to think about that at all?
19:16 sri add more workers/dynos, done
19:17 davido Right.  dC lets me add multiple "services" to achieve better availability.  heroku, dynos.  Should be about the same, so as you point out, nothing to think about.
19:17 davido i mean multiple service-instances.
19:18 andrefs joined #mojo
19:18 sri you can start/stop dynos just as you need them, they'll be up in seconds and heroku will take care of the rest
19:19 sri what you should care about is database, that's always the bottleneck
19:19 davido The same goes for scaling service-instances with dC; it's a one-liner, and takes just seconds.
19:20 fhelmber_ joined #mojo
19:20 davido With the database I was going to use two service-instances on dC to get replication, automatic failover, and resyncing.
19:22 davido High traffic isn't ever going to be an issue; it's an internal-use web app.  A few dozen users.  Even if it grows to a few hundred it's still nothing like a successful public app.
19:34 * sri wonders if it would be fun to have a ->perl() method in Mojo::Base
19:34 sri perl -Ilib -Mojo -E 'say Mojo::URL->new("mojolicio.us")->perl'
19:38 davido What would it do?
19:38 sri Data::Dumper the object
19:40 sri it's no extra code, that's why i'm wondering
19:40 davido Hm. That's not the first thing I think of, but it is useful.
19:40 sri perl6 has .perl()
19:40 davido I mean I wouldn't expect ->perl to result in a dump of the object, but if it's documented, it is a useful feature.
19:41 davido OH, that's where the name comes from.
19:41 sri i'm stealing convenience methods from ruby and perl6 a lot
19:42 davido There have been plenty of times that I've added code to projects just to dump an object and see what's there.  So exposing it at this level would be helpful.
19:43 sri well, its use a bit limited, since it would only affect subclasses of Mojo::Base
19:43 sri *is
19:43 davido But much inherits from Mojo::Base.
19:45 davido got to run...
20:12 sri tempire, marcus, crab: thoughts on Mojo::Base->perl?
20:17 newbie1 joined #mojo
20:22 Lucas1 joined #mojo
20:24 marcus sri: "meh"
20:25 sri :(
20:25 dwierenga joined #mojo
20:27 marcus sri: sorry, but having to know if something is Mojo::Base-based before I try to dump it seems more hassle than it's worth for most cases.
20:27 sri Mojo::Base::perl($whatever) is a side effect
20:27 marcus hmm yeah
20:28 marcus I guess That is shorter then Data::Dumper::Dumper :)
20:28 sri Data::Dumper->new([@_])->Indent(1)->Terse(1)->Dump to be precise
20:29 marcus mm
20:30 marcus sri: I guess it's nice.
20:34 good_news_everyone joined #mojo
20:34 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/SR5QFg
20:34 good_news_everyone [mojo/master] added perl method to Mojo::Base - Sebastian Riedel
20:34 good_news_everyone left #mojo
20:38 buu Um, how do I do an 'internal redirect'?
20:42 buu Well, I can use a helper instead
20:44 marcus buu: yes, use a helper insteaad.
20:44 marcus yeees
20:44 buu marcus: Specifically I'm trying to return an error message/page
20:44 marcus yepp
20:44 buu Well ok then.
20:51 davido joined #mojo
20:52 davido_ joined #mojo
20:53 tempire New mojolicious logo
20:53 tempire Mojolicious: Believe! http://nerdnirvana.org/wp-content/​uploads/2010/05/t-rex-unicorn.jpg
20:53 sri X_x
20:54 sri tempire: Mojo::Base->perl yay or nay?
20:54 * tempire just woke up and hasn't read through the log yet
20:54 * sri cracks the whip
20:55 buu tempire: I laughed for like 20 minutes when I hit an error in the code and that t-rex unicorn thing popped up
20:55 tempire I claim full credit
20:59 sri perl -Mojo -E 'say g("mojolicio.us")->dom->find("h1, h2, h3")->pluck("text")->perl'
20:59 sri hmmm
21:02 sri think i actually tend towards removal again
21:04 buu Does use Mojo::Base '...'; pull in strict?
21:05 sri http://mojolicio.us/perldoc/Mojo/Base#DESCRIPTION
21:05 buu hot
21:13 buu So uh
21:13 buu How do I write to development.log?
21:13 buu Oh
21:14 buu Is it only on app
21:14 perlite joined #mojo
21:16 buu Also doing $self->app->log("foo") like totally breaks things.
21:16 sri don't do that
21:18 buu Apparently not!
21:18 buu IT made my app time out trying to render a response
21:18 buu Which was slightly unexpected
21:21 good_news_everyone joined #mojo
21:21 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/gZ80pg
21:21 good_news_everyone [mojo/master] removed perl method again - Sebastian Riedel
21:21 good_news_everyone left #mojo
21:22 sri didn't feel right
21:59 o_o joined #mojo
22:00 o_o wow!  Mojolicious is delicious!
22:00 o_o thank you - it is very pretty.
22:02 o_o I have a questing about a unit-test with UTF8 characters literals that is making  requests to a REST service - I have tried turning on use open ':utf8' and use utf8 in my test and  in my rest service stub - it was working  when I had the code in the Controller - I moved it to a model and then it broke.
22:02 o_o my question is -  are there any docs about this? or guides?
22:03 o_o i seem to have covered this https://github.com/kraih/mo​jo/wiki/Utf-8-manipulation
22:05 o_o I am getting this error Write failed: Wide character in syswrite at /System/Library/Perl/5.12/darwin-​thread-multi-2level/IO/Handle.pm line 465.
22:08 o_o that error arrives when i add 'use utf8' to my test class
22:08 o_o er file
22:11 davido_ joined #mojo
22:15 o_o if i turn off 'use utf8' it works - but this seems to be only because there is bitwise equality and not because the encoding is correct
22:15 o_o also if i do that CURL stops rendering the char properly.
22:28 sri tempire: got an opinion on Mojo::Base->perl now? :)
22:43 good_news_everyone joined #mojo
22:43 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/CNdAzA
22:43 good_news_everyone [mojo/master] made all objects a little more equal - Sebastian Riedel
22:43 good_news_everyone left #mojo
22:51 sri the question of renaming Mojo::Base->tap is also still open, i kinda liked Mojo::Base->k for k combinator
23:35 newbie1 what about "Mojo::Base->inside(sub { ... })"?
23:38 davido joined #mojo

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