Camelia, the Perl 6 bug

IRC log for #mojo, 2012-06-20

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

All times shown according to UTC.

Time Nick Message
00:07 sri marcus, tempire: you've not said yay or nay to user agent plugins yet
00:07 tempire the j for ojo?
00:07 sri $ua->plugin('Gzip')
00:08 tempire well I like the idea of useragent plugins, for sure
00:08 sri Mojolicious::Plugin thingys for Mojo::UserAgent
00:08 sri i like the idea too, but i'm not sure if it's worth it
00:09 tempire if you consider ->json like a plugin, it's definitely worth it
00:09 sri that's not how it works
00:09 sri plugins can only use events and decorate transactions
00:11 sri if you want to extend the actual api you still need to subclass
00:11 tempire example?
00:11 sri for?
00:11 tempire you mean like it would be able to handle and decode the gzip format?
00:12 sri that's one thing that can be done from events
00:12 tempire so how is that different from decoding retrieved json?
00:12 sri decorating the transaction, changing the content and headers... and the like
00:13 sri ->json is api, not something that just happens
00:13 sri plugins can change transaction data, but not the api
00:15 tempire so my $thing = $ua->plugin('Something')->ge​t('domain.com')->res->body, where $thing could be different depending on what the plugin does.
00:15 sri that's possible
00:18 sri i guess Mojo::UserAgent::Plugin::DoNotTrack would make a good canonical example
00:19 sri the actual usefulness is still questionable though :/
00:40 yko joined #mojo
00:43 tempire I don't know that I like a tx being changed because of something else that happened further up in the change.
00:43 tempire s/in the change/in the chain/
00:43 sri happens on the server side already
00:44 sri Mojo::UserAgent::Plugin::DoNotTrack for example would just set a DNT header with the value 1
00:45 sri it's not like we are enabling anything new, it's just packaging it
00:46 sri the start event of Mojo::UserAgent is already extremely powerful
00:47 sri but i guess the fact that nobody is really convinced that it is actually a good idea should be argument enough not to do it :)
00:49 sri aside from gzip all examples have been silly or not yet implementable
00:50 sri caching would need the ability to short circuit requests, and authentication multiple roundtrips
00:51 sri maybe in 4.0
00:56 bird joined #mojo
00:56 yko joined #mojo
01:02 laouji joined #mojo
01:12 bzero joined #mojo
01:14 scott_ joined #mojo
01:16 d4rkie joined #mojo
01:24 tempire http://twitpic.com/z08mc/full
01:29 sri !
01:40 SmokeMachine joined #mojo
01:46 SmokeMachine joined #mojo
01:49 zivester joined #mojo
01:58 GitHub130 joined #mojo
01:58 GitHub130 [mojo] kraih pushed 1 new commit to master: http://git.io/5UgUiQ
01:58 GitHub130 [mojo/master] added example for r function - Sebastian Riedel
01:58 GitHub130 left #mojo
02:08 noganex joined #mojo
02:15 zivester_ joined #mojo
02:18 SmokeMachine_ joined #mojo
02:35 tetraodontidae joined #mojo
03:08 zivester joined #mojo
03:36 knshaum_ joined #mojo
03:56 Leandr joined #mojo
04:06 CromeDome joined #mojo
04:32 tetraodontidae joined #mojo
04:57 Foxcool joined #mojo
05:17 fhelmber_ joined #mojo
05:18 d0as8 joined #mojo
05:18 Leandr joined #mojo
05:43 spaceships joined #mojo
06:04 AmeliePoulain joined #mojo
06:11 ovnimancer joined #mojo
06:24 Patterner joined #mojo
06:32 * tempire is intrigued by livescript
06:38 Vandal joined #mojo
07:12 migo joined #mojo
07:24 batman joined #mojo
07:28 nicolasbd joined #mojo
07:28 nicolasbd hello !
07:29 nicolasbd in my Mojo Base, I use Plugin::Mount to load a "sub" application, defining a new route accessing its main "script", but it seems that when it's called, the session expires ... any idea how to fix this ?
07:30 stephan48 different secrets?
07:31 nicolasbd i heard about "secret" phrase, I guess it's used to generate the session ID, but I didn't changed it anywhere .. (I know I must do that). So, should I change it and set the same in both apps ?
07:33 stephan48 try
07:34 nicolasbd yes, I'm looking for that .. but where should I do it ? in my lib/App.pm ?
07:34 nicolasbd thanks anyway, I think it will fix the problem, i didn't think of it
07:35 stephan48 in startup()
07:35 stephan48 or via app->secret in lite apps
07:37 nicolasbd it works, thank you very much !
07:49 lungching joined #mojo
07:54 cosmincx joined #mojo
08:06 xaka joined #mojo
08:14 spleenjack joined #mojo
08:15 pau4o joined #mojo
08:32 rem_lex|pivo joined #mojo
08:48 marcus tempire: <3
09:08 Debolaz[Lo] joined #mojo
09:17 * tempire blushes
09:17 * Debolaz[Lo] dances
09:50 bc547 joined #mojo
10:25 bc547 is it normal a simple helloworld lite application takes approx 3 to 4% cpu doing nothing when started?
10:29 osprey_ joined #mojo
10:37 daxim joined #mojo
10:40 pau4o joined #mojo
10:44 sri hmm, different secrets is an interesting problem
10:45 Debolaz[Lo] bc547: As far as I understood it, there will be a very tiny amount of CPU use when idling and you're using the builtin web server due to the way it works. It's nothing to be concerned about.
10:46 bc547 Debolaz[Lo]: 4% cpu on 1 core of an X5670 cpu is not 'very tiny' i would think :-)
10:53 nicolasbd sri, you think each app should have its own secret phrase ?
10:54 sri nicolasbd: that seems impossible
10:54 nicolasbd sri: yeah, for me too
10:54 nicolasbd i mean, it seems impossible to me as well
10:54 sri i'll document how to sync secrets between apps
10:55 nicolasbd sri: I made a var named $SECRET (without any "my") and I can access it in the "sub" app
10:55 sri bc547: i'll make the 4% idle usage more configurable
10:56 bc547 sri: what is the cause of it? polling? housekeeping?
10:56 sh9 joined #mojo
10:56 nicolasbd sri: but I have another problem now, using Plugin::Mount .. when I mount it with a route like "/myPluginName", no problem, but when I try to set it as "/Plugins/MyPluginName" I get a 404 error .. although Mojolicious "sees" the route
10:57 nicolasbd sri: should the path to the sub app script change ?
10:57 sri bc547: interval in which the accept mutex is checked
11:00 sri btw. idle cpu usage is 0.3% here
11:01 bc547 sri: hmm.. strange. I'll test it first on some other systems
11:02 sri hmm, i can't really think of a good name for the attribute though :/
11:03 sri idle_interval?
11:14 bc547 sri: The first test I mentioned was in a vmware guest, but I just did exactly the same on a dual X5650 (not in vmware) with RHEL6 64bit and it also takes 3 to 4% cpu.
11:14 marcus modern obj-c is pretty rad.
11:14 marcus NSString *path = @(getenv PATH);
11:15 marcus and no more synthesising properties.
11:17 jventer joined #mojo
11:19 alnewkirk joined #mojo
11:21 jventer left #mojo
11:23 nicolasbd marcus: what does "rad" mean ? (i'm french, so i'm not sure i get the good meaning of the word)
11:23 marcus nicolasbd: radical :)
11:24 nicolasbd marcus: ok, thx
11:24 Debolaz[Lo] marcus: Old obj-c was pretty rad too. It just wasn't as popular. :)
11:24 marcus nicolasbd: http://www.urbandictionary.com/define.php?term=rad
11:24 marcus Debolaz[Lo]: literals and cleaning up the properties helps a lot tho.
11:25 nicolasbd marcus: i'm not sure how "synthetise" should be used : for declaring a variable instead of "NSString *myVar " ? or just in order to build accessors to it ?
11:25 Debolaz[Lo] True.
11:26 marcus nicolasbd: synthesise is a keyword to generate setters and getters for your properties.
11:26 marcus @property (readonly) NSString *foo;
11:26 bc547 sri: also on a 32bit arch linux, it uses 4% idling.. any idea what causes the difference between my results and yours?
11:27 marcus xcode now automatically does @synthesize foo=_foo , creating setFoo: and getFoo and using the internal variable _foo
11:28 nicolasbd marcus: huh .. ok. But i still should declare "NSString *myString" right ?
11:28 sri bc547: i know exactly what causes it, like i said before
11:29 nicolasbd sri: sorry to re-disturb but have you any idea why Plugin::Mount works with "/myPlugin" route and not with "/plugins/myPlugin" ?
11:29 marcus nicolasbd: yes.
11:29 bc547 sri: yes... but you said you only got 0.3%
11:30 andrefs joined #mojo
11:31 nicolasbd marcus: ok thanks .. ! weird to learn that on this chan, but useful. I think a tried not to declare it in old fashioned way, and it worked (with only @property) .. but i'm not sure. It might be not really good anyway
11:31 marcus nicolasbd: these new features will be available from xcode 4.4, or in 4.5 which is in beta
11:32 marcus nicolasbd: I recommend seeing the 'modern objective-c talk' from wwdc, which was just released.
11:33 nicolasbd marcus: ok thank you !
11:41 GitHub80 joined #mojo
11:41 GitHub80 [mojo] kraih pushed 1 new commit to master: http://git.io/WRPdzA
11:41 GitHub80 [mojo/master] added idle_interval attribute to Mojo::IOLoop and improved to method in Mojolicious::Routes::Route - Sebastian Riedel
11:41 GitHub80 left #mojo
11:42 sri suggestions for a better name than idle_interval would be welcome
11:43 sri perl -Mojo -E 'Mojo::IOLoop->singleton->idle_interval(0.5); a({text => "works!"})->start' daemon
11:43 sri that changes idle cpu usage
11:43 sri finding the right value is your problem though ;p
11:45 sri accept performance will change as well
11:47 bc547 sri: tnx! i'll do some tests and benchmarks
11:49 * sri wonders if app secrets should just be synchronized automatically by the mount plugin
12:00 * nicolasbd think it should be a good and simple idea
12:00 nicolasbd "thinks it could", sry
12:01 MisterHatt this is probably overkill/lazy but I have an API I'm writing in Mojolicious, only I find I'm spending more time disabling and overriding things than actually working on features, am I may better off just using the parts of Mojo that I need directly?
12:01 MisterHatt websockets are a requirement so dancer and friends arent really gonna fly easily either
12:13 andrefs joined #mojo
12:16 bc547 sri: for your information: 0.5 gives 0% idle cpu usage (too low to measure with top), 718req/sec, 0.05 2%cpu 883req/sec, 0.025 4%cpu 921req/sec, 0.005 18%cpu 910req/sec. Test was done with ab -c 30 -n 10000 -k http://127.0.0.1:3000/)
12:19 sh9 joined #mojo
12:28 marcus MisterHatt: what kind of things are you disabling/overriding?
12:30 * sri gives up on st2 for now :/
12:31 marcus sri: why?
12:31 sri too many bugs and quirks
12:31 sri i'll just stick with tm1 for now and wait
12:32 sri search in project is way too important for my workflow too
12:32 whee sri: I hope you're reporting the bugs :D
12:33 MisterHatt marcus: most of the rendering templates (for 404 etc), headers, and a heap of handlers for auth processing and other things
12:33 MisterHatt a few other less important bits
12:33 sri whee: i have
12:33 sri most are actually known already though, so i just voted on them
12:34 whee I've probably been using st2 long enough to not notice :/
12:34 whee the search in project thing is a little dumb, yes
12:35 * MisterHatt has gotten used to chocolat for most things, at least the bugs in it dont impact here much
12:36 sri i can't work without perltidy
12:37 MisterHatt I think the only extension I use in sublime at least is perlcritic
12:37 MisterHatt although it breaks half the time
12:38 MisterHatt I wasnt using OSX when textmate was under active development though so st2 was my first main editor her
12:38 sri breakage has no place in my workflow
12:38 MisterHatt you're a developer by trade though yeah?
12:39 * sri is tm1 user #1407 :)
12:39 MisterHatt most of my code still happens in nano/vim on jump-servers, but that comes from not being much of a dev
12:39 MisterHatt sri: oldschool
12:39 * marcus is 8363 :-/
12:40 marcus but at least I have a 3 digit slashdot it =)
12:40 marcus id even
12:44 whee I think sublime needs more people working on it, but I doubt that'll happen :/
12:54 MisterHatt marcus: so any idea? essentially I just need to be returning JSON and some particular headers, while I suppose I could write templates for 404 and whatnot, I'd rather disable all the auto render responses altogether and handle it manually to keep in practice with how it should be acting
12:55 MisterHatt that said, JSON and websocket are a requirement and mojo just handles those so much more gracefully than dancer/sinatra
12:55 marcus MisterHatt: I'd just return [] for 404 template :)
12:55 marcus MisterHatt: didn't think we have any auth processing by default btw
12:56 andrefs joined #mojo
12:56 sri marcus: we don't
12:56 MisterHatt yeah I put in a handler for that
12:56 MisterHatt just using one of the hooks
12:57 sri so, basically you're not overriding anything
12:57 marcus right, so that's not something you had to disable/override, that's something you added.
12:57 MisterHatt that's the only thing I did add though
12:57 MisterHatt the rest was having to work around auto rendering templates and getting rid of headers I dont/cant have and then having to add my own
12:57 marcus MisterHatt: can't see how you get along without *some* response for 404.
12:58 MisterHatt marcus: yeah, I have my own 404 handler, the trouble is the default stuff and not seeing any docu on disabling it
12:58 marcus MisterHatt: $self->render_later()
12:59 MisterHatt so I cant help but wonder if maybe I'm just using mojolicious in a way it shouldn't be used and should work around mojo itself directly...
12:59 MisterHatt oh?
12:59 marcus MisterHatt: disables automatic rendering.
12:59 MisterHatt I see
13:00 MisterHatt and that's something I want to be doing at the app level or each controller?
13:00 sri isn't it obvious how to disable the default 404?
13:00 MisterHatt sri: not obvious enough?
13:01 MisterHatt I definitely remember seeing it before but when I looked recently it was explicitly mentioned anywhere, or made particularly obvious
13:01 sri any '/*whatever' => {text => 'This one catches everything!'};
13:01 sri it's just how routing works
13:01 MisterHatt right
13:01 marcus gotta catch'em all
13:01 MisterHatt guess I dont have developer intuition then
13:02 MisterHatt marcus: awesome, now I have to write this as '/*pokemon'
13:02 MisterHatt also from what I can tell, render_json and setting a status doesn't appear to actually set the return code like I'd expect
13:05 marcus MisterHatt: perl -Mojo -e'a("/" => sub { shift->render(json=>{hello =>"world"}, status=>401)})->start' daemon'
13:05 marcus MisterHatt: renders a 401
13:06 sri marcus: you can write that oneliner even nice :) perl -Mojo -E 'a({json => {hello => "world"}, status => 401})->start' get / -v
13:06 sri *+r
13:07 marcus sri: nice
13:07 marcus nicer :)
13:09 Psyche^ joined #mojo
13:10 GitHub135 joined #mojo
13:10 GitHub135 [mojo] kraih pushed 1 new commit to master: http://git.io/jH7S7A
13:10 GitHub135 [mojo/master] improved Mojolicious::Plugin::Mount to automatically synchronize secrets - Sebastian Riedel
13:10 GitHub135 left #mojo
13:12 CromeDome joined #mojo
13:36 gryphon joined #mojo
13:46 jnap joined #mojo
13:47 nicolasbd so you just improved Plugin::Mount ? changes will be effective in Mojolicious v.2.99 ?
13:52 xaka joined #mojo
14:00 sri 3.0
14:01 sri i actually wanted to release 3.0 yeaterday, but you folks keep reporting bugs and sending me pull requests -.-
14:05 inokenty joined #mojo
14:05 inokenty left #mojo
14:05 inokenty joined #mojo
14:08 alester joined #mojo
14:10 jnap_ joined #mojo
14:11 stephan48 sri: why dont you declare a feature freeze then?
14:11 sri stephan48: what would we gain from that?
14:11 stephan48 all bugs are processed and by the end of the week you tag the resulting as 3.0
14:11 stephan48 and all enhancements are stalled till after that
14:11 stephan48 oh nothing
14:12 sri we now have a release blocking bug anyway
14:13 sri new IO::Socket::IP just broke all our ipv6 tests
14:15 sri and the mount plugin change is also not right yet :(
14:16 stephan48 :(
14:16 stephan48 whats fucked up with IO::Socket::IP again?
14:16 iansealy left #mojo
14:16 sri if i knew it would be fixed already
14:19 sri guess we need a MOJO_SECRET env var to make the mount plugin actually work
14:20 Netfeed awh, i hoped for three digits :( wanted a 2.100
14:21 sri hmm, this is a real problem
14:21 sri if a custom secret is set in the embedded app it will override the shared one
14:22 * sri is running out of ideas
14:22 stephan48 sri: make mojolicious mounted aware?
14:22 sri how?
14:22 stephan48 the env could be a additional goodie
14:23 stephan48 f.e. a env var? a default value?
14:23 * sri doesn't follow
14:23 Netfeed secret_app and secret_plugin where app is always set and the mounted app can do whatever it want with _plugin/_embedded or w/e
14:24 * sri still doesn't follow
14:25 sri the problem is a mounted app may also have mounted apps
14:25 sri we set the common secret after instantiating the app, so the third layer already inherited the wrong secret
14:28 alester Howdy all.
14:29 * sri waves
14:29 sri hmm
14:30 Leandr joined #mojo
14:30 sri one way would be a mojo.secret stash value that gets passed along from app to app
14:30 jnap joined #mojo
14:32 stephan48 sri: make a value/key/attrib set somewhere which indicates to a app its mounted and should take the secret from a app its mounted from
14:32 ysyrota joined #mojo
14:32 sri there is no connection between those apps
14:32 stephan48 oh
14:33 knshaum joined #mojo
14:33 stephan48 then an env var would be good
14:33 sri no
14:33 sri if the embedded app sets app->secret('screw you!') it would override the env var
14:34 stephan48 make the env var take precedence?
14:36 sri then you can only change the secret once
14:37 sri since there would have to be something like $ENV{MOJO_SECRET} //= $secret;
14:39 sri a mojo.secret stash value is the only solution i see
14:40 stephan48 you saied they where seperate, so why the stash would be passed?
14:41 sri the stash gets passed along for requests
14:42 sri and routes get temporarily connected (but that's not relevant)
14:42 sri there is no direct connection
15:11 alnewkirk joined #mojo
15:12 alnewkirk joined #mojo
15:16 alnewkirk joined #mojo
15:33 jnap joined #mojo
15:41 jfuller joined #mojo
15:41 jfuller I'm receiving a rather strange error on a mojolicious::lite app. On form post, its erroring with: "Not whitespace after PUBLIC ID in DOCTYPE" has anyone seen this before?
15:47 sri ok, IO::Socket::IP 0.15 completely broke compatibility with IO::Socket::SSL... and that's by design
15:47 sri i hate this
15:47 sri not sure if we should just switch back to INET6
16:04 tetraodontidae joined #mojo
16:10 marty joined #mojo
16:10 andrefs joined #mojo
16:13 sh9 joined #mojo
16:19 tetraodontidae joined #mojo
16:19 osprey_ left #mojo
16:22 xaka joined #mojo
16:23 marty joined #mojo
16:30 jnap joined #mojo
16:59 GitHub29 joined #mojo
16:59 GitHub29 [mojo] kraih pushed 1 new commit to master: http://git.io/XGCf-w
16:59 GitHub29 [mojo/master] fixed IPv6 support and a bug that prevented sessions from working in embedded applications - Sebastian Riedel
16:59 GitHub29 left #mojo
17:00 sri now we depend on a version of IO::Socket::IP that's not released yet -.-
17:00 sri yay for bledding edge
17:05 GitHub189 joined #mojo
17:05 GitHub189 [mojo] kraih pushed 2 new commits to master: http://git.io/r0KgJQ
17:05 GitHub189 [mojo/master] Corrected typo in FAQ. - Spiros Denaxas
17:05 GitHub189 [mojo/master] Merge pull request #341 from spiros/master - Sebastian Riedel
17:05 GitHub189 left #mojo
17:06 sri but we do have fallback support now with IO::Socket::IP
17:07 sri if you get 10 addresses back it will try connecting to all 10
17:08 asarch joined #mojo
17:09 pau4o left #mojo
17:25 mire joined #mojo
17:33 tetraodontidae joined #mojo
17:37 Foxcool joined #mojo
17:40 Liam`` joined #mojo
17:46 sri anyone got a better name for idle_interval?
17:46 whee what does it do?
17:46 Liam`` joined #mojo
17:47 sri http://mojolicio.us/perldoc​/Mojo/IOLoop#idle_interval
17:48 whee nope! heh
17:48 sri ;p
17:49 whee I thought accept_interval, but it sounds like it controls more than that
17:50 sri accept mutex, graceful connection close and graceful shutdown of the whole thing
17:52 GitHub5 joined #mojo
17:52 GitHub5 [mojo] kraih pushed 1 new commit to master: http://git.io/BASkeg
17:52 GitHub5 [mojo/master] fixed Changes file - Sebastian Riedel
17:52 GitHub5 left #mojo
17:53 whee event_interval?
17:54 sri the main motivation for changing it is to trade responsiveness for idle cpu usage
17:55 sri event is too generic
17:55 whee checkiness ;)
18:00 Liam`` joined #mojo
18:02 sri hmmmmm
18:06 mire joined #mojo
18:07 xaka the sad part of 0.025 interval is that it eats 2% of my CPU on i5 in "idle mode", i always wanted to change it to 1s interval at least
18:23 GitHub94 joined #mojo
18:23 GitHub94 [mojo] kraih pushed 1 new commit to master: http://git.io/BnOhbw
18:23 GitHub94 [mojo/master] fixed POD formatting - Sebastian Riedel
18:23 GitHub94 left #mojo
18:26 d4rkie joined #mojo
18:35 tetraodontidae joined #mojo
18:36 jwang joined #mojo
18:40 dmn001 joined #mojo
18:45 sri never noticed how much i actually depend on project search
18:45 * sri hugs textmate
19:00 loy joined #mojo
19:02 dmn001 joined #mojo
19:05 jnap joined #mojo
19:17 bc547 sri: maybe watchdog_interval? it watches over the connections and does connection housekeeping
19:18 sri hmmmm
19:26 jnap joined #mojo
19:32 sri nginx calls it the accept_mutex_delay
19:33 sri and they make it default to 500ms
19:33 sri interesting
19:35 sri accept_interval might be a good choice
19:37 whee nailed it
19:51 GitHub105 joined #mojo
19:51 GitHub105 [mojo] kraih pushed 1 new commit to master: http://git.io/bsZg_A
19:51 GitHub105 [mojo/master] renamed idle_interval to accept_interval - Sebastian Riedel
19:51 GitHub105 left #mojo
19:59 russum joined #mojo
20:03 jnap joined #mojo
20:22 mire joined #mojo
20:59 rwstauner joined #mojo
21:19 sri oh my, futurama is back
21:24 diegok tempire: is there some way to make Net::Heroku (trying your deploy plugin) stop asking for credentials neither telling needing api-key
21:25 diegok I'm using -a `heroku auth:token`
21:36 tempire you only need to enter the credentials once
21:36 tempire it will then retrieve the api key and store it in $HOME/.heroku/credentials
21:47 lukep joined #mojo
21:52 sri \o\
21:52 sri /o/
21:58 andrefs joined #mojo
22:06 * marcus got suckered into playing minecraft...
22:06 marcus 5 hours later...
22:15 GitHub159 joined #mojo
22:15 GitHub159 [mojo] kraih pushed 1 new commit to master: http://git.io/SSyuWw
22:15 GitHub159 [mojo/master] added another hook example - Sebastian Riedel
22:15 GitHub159 left #mojo
22:21 gryphon joined #mojo
22:24 tempire marcus: no synths!  awesome
22:24 tempire and 'bout time
22:24 tempire \o\
22:24 tempire \/o/
22:24 sri /o\
22:30 tempire thank goodness
22:30 tempire my klouchebag score is low
22:34 sri brogrammers!
22:56 jventer joined #mojo
23:27 Patterner joined #mojo
23:30 mojobot2976 joined #mojo

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