Camelia, the Perl 6 bug

IRC log for #mojo, 2013-06-30

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

All times shown according to UTC.

Time Nick Message
01:10 libsysguy joined #mojo
01:57 Meiermann joined #mojo
02:07 tempire Tiger: fyi, higher quality with questions http://mojocasts.com/yapc
02:26 TheP0St3r joined #mojo
02:26 TheP0St3r Want to take someone offline Friends, Game Servers, Website? Join iStresser ! iStresser.net
02:26 TheP0St3r left #mojo
02:32 TheP0St3r joined #mojo
02:32 TheP0St3r Want to take someone offline Friends, Game Servers, Website? Join iStresser ! iStresser.net
02:32 TheP0St3r left #mojo
02:47 sri :O
02:51 sri how odd, that domain has useful whois information... lets order him some pizza
02:56 sri looks like fake data though
03:48 arthas joined #mojo
03:52 preflex_ joined #mojo
04:24 dsog joined #mojo
04:28 Psyche^ joined #mojo
04:59 jamesw joined #mojo
05:44 denisboyun_ joined #mojo
05:49 mire joined #mojo
05:57 Meiermann joined #mojo
06:13 d4rkie joined #mojo
06:28 Britzel joined #mojo
06:44 basiliscos joined #mojo
06:48 Vandal joined #mojo
07:02 dotan joined #mojo
07:20 marcus_ hmm, docker is rather neat
07:31 denisboyun joined #mojo
07:36 marcus_ sri: Thinking he weas one of the TMNT?
07:37 marcus_ 1 Big Anchovies pizza to be delivered to the NYC sewer system!
07:53 dod joined #mojo
07:57 suy joined #mojo
08:07 dod joined #mojo
08:24 jzawodn joined #mojo
08:34 jmmills joined #mojo
09:16 rem_lex|pivo joined #mojo
09:20 amirite_ joined #mojo
09:29 denisboyun joined #mojo
09:38 d4rkie joined #mojo
09:40 denisboyun_ joined #mojo
09:40 basiliscos joined #mojo
09:49 sri marcus: now we'll never know
09:59 marcus_ I'm going to make mojo/redis run under docker
10:05 berov joined #mojo
10:07 berov Hi, I need advise on using the event loop for long running tasks here is my question:
10:07 berov http://stackoverflow.com/questions/17389​197/using-mojo-event-loop-for-a-long-run​ning-script-processing-huge-text-files
11:24 tba joined #mojo
11:41 sweet_kid joined #mojo
12:27 ilbot2 joined #mojo
12:27 Topic for #mojo is now 🎩, indubitably | http://mojolicio.us | http://irclog.perlgeek.de/mojo/today
12:53 mire joined #mojo
13:06 asarch joined #mojo
13:07 crab i have an app that uses mojolicious 3.x and will never be upgraded to 4.x. so i want to bundle 3.97 with it somehow.
13:08 crab what's the current best practice to do that? just stick it in lib/?
13:41 bpmedley joined #mojo
13:42 whitebook joined #mojo
13:48 gryphon joined #mojo
13:49 d4rkie joined #mojo
13:52 trone joined #mojo
14:06 bzero joined #mojo
14:20 marcus_ crab: I'd use carton.
14:43 crab even though it comes with HEAVILY ALPHA warnings?
14:45 crab looks promising, thanks.
14:46 btyler joined #mojo
14:47 bpmedley I just changed my app from using Apache / Plack to Hypnotoad.  The pages just appear themselves now.. :)  Much faster.
14:52 punter joined #mojo
14:55 jberger <3 hypnotoad
14:56 jberger Apache was a game changer, but its kinda a bear now
14:56 jberger (then again, I mostly mean about configuration, I don't have too much on performance)
15:09 bpmedley jberger: Understood.  I'm not sure where the bottleneck was with my Apache setup.  I think it was so many layers Apaceh -> Plack -> Perl and then back up the chain.
15:11 bpmedley Here is the app, if you're interested: https://github.com/brianmed/InfoServant-Feeds
15:19 bpmedley Is it kosher to add a Project to the wiki?
15:20 crab sure. it's a wiki.
15:21 crab i used plack with my mojo apps very briefly, but i quickly found that it wasn't adding much that i needed. and then hypnotoad appeared, and it was good.
15:23 crab i do run hypnotoad behind nginx, mostly for caching. if i tried hard enough, i could get rid of it in some cases, but i find it's not worth the bother.
15:24 marcus_ crab: If I use early versions of Sebastian's software, I can handle miyagawa's
15:25 bpmedley I really need to learn nginx, it seems.
15:28 crab marcus: hehe
15:38 crab bpmedley: i find it a bit more straightforward and predictable than apache, that's all. i don't think i have any sites in production where apache would have significant performance problems. i just don't like apache much: design, development, or configuration. but it has more and slightly better documentation.
15:38 bpmedley crab: Does it have better documentation because it's complicated?
15:41 jberger remember that recent nginx reverse-proxies can handle websockets
15:41 crab no. it has better documentation because it's (much) older and more people whose native language is english have paid attention to it.
15:41 jberger I think i heard that apache is coming with websockets too, but I don't believe its there yet
15:41 dod joined #mojo
15:55 Tiger joined #mojo
16:14 bpmedley_ joined #mojo
16:48 sh4 joined #mojo
16:54 abra joined #mojo
17:15 jwang joined #mojo
17:57 basiliscos joined #mojo
18:14 punter Can mojolicious initiate the sending of a websockets message to the client itself, and not as a response to a websocket message that the client sent first?
18:14 punter (I'm a beginner, just curious)
18:17 punter For example I want when a user does a normal HTTP request, I want an array of websocket clients that are connected to receive a message
18:17 punter Is that possible?
18:20 punter E.g. a chatroom, would a chatroom be possible?
18:22 punter Someone? Anyone?
18:24 sri jberger: the problem with apache is that most setups can only handle one connection per worker at a time
18:24 sri so odds are apache will always suck for websockets
18:25 jberger sri: figured
18:26 jberger punter, iirc the client must open the connection to the server, from there you can do any two-way communication you want
18:26 punter ok
18:27 jberger remember the browser isn't listening for inbound connections
18:29 punter Question: I want to surround all of my web requests with a $dbh->do("BEGIN") in the beginning, and a $dbh->do("COMMIT") or "ROLLBACK" at the end depending on whether an error occurred in the route. Has anyone done this before, without writing these commands in a try-catch inside every single route handler?
18:30 punter I'm thinking that it would be easy to do, if there were a hook to handle web requests in which an error occurred
18:30 punter But I don't think Mojolicious has something like that
18:30 punter So: could you make one please? Or: is there another way to do it?
18:32 punter Another way it could be done, would be to check whether an error occurred or not in the after_dispatch hook. But is there a way to tell whether an error occurred or not?
18:33 bpmedley Was that the around_action thing?  https://gist.github.com/brianmed/5795931
18:38 punter ah, excellent!
18:38 punter sort of
18:39 punter what's the difference between around_action and around_dispatch?
18:40 punter I think that does what I want
19:00 sri oh, i suppose running additional methods for every action is another use case for around_action... like MyApp::Controller->before_action and MyApp::Controller->after_action for MyApp::Controller->some_action
19:03 sri a little more catalyst
19:10 jberger wow, its 4.17 already?? time (and version numbers) sure flies
19:17 BeDa joined #mojo
19:19 russum joined #mojo
19:19 russum left #mojo
19:26 punter Can Mojolicious read JSON bodies of POST requests? Because that's how REST is done nowdays I think
19:27 punter I.e. instead of name=Alex&surname=Smith, the POST body is usually { "name":"Alex","surname":"Smith" }
19:27 punter but I don't see that in the docs, so I'm wondering
19:33 bpmedley punter: $self->req and http://mojolicio.us/perldoc/Mojo/Message/Request
19:36 punter So I'd have to read the body and run it through a JSON parser myself. Maybe by making a plugin or hook for this, right?
19:36 bpmedley punter: There may be a better way.  I'm stil learning.
19:37 sri http://mojolicio.us/perldoc​/Mojolicious/Controller#req
19:38 sri don't ignore the base classes, read the whole thing
19:38 punter Another question: Are the core developers quick to decide whether to merge pull requests?
19:38 punter ok
19:39 sri depends on the pull request, i'm usually pretty quick rejecting them ;p
19:39 punter I was at Dancer, where the core developers had very little spare time and merged pr's every 3 weeks
19:39 punter ok
19:39 punter good
19:39 punter do you usually give a short explanation for the rejection as well?
19:39 sri we prefer to discuss changes here first though
19:40 punter a
19:40 punter ok
19:40 sri look through the history of rejected pull requests
19:40 punter Yes. I saw there are 0 open bugs in guthub. I guess that means you close them too without looking, right? :-)
19:40 punter just kidding, sorry
19:42 jberger one of my favorite things about mojolicious development is its pace, that said, you often want to have a very well thought out idea when you propose it, especially its uses beyond your own needs
19:43 jberger then again, thats what this channel can help with, discussion of a partially formed idea before officially submitting a pr
19:44 sri yea, i'm very picky, you only really want to send a pull request for things that are very well thought through, otherwise it's better to discuss it here http://mojolicio.us/perldoc/Mo​jolicious/Guides/Contributing
19:44 jberger I don't think I have seen an idea sit on the vine for 3 weeks ever here actually
19:45 jberger I don't think 4.0 planning took three weeks did it?
19:45 sri 3 weeks is a long long time
19:45 sri it's like 2-3 releases for us usually ;p
19:46 punter Good. I'll use it then.
19:46 punter You may rejoice now.
19:47 sri we've actually been much less active than usual during the last few weeks, it's summer and all
19:48 sri much more going on during winter
19:48 punter Are you kraih?
19:49 sri yes
19:50 punter Why don't you like domain-specific languages? It's the one thing I liked about Dancer
19:50 punter I can survive without it too, tho
19:51 sri it's not that i don't like them, they often just don't work well
19:53 sri mojolicious was designed with event loops and non-blocking apis in mind, keyword DSLs suck for that
19:54 sri https://gist.github.com/kraih/4351674 # you can have a keyword DSL in mojolicious too
19:55 sri problem is, they require global state (the controller object), which is not available for anything async, mojolicious apps are designed for thousands of concurrent requests being active at any given time
19:58 sri it's all about the continuation passing style usually being used for async apis, it doesn't mix with keyword DSLs
19:59 berov joined #mojo
20:00 punter I'm not exactly sure where async-anything comes in to a web framework, but I'm sure I'll find out soon.
20:00 punter Twiggy is Async
20:00 punter sorry, I'm mixed up. I'll go read the docs.
20:01 sri http://mojolicio.us/perldoc/Mojolic​ious/Guides/Cookbook#REAL-TIME_WEB
20:01 sri it's why we call mojolicious a real-time web framework, it was designed for that stuff
20:03 sri whenever you see a closure there used for continuation passing, a keyword DSL would explode due to lack of global state
20:03 punter a
20:03 punter ok
20:06 sri personally, i think keyword DSLs also don't scale well, once your app grows past a single file things get ugly pretty fast
20:07 sri and just because we go object oriented for most things, doesn't mean we don't have DSLs http://mojolicio.us/perldoc/​Mojolicious/Routes#SYNOPSIS
20:07 sri chained methods are a form of DSL too
20:09 sri http://mojolicio.us/perldoc/Mojolicious​/Guides/Routing#More_convenient_routes
20:11 punter Managed to read JSON from the body. Thx
20:11 punter However it's strange that json('/') didn't return the entire JSON object I gave it, but an empty string
20:11 punter or undef
20:12 punter I had to pass a JSON property to get something back
20:12 sri haha, you better read up on json pointers
20:12 punter ok
20:13 sri because / is equivalent to $json->{''}
20:14 punter a
20:14 punter yes
20:14 punter json('') works better!
20:14 human39_ joined #mojo
20:16 good_news_everyone joined #mojo
20:16 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/bc2xNA
20:16 good_news_everyone mojo/master 1755e65 Sebastian Riedel: a few more controller examples
20:16 good_news_everyone left #mojo
20:37 punter I read somewhere that Mojolicious supports comet as a fallback if websockets are not available. But the examples don't show that
20:37 punter Am I wrong
20:37 punter ?
20:39 punter I guess the browser would use some JS library to enable such behaviour. But the examples don't use any libs
20:45 Averna joined #mojo
21:02 trone joined #mojo
21:04 sri we support websockets and comet, but no automatic fallbacks, you have to build that yourself
21:15 trone joined #mojo
21:15 denisboyun_ joined #mojo
21:21 denisboyun_ joined #mojo
21:31 denisboyun joined #mojo
21:31 lukep joined #mojo
21:38 perlite_ joined #mojo
21:42 denisboyun_ joined #mojo
21:52 someone joined #mojo
22:19 punter Where's the access.log? Do I need to download the AccessLog plugin which is only v0.04?
22:19 punter 0.004
22:19 bpmedley punter: AccessLog plugin seems to work well
22:20 punter ok!

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