Camelia, the Perl 6 bug

IRC log for #mojo, 2013-08-29

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

All times shown according to UTC.

Time Nick Message
00:00 sri http://pastie.org/8278661 # considering this now
00:00 jberger_ But perhaps a compromise? Say a non default but still core plugin for advanced functionality
00:00 sri this is the core functionality
00:00 sri i don't think any of it could be simpler
00:01 sri if you think you can make it simpler, be my guest! :)
00:03 jberger_ So because continue has been called, returning false means wait not fail?
00:04 sri continue has not been called
00:04 sri returning false does not mean fail
00:04 jberger_ Oh right nm
00:04 sri returning false means break the chain
00:04 sri no more, no less
00:05 sri otherwise what happens when the chain is broken seems pretty much undefined
00:05 jberger_ But that typically is used to indicate failure no?
00:05 sri that implies there is something to handle a failure
00:06 sri but there isn't
00:06 sri all our examples show ->render calls inside the bridge on failure
00:06 sri so, 0 just means "stop"
00:07 jberger_ Well if that's the case then I see no reason why continue should not be used to restart
00:07 * jberger_ used many negatives
00:08 jberger_ It makes sense to me that if returning 0 means stop that there might be some mechanism to restart
00:10 jberger_ continue works for me I'm that sense
00:10 jberger_ What is the concern?
00:12 sri apps depending on undocumented behavior
00:12 sri in certain cases stopped bridges could trigger a 404 it seems
00:13 sri which makes little sense, but still
00:15 jberger_ Don't many examples use bridges returning false for authentication failure
00:16 jberger_ 404 seems wrong there
00:16 sri yea, pretty much all do
00:16 jberger_ But maybe I'm remembering the examples incorrectly
00:16 jberger_ Ok
00:18 jberger_ Return the controller to indicate wait? Seems to make sense in the same way that \1 was intending
00:18 sri not a bad idea if return 0 doesn't work out
00:18 sri jberger++
00:19 * sri pokes tempire
00:19 * sri shakes tempire
00:20 jberger_ The fear there,  do any common methods/helpers return a controller instance? That might cause unexpected waiting
00:21 sri good point
00:21 sri bad jberger!
00:22 jberger_ Hehe
00:22 jberger_ Actually that logic holds for most return values
00:23 jberger_ In which case returning false, the only thing documented to break the chain, is the only real remaining choice
00:25 jberger_ 0 but true!
00:25 * jberger_ ducks
00:26 sri oh wow, return 0 actually works
00:28 jberger_ \o/
00:30 sri the description gets pretty nice too \o/
00:33 StinkfooT joined #mojo
00:34 sri "Broken dispatch chains can be continued by calling the method L<Mojolicious::Controller/"continue">, this allows for example non-blocking operations to finish before reaching the next dispatch cycle."
00:43 good_news_everyone joined #mojo
00:43 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/3STFmA
00:43 good_news_everyone mojo/master 0f2e52e Sebastian Riedel: simplified support for non-blocking operations in bridges
00:43 good_news_everyone left #mojo
00:44 sri ok, that might be it
00:44 sri http://mojolicio.us/perldoc/Moj​olicious/Guides/Routing#Bridges
00:44 sri oops
00:45 good_news_everyone joined #mojo
00:45 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/P6X4sA
00:45 good_news_everyone mojo/master 99a43a0 Sebastian Riedel: fixed typo in routing guide
00:45 good_news_everyone left #mojo
00:47 sri what $c->continue does in hooks is of course undefined :)
00:54 shmuel joined #mojo
01:04 laouji joined #mojo
01:07 egopro joined #mojo
01:12 keedi joined #mojo
01:14 basic6_ joined #mojo
01:17 jberger_ I am 99% happy, but what is the policy of adding a controller method on a non breaking release?
01:18 jberger_ There will be purple
01:18 jberger_ Aaaaa
01:18 jberger_ People
01:18 jberger_ Who have helpers named continue
01:19 jberger_ (Stupid swipe type)
01:24 sri jberger_: yea, it's tricky
01:25 sri but what else could we do? wait a year to include it in 5.0?
01:27 sri it's the same for Mojo::DOM and Mojolicious, i've added methods/attributes to them in minor releases too
01:27 sri oh, Mojolicious::Routes has the same problem
01:27 sri with shortcuts
01:27 jberger_ Plugin future => ['continue']
01:27 jberger_ ?
01:28 sri and that monkey patches stuff in?
01:28 jberger_ That our for the controller it could just add a helper
01:29 jberger_ But if it should be general then yes
01:29 sri that's a new can of worms
01:29 sri also, how would that stuff get documented?
01:29 jberger_ Money patch is probably better
01:29 sri honestly... if we decide to go that route... i'll just stick with a dev branch for all development and use that until i can release 5.0 :)
01:30 jberger_ " continue is available from the future plugin"
01:30 sri i don't want to document monkey patch madness
01:30 jberger_ All future plugin features become core at the next major release
01:30 sri if you volunteer, perhaps we could consider the dev/stable branch split
01:30 jberger_ Its the opposite of deprecation
01:31 sri i maintain dev, you backport to stable
01:31 sri jberger_: how would you solve the Mojolicious::Routes::continue problem?
01:32 sri that method is new and might get in the way of existing shortcuts, but is basically the core of the router, so can't be monkey patched
01:33 jberger_ Ok , I'm not going to fight too hard
01:33 sri i'm not saying you're wrong
01:33 jberger_ Like I said I was 99% Ok
01:33 sri but i don't think it can be done
01:33 jberger_ I just wanted to bring it up
01:34 sri you're welcome to veto the feature
01:34 sri (or rather -1)
01:36 sri if it doesn't get the votes i'm sure we'll think of something to change in the dev process
01:36 sri our reliance on autoload is not a good thing though
01:37 sri perhaps time to add a Mojolicious::Route::shortcut method
01:38 sri another breaking change to avoid breaking changes OMG :)
01:40 sri perhaps a helper to call helpers too :D
01:58 asarch joined #mojo
01:59 d4rkie joined #mojo
01:59 d4rkie joined #mojo
02:10 zeep left #mojo
02:12 jberger_ Hahaha
02:13 jberger_ No, I like the implementation
02:13 jberger_ And I can see it being useful
02:13 jberger_ So I think I vote for it
02:14 jberger_ It is just that adding controller methods is such an exposed place for breakage
02:16 D4RK-PH0ENiX joined #mojo
02:17 sri Mojo, Mojo::Base, Mojolicious, Mojo::Collection, Mojo::DOM, Mojolicious::Controller, Mojolicious::Route, Mojolicious::Routes
02:18 sri jberger_: those are the classes we couldn't touch between major releases
02:18 sri they have an AUTOLOAD method or are base classes for classes that do
02:20 sri anyway, strictly speaking... by our rules adding a method to any of those classes is not a breaking change
02:22 jberger_ As long as we think about things before we add them and decide that it's with the risk, I think we will be able to justify it later should anyone bring it up
02:23 sri on a related note, got a better name for Mojolicious::Routes::Match::current?
02:24 jberger_ Is it the current match?
02:24 sri current position on the stack
02:24 dvinciguerra joined #mojo
02:24 jberger_ Then it sounds appropriate
02:25 hotsnow joined #mojo
02:25 * sri shrugs
02:25 sri mkay
02:26 sri the name ->continue also seems appropriate for both use cases?
02:26 sri i like that it's a keyword, so it's not as likely to be in use in existing controllers
02:28 jberger_ Good point
02:49 tempire I presume "return;" would work as well as "return undef"
02:49 sri all false values
02:49 good_news_everyone joined #mojo
02:49 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ZjoJqw
02:49 good_news_everyone mojo/master db56c8a Sebastian Riedel: small optimization
02:49 good_news_everyone left #mojo
02:50 tempire so I'm clearly crazy. because I thought that returning false from a bridge stopped the chain.
02:51 sri it does
02:51 sri that's the beauty of it, now you can just continue the chain if you like
02:51 tempire ah.
02:51 tempire looks great to me.
02:51 tempire ++
02:52 tempire Actually, I love it.
02:52 sri \o/
02:52 tempire
02:52 tempire I think non-blocking bridges are a killer feature.
02:53 tempire I might even make a blog entry about it.
02:53 tempire when it's released.
02:53 tempire https://www.youtube.com/watch?v=zZGNk8pUj4Y
03:04 good_news_everyone joined #mojo
03:04 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/HgW7aA
03:04 good_news_everyone mojo/master 166d36a Sebastian Riedel: test tweaks
03:04 good_news_everyone left #mojo
03:06 good_news_everyone joined #mojo
03:06 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/kzomtg
03:06 good_news_everyone mojo/master d77d85b Sebastian Riedel: the actual return value is not important anymore
03:06 good_news_everyone left #mojo
03:09 jberger_ tempire: please do, I would like to read it
03:09 sri well, the feature has the votes it seems
03:11 sri guess it could hit cpan tomorrow-ish
03:14 preflex_ joined #mojo
04:29 dqw joined #mojo
04:48 hummeleBop joined #mojo
06:05 basiliscos joined #mojo
06:06 ab joined #mojo
06:27 yakudza joined #mojo
06:30 dpetrov_ joined #mojo
06:56 dod joined #mojo
06:56 dod joined #mojo
07:03 ec2-user joined #mojo
07:12 KindOne joined #mojo
07:14 dod joined #mojo
07:20 dod joined #mojo
07:21 basiliscos joined #mojo
07:23 arpadszasz joined #mojo
07:29 Vandal joined #mojo
07:34 ec2-user Hello! I have trouble understanding the behaviour of json_is in Test::Mojo. http://pastie.org/8279338 and http://pastie.org/8279362 contain the Mojolicious::Lite based server and its test file respectively. When running this test, I would expect that either json_is picks the json from rerspond_to itself (by setting an appropriate header) and fail because the expected value differs from the given json or that json_is fails b
07:35 ec2-user In fact I feel the 2nd alternative would be expected. What I did not expect is the json_is to succeed. Why does it succeed?
07:46 mire joined #mojo
08:14 aleksey left #mojo
08:15 batman joined #mojo
08:15 marcus joined #mojo
08:15 wsri joined #mojo
08:35 yakudza joined #mojo
08:37 denisboyun joined #mojo
08:58 perlite joined #mojo
09:05 perlite joined #mojo
09:21 arthas joined #mojo
09:29 jpn joined #mojo
09:32 denisboyun joined #mojo
10:12 shmuel_ joined #mojo
10:48 denisboyun joined #mojo
11:00 nicomen why isn't this spitting out /favicon.ico ? $ perl -wle 'use Mojo::DOM; my $s = q{<html><head><link href="/favicon.ico" rel="shortcut icon"></head></html>}; my $d = Mojo::DOM->new($s); my $a = $d->find(q{html > head > link[rel="shortcut icon"]})->attr("href"); print $a;'
11:00 nicomen (without the ->attr() call it spits out the whole <link ...> element)
11:07 nicomen ah it returns an array...
11:07 nicomen *arrayref
11:09 Dandre Hello,
11:10 Dandre I intend to define routes in a MojoliciousPluggin. Where mus they take place?
11:10 Dandre in the register method?
11:16 kthakore joined #mojo
11:31 rem_lex| joined #mojo
11:31 DaTa Dandre: look into the perldoc plugin, it provides a route
11:33 DaTa M::P::PODRenderer
11:34 ec2-user Hello! I have trouble understanding the behaviour of json_is in Test::Mojo. http://pastie.org/8279338 and http://pastie.org/8279362 contain the Mojolicious::Lite based server and its test file respectively. When running this test, I would expect that either json_is picks the json from rerspond_to itself (by setting an appropriate header) and fail because the expected value differs from the given json or that json_is fails b
11:39 mire joined #mojo
11:44 Dandre ok thanks
11:48 Dandre DaTa: what is not clear is why the register method returns the route
11:49 jberger_ register can be thought of like the setup method of a full app
11:49 jberger_ You can do almost anything you want from there
11:50 espent joined #mojo
11:52 Dandre ok so the retuned value from register is not mandatory?
11:52 Dandre what is its meaning?
12:07 denis_boyun joined #mojo
12:27 sri no complaints about ->continue yet, i guess we'll have a release later
12:30 jberger joined #mojo
12:30 bowtie_ joined #mojo
12:45 nicolaas joined #mojo
12:54 jpn joined #mojo
13:13 sri marcus, batman: you're so silent, like the latest version?
13:13 cosmincx joined #mojo
13:13 batman sri: job is killing me :/
13:13 sri nothing can kill the batman
13:14 batman i was hoping you didn't know that... ;)
13:14 mst sri: being repeatedly expected to engage in a battle of wits with an unarmed opponent strains the batman's code of honour
13:14 sri oi!
13:15 batman mst: can you translate to norwegian..? :/
13:15 batman sri: which diff do you want me to look at?
13:16 mst batman: which part didn't make sense?
13:16 batman i think "with an unarmed opponent strains" was what made it confusing...
13:17 sri https://github.com/kraih/mojo/commit/0f​2e52e80f5586bba44682a50ccce37af5488f25
13:17 sri this one is the latest
13:17 sri the diff is rather uninteresting though
13:17 sri http://mojolicio.us/perldoc/Moj​olicious/Guides/Routing#Bridges
13:17 sri better look at the updated bridge recipe
13:19 sri it's now just a false return value, like every other broken chain
13:20 dqw joined #mojo
13:20 batman sri: does that mean that the async operation need to finish before idle timeout ?
13:20 sri that's unrelated
13:21 batman i don't get it. won't the connection just hang when return undef; ..?
13:21 sri nothing about idle timeouts changed
13:22 * batman need to test what happens in current mojo
13:27 batman how do you prevent the new code from rendering 404 when returning false?
13:28 sri there shouldn't be a 404 for suspended bridges
13:28 marcus sri: http://en.wikipedia.org/wiki/Suspension_bridge ?
13:29 batman how do you know if it's not suspended? do you require that the user render(something => ..., status => 401) when not authenticated?
13:29 sri marcus: exactly :)
13:29 sri batman: we always did
13:29 marcus sri: I'm just coding on a hateful obj-c project.
13:30 sri the old bridge code *sometimes* rendered a 404 when you returned false... but that was merely a side effect
13:30 sri it wasn't even consistent between full and lite apps
13:30 batman sri: let me rephrase... do you require the programmer to render *something* when the chain should be broken?
13:30 batman sri: let me rephrase... do you require the programmer to render *something* when the chain should be broken?
13:30 batman sri: let me rephrase... do you require the programmer to render *something* when the chain should be broken?
13:30 sri batman: yes, we always did, look at the documentation examples
13:31 sri batman: your irc client might have a problem
13:31 batman yes. it has. resending messages are broken
13:32 batman sri: so now it will -never- render the 404 page?
13:33 sri right
13:33 batman marcus: i think we got a serious backend problem :(
13:33 sri 404 response for a broken chain is completely illogical
13:33 batman then i think this version is...
13:33 batman AWESOME!
13:33 batman :D
13:33 sri 401 might have made sense if it worked
13:34 sri but i like it much more the way it is now
13:34 sri you break the chain without rendering, we assume you're doing something async, just like for normal actions
13:35 batman yup. makes sense.
13:35 * sri even managed to fix the "Nothing has been rendered, expecting delayed response." log message :)
13:37 btyler joined #mojo
13:37 * sri is with tempire on this now, it's a killer async feature o/
13:37 batman hehe
13:42 marcus batman: I think so too. I get lots of timeouts and disconnects since we updated yesterday.
13:42 batman yup
13:43 sri never update!
13:45 batman joined #mojo
13:45 marcus joined #mojo
13:45 wsri joined #mojo
13:46 mire joined #mojo
13:55 asarch joined #mojo
14:01 bluescreen joined #mojo
14:03 bluescreen_ joined #mojo
14:21 Dandre how can I get logs with a mojolicous application?
14:21 batman mkdir app-root/log
14:21 Dandre I had them when using Lite version
14:22 Mikey http://search.cpan.org/~graf/Mojolicious-Plugin-Ac​cessLog-0.003/lib/Mojolicious/Plugin/AccessLog.pm
14:23 good_news_everyone joined #mojo
14:23 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/mWd8lA
14:23 good_news_everyone mojo/master 5743a7f Sebastian Riedel: small optimization
14:23 good_news_everyone left #mojo
14:23 Dandre ok thanks
14:26 hummeleBop joined #mojo
14:34 gryphon joined #mojo
14:57 dqw joined #mojo
14:57 mire joined #mojo
15:10 asarch joined #mojo
15:11 sri tempire: btw. you recently said you wanted to turn render_jsonp into render(jsonp =>
15:11 sri you can't do that
15:11 sri we have no hook for that yet
15:12 * sri just remembered because of the before_render hook topic on the mailing list
15:13 sri that hook allowed for special render arguments
15:13 sri but it's gone for a long time
15:29 tempire I'm done with Mojolicious FOREVER
15:29 tempire $self->continue;
15:29 tempire !
15:30 sri return undef;
15:30 * sri starts to remember the problems before_render had
15:31 sri recursion was a pretty big issue
15:34 sri soooo... everybody had the time to review the commits and veto... suppose we are release ready
15:37 sri gonna run another 5k now and release afterwards... unless someone beats me to it :)
15:48 ryozi joined #mojo
15:54 Dandre do you mean there will be a 5.0 soon? or 4.28?
16:05 marcus Dandre: sure hope we're not doing 5.0 already. lots of 4.* numbers to use
16:06 basiliscos joined #mojo
16:07 Dandre sure
16:08 Dandre in the mojo_template application I see this:
16:08 Dandre $self->plugin('I18N' => {default => 'en', namespace => 'Example::I18N', support_url_langs => [qw(ja en)]});
16:09 Dandre Where can I get doc on plugin method parameters and there use?
16:09 good_news_everyone joined #mojo
16:09 good_news_everyone [mojo] kraih tagged v4.28 at bbcf59a: http://git.io/5dd_Mg
16:09 good_news_everyone left #mojo
16:10 tempire \o/
16:11 sri \o/
16:12 marcus run sri run.
16:12 tempire see sri run
16:12 sri meep meep
16:12 dvinciguerra joined #mojo
16:16 Dandre ok found, sorry
16:24 arpadszasz joined #mojo
16:33 d4rkie joined #mojo
16:42 dod joined #mojo
16:47 * sri has just discovered an interesting ruby idiom that involves .tap
16:47 avenj joined #mojo
16:50 sri http://pastie.org/8280734
16:52 batman Mojo::IOLoop->stream($self->tx​->connection)->timeout(3600); # is it stupid to set such an high timeout on websocket?
17:04 batman is there anyway i can send ping frames from the mojo server?
17:04 batman oh. $c->send([1, 0, 0, 0, 9, 'Hello World!']);
17:06 mib_atojt6 joined #mojo
17:07 sixBB joined #mojo
17:08 mib_atojt6 Hi, this is probably not the right place to ask this but I upgraded Mango from 0.04 to 0.12 and now I get an "Can't call method "query" on an undefined value" when doing a simple find_one query. What was changed?
17:09 sri a lot has changed
17:09 batman i think it's the exact right place
17:10 sri that error sounds like the mango instance goes out of scope and gets garbage collected though
17:10 sri but i'm just guessing
17:15 batman mib_atojt6: do you have a lite or full app?
17:16 mib_atojt6 a small console app, no Mojolicious in this
17:16 batman right... do you think it's possible what sri said? do you understand what he says?
17:17 good_news_everyone joined #mojo
17:17 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/JdHX1g
17:17 good_news_everyone mojo/master fd14a7b Sebastian Riedel: documentation tweaks
17:17 good_news_everyone left #mojo
17:28 tianon if it's small, how about a pastebin? :)
17:30 mib_atojt6 batman: nope, not really, I'm not sure what he's saying but I'm try to figure it out :)
17:31 mib_atojt6 tianon: it simply fails on a basic find_one query, i.e. something like $argo->find_one( { COURSE => $bb_course } )
17:31 tianon sounds like we need more information about where $argo comes from :P
17:31 howitdo joined #mojo
17:32 mib_atojt6 my $mango   = Mango->new('mongodb://localho​st:27017')->db($semester);my $argo    = $mango->collection('argo');
17:33 sri your $mango is not a mango instance but a db
17:33 sri the db holds only a weakened reference to the mango instance, so it gets lost
17:34 tianon thus: my $mango   = Mango->new('mongodb://localhost:27017'); my $db = $mango->db($semester); my $argo = $db->collection('argo');
17:35 mib_atojt6 oh wow, it did work when I did
17:35 mib_atojt6 my $mango   = Mango->new('mongodb://localhost:27017');
17:35 mib_atojt6 my $mango_db = $mango->db($semester);
17:35 mib_atojt6 my $argo    = $mango_db->collection('argo');
17:37 mib_atojt6 tianon: thank you very much!
17:38 tianon lol thank sri, he's the wizard here \o/
17:38 sri i'll mention in the docs that the reference is weakened
17:39 sri it's a bit unfortunate we have to do it, but i don't see nother way to avoid leaks
18:12 batman joined #mojo
18:12 marcus joined #mojo
18:12 wsri joined #mojo
18:31 wsri joined #mojo
18:31 marcus joined #mojo
18:31 batman joined #mojo
18:34 sri https://github.com/kraih/mango/commit/3​ae9a9acf48a30695d7b733953e55c23b08615ac
18:34 sri hope that helps
18:35 sri hmm... that actually sounds weird
18:36 dfarias joined #mojo
18:37 sri "Note that this reference is usually weakened, so the L<Mango> object needs to be referenced elsewhere too."
18:42 sk joined #mojo
18:43 sk Good Evening
18:57 mire joined #mojo
19:01 sri o/
19:34 duncanthrax joined #mojo
19:36 arpadszasz joined #mojo
20:00 marty o/
20:01 marty Larry Walls line "the first 80% is done.  Now we'll start work on the next 80%" describes my life for the last two months.  :(
20:01 tempire in formal docs, it's usually best to use "as well" instead of "too"
20:03 tempire bah
20:03 tempire what I mean is, it sounds better.
20:03 tempire "usually best" doesn't mean anything.
20:05 marty english is hard, lets go shopping!
20:06 good_news_everyone joined #mojo
20:06 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/0RAvKg
20:06 good_news_everyone mojo/master 65c2e51 Sebastian Riedel: more tests for non-blocking operations in bridges
20:06 good_news_everyone left #mojo
20:12 sri \o
20:30 duncanthrax joined #mojo
20:46 good_news_everyone joined #mojo
20:46 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/tjws1g
20:46 good_news_everyone mojo/master c97acb8 Sebastian Riedel: more tests for delayed rendering
20:46 good_news_everyone left #mojo
21:05 perlite_ joined #mojo
21:40 denisboyun joined #mojo
21:58 russum joined #mojo
22:13 duncanthrax2 joined #mojo
22:36 russum left #mojo
22:42 jzawodn joined #mojo
22:47 jzawodn joined #mojo
23:20 russum joined #mojo
23:33 dvinciguerra joined #mojo
23:33 dsteinbrunner joined #mojo

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