Camelia, the Perl 6 bug

IRC log for #mojo, 2012-04-07

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

All times shown according to UTC.

Time Nick Message
00:17 mojobot50122 joined #mojo
01:00 xaka joined #mojo
02:00 crab what is a /spawn request, and how does one "start a job"?
02:00 crab and what should the request do if not block?
02:26 * sri yawns
02:46 kthakore crab: it should run java -jar foo.jar &> log
02:46 kthakore the request should send back a success for if the job started with no error
02:46 kthakore hi sri
02:46 * sri waves
02:46 kthakore sri: trying to make REST api to start a long running stats job
02:46 sri that sounds like a job for a real event loop
02:47 GitHub37 joined #mojo
02:47 GitHub37 [mojo] kraih pushed 1 new commit to master: http://git.io/bFavSQ
02:47 GitHub37 [mojo/master] added another Mojo::Reactor example - Sebastian Riedel
02:47 GitHub37 left #mojo
02:47 kthakore yeah I want something to watch the log and send a thing to the websocket/eventsource to the front end when done
02:47 sri http://mojolicio.us/perldoc/Mojoli​cious/Guides/Cookbook#Event_loops
02:48 kthakore sri: oh thse are timers ... but I dunno the time it will take to run
02:49 sri the timers are just an example
02:49 sri IO::Async and AnyEvent have process watchers too
02:49 sri the point of the recipe is to show that you can use arbitrary event loop features
02:49 kthakore cool
02:51 sri we are just consumers and hook into the event loop you choose, everything beyond that point is event loop specific
02:53 sri EV support in IO::Async is still rather new and there might be bugs, AnyEvent has the best EV support, but if you need support at some point IO::Async is the much better choice
02:53 * sri still needs to get someone to fix POE::Loop::EV, so we can have a POE example in the documentation too
02:56 Liam joined #mojo
03:00 Liam joined #mojo
03:02 kthakore sri: ok
03:02 kthakore gonna try IO::Async script just to run job and come back to tell me first?
03:02 kthakore then try hooking to mojo
03:17 d4rkie joined #mojo
03:24 kthakore sri: I think it worked .... or not
03:24 kthakore :[
03:26 abra joined #mojo
03:28 d4rkie joined #mojo
03:29 kthakore sri: What am I doing wrong here http://paste.scsys.co.uk/191813
03:30 sri i've not used IO::Async for that yet
03:30 kthakore so use AnyEvents process thing?
03:30 sri wait
03:30 sri $loop->stop?
03:30 kthakore yeah
03:30 sri why would you stop it?
03:30 kthakore it was from http://search.cpan.org/~pevans/IO-​Async-0.47/lib/IO/Async/Process.pm
03:30 kthakore on_finish I guess
03:30 sri you're basically shutting down the server
03:31 kthakore ah ok so I don't want that
03:32 kthakore but It is still not rendering
03:32 sri that's the only obvious problem i see
03:32 kthakore ok got rid of that
03:32 kthakore stil geting inactivity timeout
03:32 kthakore I just want to /spawn the job
03:33 kthakore and have it come back and push to a /watch for websockets/evensource
03:33 sri i would imagine on_finish is not triggered for some reason
03:34 kthakore do I need a loop->run()
03:34 sri no
03:34 sri the server is the running loop
03:37 sri haha
03:37 sri i think it actually does work
03:37 kthakore hmm?
03:37 kthakore sri: what do I do?
03:38 sri $stuff is empty
03:38 sri so there is nothing to render
03:38 kthakore oh yeah I cahnged that
03:38 kthakore no go
03:38 sri works here
03:39 sri the process watcher is not working, but everything else is fine
03:41 kthakore can you send me what you changed?
03:41 kthakore so how do I get it do send to websocket on_read
03:41 kthakore and on_start just render "started" I guess right?
03:45 kthakore http://paste.scsys.co.uk/191824 <-- sri
03:45 sri https://gist.github.com/2324894
03:45 kthakore this gives me Started Process
03:45 kthakore but none of the rest
03:45 purl none of the rest is open
03:46 kthakore also this error
03:46 kthakore EV: error in callback (ignoring): Can't call method "res" on an undefined value at /home/kthakore/.perl5/perls/perl-5.14.2/lib​/site_perl/5.14.2/Mojolicious/Controller.pm line 382.
03:46 sri see my example
03:47 sri i just noticed that it does not work in hypnotoad for some reason though
03:47 kthakore horray bugs for sri?
03:47 sri not really
03:48 sri maybe
03:48 kthakore erm still not workign for me
03:48 kthakore I am using github release
03:49 sri event loops are hard, lets go shopping!
03:49 kthakore yaya!
03:49 kthakore what will we buy?
03:49 kthakore maybe a new event loop
03:49 kthakore shit
03:49 kthakore oh well
03:49 kthakore I need a break
03:51 kthakore Think I will do a simple DB/worker thingie then
03:56 sri good choice
03:56 sri i'm always too optimistic when it comes to spawning processes from a web app... it *never* works protably
03:57 sri *portably
04:03 sri no clue why child watchers don't work in hypnotoad, signal handlers are reset properly after spawning a child and IO::Async does not seem to use any weird tricks
04:10 sri hmm
04:10 sri it is IO::Async i'm afraid
04:11 sri because i got it working with AnyEvent
04:14 sri kthakore: https://gist.github.com/2324993
04:14 sri that one appears to be working rather portably
04:16 sri (DB/worker thingy is of course a better solution)
04:17 sri oh wait, you wanted to specifically stream the result
04:18 * sri shrugs
04:28 sri neat, i get 90rps out of that with hypnotoad on my little macbook :)
04:30 xaka1 joined #mojo
04:31 xaka joined #mojo
04:31 Foxcool joined #mojo
04:38 kthakore sri: sorry
04:38 kthakore sri: cool
04:38 kthakore let me see
05:22 abra joined #mojo
05:38 kaare joined #mojo
05:39 avkhozov joined #mojo
06:14 marcus I see metacpan has a new logo.
07:05 alnewkirk unfortunately, yes
07:30 Patterner you don't like "meta::cpan"?
07:45 buu I would have been happier with capitals!
07:52 black joined #mojo
08:15 hipyhop joined #mojo
08:22 Htbaa joined #mojo
08:41 GitHub177 joined #mojo
08:41 GitHub177 [mojo] kraih pushed 1 new commit to master: http://git.io/ToD3Gg
08:41 GitHub177 [mojo/master] describe around_dispatch hook with more details - Sebastian Riedel
08:41 GitHub177 left #mojo
08:43 d4rkie joined #mojo
09:01 marty joined #mojo
09:07 d4rkie joined #mojo
09:22 buu Can anyone save me a bit of time and point me towards where the layout parameter for templates/rendering is actually handled? It doesn't seem to be inside of Renderer->render unless I'm missing something obvious, is the individual template engine supposed to handle it?
09:30 marty_ joined #mojo
09:38 BlueT_ joined #mojo
09:43 marty__ joined #mojo
09:53 avkhozov joined #mojo
09:59 sri buu: https://github.com/kraih/mojo/blob/ma​ster/lib/Mojolicious/Renderer.pm#L242
10:07 black joined #mojo
10:12 fibo joined #mojo
10:22 sri hmm, the breaking changes i have planned for 3.0 start piling up :o
10:22 marcus Maybe we should have a 3.0 branch?
10:23 sri no
10:23 sri 2.x would be the branch
10:23 marcus http://bit.ly/HRKqg7
10:23 marcus I mean so you can do maint 2.0 while preparing for 3.0
10:23 sri i wouldn't mind splitting devel and stable for a bit, but 2.x would need another maintainer than me
10:23 marcus Master is a branch too :)
10:24 marcus Wonder if apache couchdb is any good.
10:25 sri same problem as couchbase
10:25 sri you have to plan all your queries in advance
10:26 sri re stable branch, i'm up for that if one of the core devs wants to take it over so i can concentrate on 3.0 :)
10:48 sri until we have a volunteer i'll keep my plans on a post-it ;p
10:51 sri so far it's 1) rename Mojo::CookieJar to Mojo::UserAgent::CookieJar 2) remove Mojolicious::Plugin::I18N from core 3) get rid of relaxed placeholders 4) rethink format handling in routes 5) change format of Mojolicious::Types->types to allow MIME type aliases
10:52 BlueT_ joined #mojo
10:53 sri 6) maybe remove Mojolicious::Plugin::Charset too
10:53 dwierenga joined #mojo
10:54 sri 4 is also a maybe
10:54 purl okay, sri.
10:55 * sri slaps purl
10:55 purl o/` Hit me baby, one more time o/`
10:55 sri i expected format handling to be more of a problem, but it works rather well with respond_to
11:13 Dani joined #mojo
11:42 sri all minor changes, but breaking
11:43 sri i don't really expect bigger changes before http 2.0
13:38 kanishka joined #mojo
14:11 asarch joined #mojo
14:41 avkhozov joined #mojo
15:47 Psyche^ joined #mojo
16:36 zivester joined #mojo
17:15 Leandr joined #mojo
17:43 xaka joined #mojo
17:58 avkhozov joined #mojo
18:22 xaka joined #mojo
18:51 abra joined #mojo
19:15 tempire oooh
19:15 tempire that's why my cpan uploads for mojolicious have been failing
19:15 tempire I don't have permissions on the new modules
19:15 tempire ::Reactor::* and ::Routes::Route
20:14 hide I've created the following tests - https://github.com/ssoriche/mojo/blob/TagHe​lpers_Tests/t/mojolicious/tag_helper_app.t and made these modifications - https://github.com/ssoriche/mojo/blob/TagHelpe​rs_Tests/t/mojolicious/lib/MojoliciousTest.pm and am getting these results - https://gist.github.com/2331791
20:14 hide I can't tell whether it's a configuration error on my part, or real issues
20:41 abra joined #mojo
20:42 sri tempire: should be fixed
20:54 marcus Sri: I think the I18n plugin is widely used.
20:54 sri i don't think so
20:54 sri until recently it didn't even have examples
20:54 marcus At least two of my clients are usinf it.
20:54 marcus Using.
20:55 sri well, it can be maintained in a separate distribution
20:55 marcus (yes, ipad in bed)
20:55 sri i would just like to refocus core plugins to essentials
20:56 marcus Mmmkay. I like the rethinking formats bit.
20:56 sri i'm looking forward to your suggestions there
20:57 sri especially about problems like multiple formats for respond_to
21:00 marcus I'm thinking formats should be more restrictive by default.
21:00 marcus More explicit.
21:04 marcus Memowe: did you test bootylite with a lot of articles?
21:06 marcus Looking at _build_articles, I am thinking it would slow down quickly.
21:12 black joined #mojo
21:12 sri sooo, you would be ok with making it "/foo/bar.:format"?
21:13 sri but how could the format ever be optional?
21:26 marcus Something like that, but .:format is a bit ugly.
21:26 sri alternative?
21:26 marcus Not sure, am thinking
21:27 marcus ('/foo',formats=>[qw/html js rss/]) ?
21:29 sri that's how it works now
21:29 sri you want it to still be a special case?
21:30 sri how would "allow all formats, but require one" look like?
21:31 marcus I'd say format processing should be off by default, and that specifying formats or whatever makes it mandatory.
21:31 marcus This is just my gut reaction tho, might be silly.
21:31 sri hmm, my main motivation was to remove the special case status
21:32 Leandr joined #mojo
21:33 marcus How were you planning to do it? Add more routing syntax as above?
21:33 sri yes
21:34 marcus Magic :format might work. Would even allow stuff like /:format/echo
21:35 sri alternatives like you used are already part of restrictive routes
21:35 sri could look like route("/foo/bar.:format", format => [qw/json xml html/])
21:36 sri that would only remove the magic and make a :format placeholder mandatory
21:36 sri like every other placeholder
21:36 marcus Yepp.
21:36 marcus Maybe so. Will sleep on it.
21:36 sri problem is still the case where you want format to be optional
21:36 marcus Hmm, the dropbox api is pretty poor :-/
21:37 sri since the "." is mandatory
21:37 marcus Oauth1 and no streaming endpoint for delta.
21:37 sri even if you make :format optional with a default it's still "/foo/bar."
21:37 marcus Maybe a special .format that includes the dor? :)
21:37 marcus Dot
21:37 sri -.-
21:38 sri solution could be quoting changes
21:38 marcus I don't see that backfiring :D
21:38 sri "/foo/bar(.:format)"
21:38 sri () for optional
21:38 marcus I still think .: looks a bit ugly.
21:39 marcus Too much punctuation.
21:39 sri "." is just a dot
21:39 marcus I know.
21:41 tempire "." is more of a face
21:41 sri ^_^
21:42 marcus Surprised woman.
21:47 black joined #mojo
21:59 sri the big problem that needs to be solved is making "/foo/bar" default to "html" while allowing "/foo/bar.html" and "/foo/bar.json"
22:00 sri and at the same time have a way to allow only "/foo/bar.html" for another route
22:00 sri (in another app)
22:06 stephan48 is there a way to make an udp server in mojo?
22:15 marcus sri: ever considered making the template system non-strict?
22:16 sri marcus: not by default no
22:16 marcus sri: not sure if sane, but it's annoying that the template rendering dies if one of the stash values are missing.
22:17 sri it would seem weird to make "use Mojolicious::Lite" activate strict and not do it for templates
22:17 marcus Tt is in practice non-strict.
22:17 sri well, "% no strict;"
22:18 marcus Guess I can just start sticking that in the wrapper.
22:18 sri that will only work for the wrapper
22:19 sri well, i'm not dead set on forcing strict, but i think there should be a discussion about it first
22:20 marcus Agree
22:20 marcus Tempire/crab: am I nuts for suggesting less strict?
22:21 inokenty Maybe use an option.. Something like 'die_on_bad_params => 0' in HTML::Template?
22:22 sri i'm opposed to that
22:22 sri too many new special cases that need testing
22:22 inokenty Okay
22:23 marcus I hate that idea too ;)
22:23 marcus Want good defaults, not more options.
22:28 sri it actually doesn't work
22:29 sri perl -Mojo -E'a("/" => {inline => qq/<% no strict; %><%= $foo %>/})->start' get / '#showcase > pre' text
22:47 mire_ joined #mojo
23:13 athenot joined #mojo
23:18 GitHub169 joined #mojo
23:18 GitHub169 [mojo] kraih pushed 1 new commit to master: http://git.io/QCUvQw
23:18 GitHub169 [mojo/master] better plugin documentation - Sebastian Riedel
23:18 GitHub169 left #mojo
23:27 tempire marcus: yes, I think you're crazy :)
23:28 tempire that's what <%= stash 'name' %> is for
23:30 GitHub109 joined #mojo
23:30 GitHub109 [mojo] kraih pushed 1 new commit to master: http://git.io/LU3sJw
23:30 GitHub109 [mojo/master] better Mojolicious::Plugin::Config tests - Sebastian Riedel
23:30 GitHub109 left #mojo
23:36 sri perl -Mojo -E'a("/" => {inline => qq/<%= stash "foo" %>/})->start' get / '#showcase > pre' text
23:36 sri confirmed, works
23:37 sri the forced scalar context will make non existing variables pretty much impossible
23:41 sri tempire: what are your thoughts on the other changes i proposed?
23:42 sri i suppose nobody minds the CookieJar renaming, but removal of plugins should result in some discussions
23:43 sri i'm a little torn on it
23:46 sri the I18N plugin is not essential, but also very well tested and no maintenance burden
23:47 tempire what core plugins besides I18n are you proposing be separated?
23:47 sri i wouldn't dare touch the config ones
23:47 sri maybe Charset
23:48 tempire Doesn't seem like there's any real benefit to remove them
23:49 sri well, it could encourage better I18N plugins
23:51 tempire I feel like if someone needs it, they're going to do it anyway.
23:51 tempire it, being a better plugin
23:54 GitHub132 joined #mojo
23:54 GitHub132 [mojo] kraih pushed 1 new commit to master: http://git.io/F6gdOw
23:54 GitHub132 [mojo/master] mention that all bundled plugins are examples - Sebastian Riedel
23:54 GitHub132 left #mojo
23:54 sri maybe that's enough of an incentive
23:56 alnewkirk yoyoyo
23:56 sri suppose plugins will all stay then
23:57 alnewkirk all hail the hypnotoad
23:57 sri the Mojolicious::Types->types change is also a no-brainer
23:57 sri purl: hypnotoad
23:57 purl ALL GLORY TO THE HYPNOTOAD!!!
23:58 sri so it's just routes cleaning still up for discussion
23:58 * sri has a feeling that will be a very tricky topic
23:58 tempire oh, I just saw your comment on changes

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