Camelia, the Perl 6 bug

IRC log for #mojo, 2011-09-14

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

All times shown according to UTC.

Time Nick Message
00:43 grim_fandango joined #mojo
01:35 elb0w_ joined #mojo
01:41 perlrocks Twitter: "I just loaded some projects into http://t.co/b55i212 : dancer, mojolicious, seaside, gearman.  Hi @joshu !" --spazm http://twitter.com/spazm/status/113789387107610624
01:44 metaperl joined #mojo
01:54 perlrocks Twitter: "In the forums: Videotutoriales of Mojolicious (English) perl http://t.co/gZAdO1o" (es) --perlenespanol http://twitter.com/perlenespa​nol/status/113792780253409281
01:56 Coke joined #mojo
01:56 rwstauner joined #mojo
02:02 noganex joined #mojo
02:03 marty joined #mojo
02:11 Coke joined #mojo
02:19 Alias_ joined #mojo
02:26 Coke joined #mojo
03:15 Coke joined #mojo
03:24 Eugene joined #mojo
03:38 al joined #mojo
05:12 * sri yawns
05:12 GitHub170 joined #mojo
05:12 GitHub170 [mojo] kraih pushed 1 new commit to master: http://git.io/JUCJfw
05:12 GitHub170 [mojo/master] improved DATA templates by removing a whitespace requirement - Sebastian Riedel
05:12 GitHub170 left #mojo
05:20 perlrocks Twitter: "Mojolicious VS Dancer http://t.co/alSJvFA Battle Continues! # Perl # mojolicious # dancer # framework" (ru) --xomaa http://twitter.com/xomaa/status/113844464270848001
05:31 GitHub96 joined #mojo
05:31 GitHub96 [mojo] kraih pushed 1 new commit to master: http://git.io/GipBdg
05:31 GitHub96 [mojo/master] better test cases - Sebastian Riedel
05:31 GitHub96 left #mojo
05:55 intervoice joined #mojo
06:05 Foxcool joined #mojo
06:08 Firkin joined #mojo
06:08 sromanov joined #mojo
06:12 driller_work joined #mojo
06:13 * driller_work has decided to start using mojolicious!
06:13 driller_work let's see how this baby does as a rest service ;-)
06:16 sri if you're serious about rest make sure to take a look at respond_to
06:17 driller_work thanks, I'll surely take a look at that
06:17 driller_work trying to get an edge here with the docs but seems like they are super-light; the video-tuts gave me a hush about a thing or two though :)
06:19 sri there are many words i would use to describe the documentation, but super-light is not one of them
06:19 sri they are very very dense ;)
06:19 driller_work :-)
06:23 driller_work bah, database designing sucks...... :|
06:24 AmeliePoulain joined #mojo
06:29 tempire indeed, mojo docs are fairly extensive.  not perfect, but solid.
06:29 sri perfection is impossible
06:30 tempire bah.  you haven't had cream cheese brownies, clearly.
06:30 driller_work don't get me wrong, the documentation is great although the subject that interests me does not have a clear example of how to act upon various events :P
06:30 baton8 joined #mojo
06:31 driller_work BUT I won't be judging mojo just yet, first I have to give it a proper go! ;-)
06:31 sri mmmmmm… *drools*
06:32 sri i don't think you can get those on this continent though :/
06:33 tempire I'll bring some for yapc::eu 2012
06:35 koban joined #mojo
06:42 marcus \o/
06:42 marcus frunkfurt, baby
06:47 tempire http://itunes.apple.com/us/podcast​/mojolicious-mojocasts/id464926730
06:47 tempire ratings call
06:47 tempire and/or reviews
06:53 sri think i left a rating
06:59 spleenjack joined #mojo
06:59 intervoice could you please look at with this question? https://groups.google.com/d/topic/​mojolicious/4cKB0hdbnoY/discussion
07:02 sri intervoice: http://irclog.perlgeek.de/​mojo/2011-09-13#i_4421729
07:11 metaperl Does this startup sub apply to Lite as well - https://metacpan.org/module/Mojol​icious::Guides::Rendering#Layouts
07:19 sri lite apps *are* the startup sub
07:19 sri you should really read the growing guide
07:21 jmmills anyone got any links on how how to handle authentication in mojo?
07:21 jmmills i.e. from scratch and picking up basic auth from server
07:27 tempire jmmills: http://search.cpan.org/dist/M​ojolicious-Plugin-BasicAuth/
07:32 reyjrar joined #mojo
07:33 driller_work ^ is a great start; but if I were you I'd write my own plugin to handle the authentication; that way you can tailor it to suit your needs
07:34 tempire regarding chromatics post http://bit.ly/pQqASB, is there any advantage to having thread support in the perl core, as opposed to depending on Coro?
07:45 Alias_ Is Coro limited to one core?
07:46 Alias_ Anything that has a maximum resource consumption limit of 1 core is worse than threads
07:47 Alias_ Regardless of whether it's easier or harder to use
07:48 Alias_ For example, Padre uses threads quite successfully to allow us to run stuff in the background of the IDE
07:48 tempire you're using the core threads module?
07:49 Alias_ Doing it with IPC would be so much harder (especial compat across all three of Linux/Mac/Windows)
07:49 Alias_ Yup
07:49 Alias_ Extensively
07:49 Alias_ Padre by default spawns up to 9 background worker threads
07:50 Alias_ We did invent some tricks through, to minimise the normal thread pain
07:50 sri yes, Coro is limited to one core
07:50 sri that's what makes it so simple
07:50 Alias_ We sort of emulate erlang style threads using massive interpreter threads :)
07:50 Alias_ There's no shared variables of any kind, just message passing
07:51 Alias_ And we spawn a master thread REALLY early in the bootstrapping
07:51 intervoice sri: What is the problem with my question?? You write in mojolicious docs that it is not good decision to use embeded Exception class. And i know it. I want to have possibility to catch errors in "Mojolicious::Routes::_dispatch_controller" eval block. It will let me to use Exception::Base or any other modules. Is that too complicated question to understand?
07:51 Alias_ And all our background threads spawn off the master thread instead of the main thread
07:51 sri it's not really erlang style with massive threads though ;p
07:51 Alias_ sri: The message passing style is similar
07:51 Alias_ Well, "inspired by"
07:51 Alias_ :)
07:51 sri they were like 1.2k tempire said i think
07:51 sri Coro's are 4k
07:52 sri (kb)
07:52 Alias_ Ours are 4-6meg
07:52 Alias_ On Windows anyway
07:52 Alias_ They seem to be much bigger on Linux
07:52 Alias_ But that assumes I trust the memory reporting
07:52 sri i would be happy with Coro style threads/fibers in perl core
07:53 sri real threads are prolly never going to happen
07:53 Alias_ Define "real"
07:54 sri cheap and without a global interpreter lock
07:54 Alias_ ah
07:54 Alias_ I thought ithreads didn't have an interpreter lock
07:54 intervoice sri: it will be good architecture decision to give at least one callback to wrap "$continue = $app->$method;" call in "Mojolicious::Routes::_dispatch_controller"
07:54 Alias_ Because they had an interpreter in each thread
07:54 sri they aren't cheap though
07:54 Alias_ true
07:55 Alias_ What you mean is like "greenfield" threads right?
07:55 Alias_ I think I've heard Yuval call it that
07:55 tempire googling "greenfield threads" is quite useless.
07:56 Alias_ I'm probably wrong then
07:56 Alias_ For desktop style applications, I'm quite happy with the ithread approach
07:56 Alias_ Although I'd like it if you could ask for a fresh interpreter instead of a forky one
07:56 tempire ah, green threads
07:56 sri recently i've only been following pypy development a bit, they are trying to figure out a way to make it work for python
07:56 tempire yes, using a vm
07:56 purl using a vm is not an option? :)
07:57 sri their latest approack was software transactional memory
08:03 sri Alias_: why do you use threads instead of fork?
08:03 sri if your style is message passing, i don't really see a reason
08:03 Alias_ sri: Because threads and messages work consistently across all three operating systems with the same code
08:04 Alias_ We stuff messages into a Thread::Queue for parent -> worker, and we emit Wx::PlThreadEvent from worker -> parent
08:04 Alias_ That works identically on all of them
08:04 Alias_ No need for sockets or external IPC
08:04 sri i think fork and sockets are more portable
08:04 Alias_ What kind of socket?
08:04 sri inet
08:04 Alias_ You're not allowed to use server sockets on Debian
08:05 Alias_ They refuse to package apps that do
08:05 Alias_ They already disable one of the features of Padre that needs it
08:05 sri that does not sound right
08:05 Alias_ You are only allowed to use unix sockets
08:05 sri mojolicious is on debian
08:06 Alias_ You are a server application
08:06 Alias_ We are not
08:06 Alias_ You can't use inet sockets for internal ipc
08:07 sri that sucks
08:07 purl The rock is now off.
08:07 Alias_ Also, PlThreadEvents integrate nicely and natively into the Wx runloop
08:07 sri maybe you should just ship a tiny http server? :)
08:07 Properler joined #mojo
08:07 Alias_ If we weren't using Wx we might not use threads
08:08 Alias_ The Wx-integrated worker -> parent messages are just so clean though
08:08 Alias_ We have enough issues with operating system variation, it's nice to not have to worry about background processing
08:09 tempire hmm
08:09 Alias_ I would by no means recommend our approach to everyone
08:09 tempire software transactional memory is interesting
08:09 Alias_ Just people doing Wx desktop applications that want background processing
08:10 Alias_ Took us three attempts to really get it humming though
08:10 Alias_ Padre::Task 3.0 is pretty solid now
08:10 Alias_ We're slowly pushing more and more work into the background
08:11 Alias_ Which you have to for desktop apps, if you want to stay responsive
08:11 Alias_ Especially so anything which touches the filesystem and might block
08:15 tempire and it looks like python already has a working implementation of stm
08:18 tempire Alias_: I take it perl threads.pm isn't limited to one core...
08:23 sri Coro = 1 core + 4kb per thread, ithreads = multiple cores + 6mb per thread
08:32 noganex joined #mojo
08:40 Eugene joined #mojo
08:50 intervoice sri, I've just sent question regarding mojolicious Exception architecrute problem  to your email on cpan.
08:50 driller_work read it, read it!!
08:50 intervoice ?
08:51 metaperl sri - I did read the Growing guide before asking again about how that startup() code applied to a Lite app. I've prepared patch for the Overview of the Growing guide ( https://gist.github.com/1216130 ) which I think will make the implicit relation more explicit.
08:53 metaperl And about your earlier comment that a lite app is the startup sub, I've looked at the source and think it's more accurate to say that Mojolicious::Lite::import is roughly equivalent to Mojolicious::startup ... I dont know why I was the only one so confused about the relation, but I think this addition to the overview would've helped me.
09:00 cstamas joined #mojo
09:18 cosmincx joined #mojo
09:27 Coke joined #mojo
10:02 marcus moo
10:22 intervoice no "moo" here. This community do not help with serious questions. All that you will hear will be something like: "Read documentation". If you already done, - read it twice. I am disapointed.
10:26 marcus intervoice: I AM DISAPOINT TOO
10:27 marcus intervoice: I think the main problem is nobody can understand what you actually are trying to accomplish.
10:28 marcus metaperl: saying that the lite app script is equivalent to the startup sub sounds more correct to me.
10:29 marcus intervoice: I understand you want to do something with exceptions, but why? What's your goal?
10:31 metaperl marcus:  ok, I'll accept that. Which OVERVIEW do you like best. The current one ( http://mojolicio.us/perldoc/Mojo​licious/Guides/Growing#OVERVIEW ) or my suggested one ( https://gist.github.com/1216130 )
10:32 metaperl marcus: although I suppose we could get super-picky and say the Lite app script is equal to a templates dir, a startup sub, a default controller and a small starter script
10:33 marcus metaperl: yours has more information, but it seems a bit dense
10:33 metaperl looking at Mojolicious::Lite::import() is what finally allowed me to make the connection between a Lite app and a Mojolicious app
10:34 metaperl marcus: I see. well it would've helped me out because it makes the growing process explicit
10:34 metaperl and shows how the lite script breaks out into various pieces
10:34 metaperl but reading the source in conjunction with the curent docs would've been the way to solve this myself
10:34 marcus metaperl: don't you feel that this is covered from http://mojolicio.us/perldoc/Mojolicious/Gu​ides/Growing#Simplified_Application_Class and down?
10:35 metaperl I personally think the current OVERVIEW isnt an overview at all... it's a single line synopsis
10:36 marcus metaperl: well, I would want to break your block up into two separate paragraphs at least
10:36 metaperl re - Simplified Applicaotin Class we read: """We will start by extracting all actions from myapp.pl and turn them into simplified hybrid routes in the Mojolicious::Routes router, none of the actual action code needs to be changed.""" - but some reading between the lines (and/or reading the source code) is necessary without my patched overview
10:36 metaperl marcus:  breaking it into blocks is fine. but I wouldnt say it's too dense
10:37 metaperl it gives an overview of the growing process. with explicit statements about how the Lite app breaks apart into Mojolicious pieces
10:37 metaperl but enough - I'll just add it to FAQ FOR THE IMPATIENT
10:37 marcus metaperl: well, I suggest improving it a bit to be less like a big block, and then sending sri a pull request
10:37 marcus in the end he decides what goes into the docs anyways
10:37 metaperl yeah i'd rather discuss it a bit here before putting work into a pull request
10:46 metaperl I have to drop internet connecton for a bit...
10:47 metaperl left #mojo
10:47 marcus party time!
10:47 purl Excellent!
11:29 intervoice marcus: I want to have possibility to catch errors in "Mojolicious::Routes::_dispatch_controller" eval block. It will let me to use Exception::Base or any other modules
11:34 intervoice marcus: Here is the example of what my way to do it. It's a hack, but there is now way to do it other way. http://pastie.org/2531300
11:37 intervoice marcus: dispatch function is a hack. I changed the "Mojolicious::Routes::_dispatch_controller" to have possibility to wrap the "$app->$method" with $app->dispatch($method). It allows me to catch any errors in controller execution before they will be cantched by mojolicious internals.
11:39 DaniBunny joined #mojo
11:39 intervoice marcus: Here is the "dispatch" method example http://pastie.org/2531317
11:45 intervoice marcus: Excuse me. The hash is here http://pastie.org/2531317 and the dispatch method is here http://pastie.org/2531300
11:50 intervoice marcus: I want "sri" to write callback or any other architecturally correct mechanism to give to developers ability to catch errors that occures in the "Mojolicious::Routes::_dispatch_controller" to prevent others to use hacks like this one: http://pastie.org/2531361 at the 415 .. 219 lines of "Mojolicious::Routes" module
11:52 intervoice marcus: Excuse me. The HACK is here http://pastie.org/2531317 and the dispatch method is here http://pastie.org/2531300
11:52 intervoice marcus: I want "sri" to write callback or any other architecturally correct mechanism to give to developers ability to catch errors that occures in the "Mojolicious::Routes::_dispatch_controller" to prevent others to use hacks like this one: http://pastie.org/2531361 at the 415 .. 419 lines of "Mojolicious::Routes" module
12:01 intervoice marcus, sri: Here is the fully described question: http://pastie.org/2531411
12:11 yko joined #mojo
12:20 noganex i wish the mojocasts had subtitles
12:20 * noganex sighs
12:21 osprey joined #mojo
12:22 osprey Hi
12:22 purl salut, osprey.
12:23 osprey Does anyone try mojo on cygwin? I have success with activeperl, but I can't use it anymore. So, Cygwin.
12:24 osprey First, I have bad test when installing from cpan
12:25 osprey http://pastebin.com/D5AYaMNf
12:25 osprey I was force install, and I have error
12:25 osprey $ ./script/my_mojolicious_app daemon
12:25 osprey Can't create listen socket: Address already in use at /usr/lib/perl5/site_perl/5.10/Mojo/IOLoop.pm line 230
12:26 DaniBunny i've had no problems with strawberry perl on windows so far...
12:27 intervoice osprey: may be it's easier to use strawberry perl?
12:27 osprey DaniBunny: reson why i can't use active perl is I need open3 to work proper
12:27 DaniBunny i've always had trouble with cygwin... thats why i don't use it anymore
12:27 DaniBunny hummm
12:28 osprey I also need many tools from cygwin, but its not problem to have other perl
12:28 osprey ok, I test strawberry first
12:30 marcus intervoice: ok, so you don't actually have a problem using the existing functionality, you want Mojo to change to allow it to work more easily with other Exception classes.
12:30 intervoice osprey: select only works on sockets in Windows. It looks like IPC::OpenX uses normal filehandles, so you won't be able to use select with the handles it creates.
12:31 feldspath joined #mojo
12:33 DaniBunny osprey: this link seems interesting: http://www.perlmonks.org/?node_id=651768
12:33 marcus intervoice: seems unreasonable for you to demand that sri work on whatever is important to you. Why not implement a suggested change with tests and send a pull request?
12:34 intervoice Oh my god
12:34 intervoice marcus: it's not important only to me
12:34 intervoice marcus: it's important to all community
12:34 marcus intervoice: it's not important to me
12:35 marcus I don't use an exception class
12:35 intervoice marcus: it's problem in mojolicious architecture.
12:35 Sjors intervoice: if it were this important to many people in the community, someone would have probably stepped up and fixed it already
12:35 osprey DaniBunny: that is why I came to cygwin
12:35 Sjors intervoice: but you're probably free to make the change that you propose, if you can also write tests that fail before the change, and succeed afterwards
12:36 Sjors intervoice: that's how applications or libraries like Mojo develop
12:36 Sjors intervoice: you know what you want changed, so why not send in a patch? :)
12:36 intervoice Sjors: )))))))) ofcourse i can't write tests because of I am real idiot, don't I ??? ))))
12:37 basalte Hi ! I'm a new (impressed and convinced) mojolicious user
12:37 Sjors intervoice: I'm not sure what you're saying, but I hope you didn't pick up what I said as questioning your intelligence...?
12:38 intervoice Sjors: Before sending any patch I want to discuss it with sri. But i think that he is not interested in it.
12:39 Sjors intervoice: well, normally, to get lead developers interested in your patch, you need to tell them about a valid use case
12:39 marcus intervoice: you seem very hostile :-/
12:39 * marcus is off to the beach, later peeps.
12:39 intervoice but I hope you didn't pick... yes I picked. Excuse me. I am very tired to try to find anyone who will discuss this architecture problem with me.
12:39 Sjors intervoice: something like "I'm trying to log any exceptions that occured, and don't want to hack it into an exception template"
12:40 Sjors intervoice: in this case, because mojo uses test-based development, so sri will demand you also write some tests that show that the change works as you wanted in your use case
12:40 Sjors intervoice: that explanation, added tests, and patch for the actual issue, will make the chance of merging a patch very high
12:40 intervoice marcus: yes, I was. Excuse me. )
12:41 intervoice Sjors: here is explanation: http://pastie.org/2531573
12:44 Sjors intervoice: ah, so you want to be able to throw exceptions from your controller, and catch them elsewhere?
12:44 Sjors intervoice: how does this differ from $self->render_exception("OH NO!", 501) ?
12:45 intervoice Sjors: I am lead developer to, but not in mojolicious project. We are using mojolicious in high-load project with more than 8 million uniq users per day. And I does not have to much time to write patches that will be declined or ignored by sri.
12:45 Sjors intervoice: with render_exception, you can define your own exception template, if the layout of the exception page is what this is about
12:46 Sjors intervoice: I understand, but the way you're describing your change at the moment, is not very convincing to me
12:46 Sjors intervoice: don't misunderstand me: I think the change you're proposing is worth its value
12:46 Sjors intervoice: but the explanation is not convincing yet
12:46 Sjors (heh, "worth its value", I meant it's actually worth merging)
12:46 Sjors intervoice: (disclaimer, I'm not involved in the project either)
12:47 intervoice Sjors: I am not interested in just changing error rendering
12:48 intervoice The problem is that we have no instrument in mojo to catch exception in controller before it catches by Mojo::Exception
12:49 Sjors intervoice: exception as in $self->render_exception("noes") or as in die("noes") ?
12:49 intervoice Sjors: in documents sri writes that it is not a good way to use Mojo::Exception in production. Yes. It's obvious. But he did not give us any other chance
12:51 Sjors intervoice: so for example, a use case: you want to be able to register an exception handler, so you can send your development team an e-mail whenever a controller triggers an exception, either by $self->render_exception() or by calling die() ?
12:51 intervoice Sjors: Exceptions in $continue = $app->$method in Mojolicious::Routes::_dispatch_controller in 415 .. 419 lines
12:52 intervoice Sjors: here is explanation: http://pastie.org/2531573 - here is the detailed explanation of what i actually want to
12:52 Sjors yes, I have that paste open
12:52 Sjors but it contains code from inside Mojolicious, that says nothing to me without context
12:53 Sjors I don't know what the difference is between $app->dispatch($method) and $app->$method, apart from that I can extrapolate that you might want to be able to override sub dispatch in order to add the exception handling that you want to do
12:53 intervoice Here is the context: http://www.copypastecode.com/78352/ http://www.copypastecode.com/78344/
12:54 Sjors intervoice: I still haven't heard your explicit use case
12:55 Sjors intervoice: I won't be able to understand your patch, until I understand what _exact_ problem it is supposed to fix
12:55 intervoice Sjors: i do not want to override "dispatch" method. I wrote it by myself. I override Mojolicious::Router::_dispatch_controller method to able to wrap $app->$method call with my "dispatch" method
12:56 Sjors intervoice: so your proposal is to add a common dispatcher method that evaluates every controller call safely, in order to have better exception handling?
12:57 Sjors intervoice: something like that must already be in place somewhere, because calling die("foo") from inside a controller handler doesn't kill the application, but renders a Mojo::Exception
12:57 intervoice Sjors: "dispatch" wrapper are responsible for catching any controller error before they cated by Mojo::Exception
12:57 intervoice Sjors: yes
12:58 dekimsey joined #mojo
12:58 intervoice Sjors: Yes, it doesn't kill app because the $app->$method executes in EVAL block
12:58 intervoice in Mojolicious::Router::_dispatch_controller method
12:58 intervoice Sjors :you can find it here http://pastie.org/2531317
12:59 Sjors intervoice: so why do you need another dispatch method? it is essentially slower, so you'll need a good reason
12:59 osprey http://pastebin.com/W9k24qGE
12:59 osprey -_-
13:00 Sjors osprey: "access is denied" while building? Yay for windows! :P
13:00 osprey :]]]]]
13:00 intervoice Sjors: slower? What are you talking about. + 0.0000000001 second slower is not a problem. The problem is that a have no possibility to control over exception against Mojo::Exception ))
13:00 osprey that is why I WANT CYGWIN T_T
13:01 Sjors intervoice: again: you are constantly describing your fix for a problem you're having, but have never told us about the use case
13:02 Sjors intervoice: if you begin with a use case, then with your proposed fix, people can contribute and give feedback; now, your patch might well improve something but nobody knows if it actually makes sense
13:02 Sjors intervoice: there's a chance that your use case is already covered by something else in Mojo, or that the fix can be much much simpler
13:03 Sjors intervoice: so: what _is_ the actual use case? what exact thing does mojo not allow you to do, at this moment?
13:04 intervoice I have just told you that Mojo does not give me any chance to use my own exception handler
13:04 intervoice Mojo::Exception could not be used in complicated highload projects
13:05 Alias joined #mojo
13:06 intervoice Sjors: is that the use case you want to hear fom me?
13:06 SmokeMachine joined #mojo
13:07 Sjors intervoice: no, it's a problem, but not a use case
13:07 Sjors intervoice: why do you want to use your own exception handler?
13:07 intervoice Riedel know that Mojo::Exception is not appropriate for production but there is no way to use selfmade one or to change it to anything else
13:08 intervoice Because of Mojo::Exception is not appropriate for production.
13:08 cosmincx joined #mojo
13:08 intervoice It gives huge overhead
13:08 intervoice Templates rendering and othe shit
13:08 intervoice its very good for development but not to production
13:09 intervoice just assume that you want to use it like backand to ExtJS4
13:09 Sjors intervoice: I'm sorry to be rude like this, but:
13:09 Sjors intervoice: http://en.wikipedia.org/wiki/Use_case
13:09 Sjors intervoice: read this page, and then tell me what your use case is
13:10 Sjors intervoice: you're not describing use cases, you're describing problems in whatever use case you have in mind
13:10 intervoice ExtJS will not understend all that huge list of HTML data in case of mojo will send the error description to AJAX response
13:10 intervoice fuf
13:11 Sjors I won't understand if it's not written in a way like: "I want to do ...... but Mojo makes this hard or impossible for me because of ....... so I propose to change X to Y, so I can indeed ........."
13:11 intervoice i know what is use case. I am actually using it every day in UML creating
13:12 intervoice is a description of steps or actions between a user (or "actor") and a software system which leads the user towards something useful
13:12 intervoice from wiki
13:13 intervoice so I am an actor and i want to switch overheaded exception mechanism to something lightweight
13:13 intervoice and i want it to be centralized
13:13 intervoice not in every controller
13:14 intervoice But in one place in the application
13:14 metaperl joined #mojo
13:15 rwstauner joined #mojo
13:18 Sjors intervoice: but _whyyyyyy_
13:18 Sjors intervoice: what is it that you need your exception handling to do, that is impossible or infeasible in current Mojo design
13:24 intervoice I want to use fast implementation of the exception class. Mojo::Exception is slow. It barks by HTML data throught HTTP. It is not appropriate for production. Is not is enought???
13:26 intervoice Mojo::Exception can't operate on NAMED exceptions and has no possibility to make decision what action to execute for SomeExceptionThrowedName
13:27 intervoice Mojo::Exception can't propagate exceptions
13:27 intervoice Mojo::Exception has no possibility to ignore some packages for stack trace output
13:28 osprey Hell yeah!
13:28 osprey t/mojolicious/app.t ........................ ok
13:28 purl Woooo!
13:29 osprey seems I here was some conflict with active perl and cygwin when both was installed
13:29 intervoice Sjors: Look at that. It's much more usefull one for production: http://goo.gl/Zxp7J
13:30 Sjors intervoice: I'm going to assume you want your exception handling for sending e-mails when errors occur, as there's no valid use case coming out of you
13:31 Sjors intervoice: so for sending e-mails, you want an exception handling system, now there's Mojo::Exception but it's misisng features and is slow because it generates HTML, ergo you want to be able to throw simple Perl Exception objects, and handle them elsewhere
13:32 Sjors intervoice: is this a good summary of your problem?
13:43 intervoice Sjors: For sending appropriate JSON ouput and HTTP HEADERS to ExtJS, to be able to throw Exception::Base inherited objects, and handle them centralized if no other elswhere catch found, to prpagate exceptions and to ignore some packages for stack trace output.
13:52 Akron joined #mojo
14:00 Akron intervoice: As far as I can see, you can in fact set your own template for every format you want and - afaik - set Headers in there. The only thing that may not be overwritten is the trace generation, right?
14:01 Akron (And why not send mails from within a template ... ?)
14:03 shonorio joined #mojo
14:04 intervoice Arkon: I do not want to use any templates. Assume that i have database error or any other very specific error. So I want to catch it and do ..CODE.. with it and not to throw any exceptions within Mojo::Exception
14:04 intervoice And I don't want to do it right in controller
14:04 Grauwolf Akron, thanks again for your commit
14:05 Akron intervoice: As you can do CODE in templates ...
14:05 intervoice I want to catch those errors centrilized
14:05 Akron Grauwolf: Thanks for your pulling! Hopefully I will be able to contribute more!
14:05 intervoice It's a waste of time to do ay code in templates.
14:05 Grauwolf yeah
14:06 intervoice I want centrilized catching of specific errors
14:06 driller_work you are very demanding sir :P
14:07 intervoice No i am not
14:07 intervoice it's not difficult to create this functionality
14:07 Akron intervoice: I don't see this "It's a waste of time" thing ... I can understand that you do not want the complete trace debugging thing, but why should code in a template be (significant) slower than anywhere else? (Significant in terms of templates have to be compiled first etc.)
14:08 alnewkirk joined #mojo
14:09 intervoice Because of app has to render templates. Rendering is the time waste
14:09 Akron intervoice: However: I can see that it might be a good idea to overwrite Mojo::Exception. The reason, why you did'nt get any response in first place when you posted here and on the mailing list was, that nobody understood the question and nobody was able to see, why you want to do this.
14:09 intervoice I do not need any rendering at all
14:10 intervoice Akron: I understand that. (....However: I can see that it mig....)
14:10 Akron intervoice: So your exception does not take place as a result of a request? I thought you want to return json?
14:11 intervoice Today i gave very detailed description of use case )
14:12 nuba joined #mojo
14:12 Akron intervoice: and you got responses from a lot of persons. The problem with your use case is, that saying "It's too slow for me" is still not a real use case.
14:18 intervoice Assume that you want to throw special NAMED exceptions for few cases: database error, memcached error, RabbitMQ error and others. So it's not good to eval all those exceptions in controller. I want all of them to be catched in one centralized place.
14:20 intervoice "I want to ___[to be able to throw Exception::Base inherited objects, and handle them centralized if no other elswhere catch found, to prpagate exceptions and to ignore some packages for stack trace output]___ but Mojo makes this hard or impossible for me because of _[He have no such functiionality]_
14:22 intervoice so I propose to use Abstract factory (dynamic Exception package loading and initializing), so I can indeed help to create this functional"
14:23 intervoice QUOTE: "Sjors: I won't understand if it's not written in a way like: "I want to do ...... but Mojo makes this hard or impossible for me because of ....... so I propose to change X to Y, so I can indeed .........""
14:28 Akron I see. Although there may be other solutions (like an exception_class attribute in Mojolicious), Try to make a pull request with this use case (maybe in addition to that a concrete example where you want to delegate a database exception or something), your solution and test cases, and maybe sri will be open again for discussions (in the pull request section, where this belongs). Maybe he...
14:28 Akron ...even has an idea, how this is already possible.
14:28 intervoice joined #mojo
14:36 SmokeMachine joined #mojo
14:39 cstamas joined #mojo
14:42 kaare joined #mojo
14:54 abra joined #mojo
14:55 koban left #mojo
15:01 judofyr joined #mojo
15:06 KayT3 joined #mojo
15:17 Akron joined #mojo
15:19 Akron How can I render content and close the client connection, when afterwards I want to do some background work. I want to achieve this behaviour https://gist.github.com/1216847, that works with chunks, but I want it with a traditional renderer (because I want to politely send content length).
15:19 Akron (Sorry - the first sentence is a question and should end with an ?. ;))
15:23 metaperl joined #mojo
15:28 * metaperl unvanishes
15:32 Akron You are a ninja, metaperl.
15:32 metaperl Akron: :)
15:47 j-v-e joined #mojo
15:54 metaperl1 joined #mojo
16:13 mattastrophe joined #mojo
16:31 KayT3 i am trying out mojo ( looks like exactly what I need ) and I just installed ubuntu 11.04 in a vm, got activestate perl 5.14 in /opt/ActivePerl-5.14 and I changed /etc/environment to put the /opt/ActivePer-5.14/bin directory in the path. But it is still defaulting to 5.10 that came with the system. Anyone have a suggestion as to overrided the system perl?
16:33 stderr kayt3: what's "which perl" say?
16:33 KayT3 /usr/bin/perl stderr
16:34 stderr I guess you appended the /opt path instead of prepending it, so the system perl is found first
16:34 mspo change that #! /usr/bin/env stuff
16:34 purl mspo: that doesn't look right
16:36 KayT3 i prepended it
16:37 KayT3 its the first thing in my path, though I did append it first, and its done the same thing
16:39 cstamas joined #mojo
16:39 KayT3 hmmm i see a typo tho....
16:39 KayT3 and... that's it... typo!
16:40 stderr ;)
16:41 KayT3 now to get mojo via ppm :)
16:45 elb0w mojo + nginx = sex
16:57 bzero Indeed? I like mojo + spawn-fcgi (or starman now) + nginx :)
16:59 HSlayer|2 joined #mojo
17:04 marcus kinky people. I prefer women
17:05 stderr http://www.smbc-comics.com/comics/20110908.gif
17:07 KayT3 I want to create a restful service for an object that will be consumed by a j2ee web app. Essentially it will be an object with CRUD functionality (using DBD::Oracle) and SOAP will be my transport. Should I use SOAP::Lite or is there a better library for perl (I'm a php/java guy so pardon the lack of perl wisdom)
17:10 stderr how does restful and SOAP go together?
17:11 stderr I've only ever used SOAP::Lite so I have no clue what the alternatives are
17:14 bzero marcus: With women you lose energy!
17:15 stderr I thought this was some voodoo channel, not tantra
17:19 KayT3 well you'll call url and pass an api key. if the url you hit routes to a editable method of an object it will take information you passed it and (if valid) do the operation and send back a proper response.
17:30 sri hmm, i want a new release
17:31 stderr kayt3: sounds like standard SOAP. So Soap::Server should do all you need
17:32 KayT3 that come with Soap::Lite?
17:33 Coke left #mojo
17:34 stderr yup
17:41 xaka joined #mojo
17:42 xaka does Mojo::Collection support kind of groupby?
17:42 sri what's that?
17:42 purl i think that is what I'm trying to figure out.  The session that is listening on the port.
17:43 xaka i have a collection and i want group all elements by some clause and get list of  (key, collection) as the result
17:44 sri don't think so
17:45 xaka very useful (used many times in python). Not sure about result - it could be the hash also
18:00 marty joined #mojo
18:12 osprey left #mojo
18:13 GitHub69 joined #mojo
18:13 GitHub69 [mojo] kraih pushed 1 new commit to master: http://git.io/utdhPA
18:13 GitHub69 [mojo/master] release preparation - Sebastian Riedel
18:13 GitHub69 left #mojo
18:20 rwstauner xaka: i wrote a generic method like that in ruby once... used many times
18:22 perlrocks Twitter: "Released #mojolicious 1.98 with quite a few bug fixes and improvements, enjoy! http://t.co/TgSQFdQ #perl" --kraih http://twitter.com/kraih/status/114041236767248384
18:22 perlrocks Twitter: "Mojolicious 1.98 by SRI - http://t.co/BNou6dI" (ms) --cpan_new http://twitter.com/cpan_new​/status/114041252500078592
18:22 xaka rwstauner: yeah, there is a lot algo tasks which requre groupby logic (and many other)
18:22 xaka i believe http://docs.python.org/library/itertools.html is a good resource for ideas what collection should have
18:23 sri it does sound a bit too specialized for collections
18:23 sri i've thought about ruby style partition
18:24 xaka nope, it just improves it for day-to-day tasks
18:24 mspo map?
18:24 purl map is just a table
18:24 stderr any idea how to get an effect like Catalyst's $c->detach method in Mojolicious? I hate discovering that I need to redirect in some nested method in my controller and then having to communicate the fact that I'm not going to render by return value or something.
18:24 sri how would it look in a oneliner?
18:24 sri stderr: return;
18:25 xaka sri: think more global :) mojo apps are not one-liners ;)
18:25 sri we don't do internal redirects, in favor of promoting restfulness
18:25 sri xaka: then you could just use normal perl features
18:25 xaka it's really good addition to map, each, reduce and other
18:26 xaka i just want to write collection.map.a.b.c.groupby(...) and get the result
18:27 sri http://www.ruby-doc.org/core/c​lasses/Enumerable.html#M001496 # this is what i had in mind
18:27 xaka i could use sort from core or reduce from listutils, but you added (linked) it to collection, so "use normal perl features" doesn't work already
18:27 sri but the real focus of collections are quick oneliners
18:28 sri xaka: you seem to be misunderstanding something
18:28 xaka groupby is a common operation like map and others, ask anyone
18:28 sri collections are just blessed arrays
18:29 stderr sri: in a nested method? No.
18:30 sri stderr: well, we don't do any kind of internal forwarding
18:32 bpaluch sri when hypnotoad goes down due to a graceful shutdown request is there a function or something that can run to clean up active sessions, (like websocket connections to move them)
18:32 sri bpaluch: DESTROY
18:33 bpaluch oh right.
18:34 xaka my %data = (); collection.a.b.c.groupby(sub { $_->{key} }).each(sub { $data{$_->[0]} = $_->[1] }) - really cool i think ([1] could be another collection)
18:34 stderr sri: well, say I have a common controller superclass with stuff needed in several controllers. one of its methods calls $self->check_user_role('foo'). If user doesn't have role foo, I'd like to throw him back to the login page using redirect_to. But redirect_to returns, so I find myself in check_user_role again, haing to return false. And check that in the controller superclass and return false. And check that in the controller subclass and *then* return.
18:35 stderr sri: or wrap each and every controller method's code in an eval and throw an AuthException or something
18:35 sri i would use a helper
18:36 sri but if deep nesting is your style, then that would be the way to go
18:37 sri i don't like the idea of using exceptions for normal flow control
18:37 stderr sri: hm, if two levels is deep for you ...
18:38 stderr nor do I normally but if the alternative is endless if-orgies they start looking attractive
18:39 sri at the mojolicious layer i only see a single if
18:40 sri everything else is your code in which you can do whatever you like
18:40 sri return unless $self->whatever_auth;
18:41 sri hmm, usually this discussion comes up when someone has not discovered bridges yet, have you?
18:42 amoore joined #mojo
18:43 stderr I've read about them but not actually used them. Problem is, I only need the role check if certain params are set
18:44 sri i suck at user support, back to making cool new features with me ;)
18:45 xaka groupby - cool new feature! (and count, and ...)
18:46 stderr sri: well, thanks already, I'll come up with something!
18:46 jwang joined #mojo
19:06 Firkin left #mojo
19:07 elb0w I have like 10 helpers
19:07 elb0w wondering if I went overboard
19:07 elb0w :o
19:12 GitHub20 joined #mojo
19:12 GitHub20 [mojo] kraih pushed 1 new commit to master: http://git.io/E5jEgA
19:12 GitHub20 [mojo/master] documentation tweaks - Sebastian Riedel
19:12 GitHub20 left #mojo
19:13 tempire not necessarily
19:13 tempire though you might want to think about whether some of the helpers would be best served in a separate package, if they're not directly related to web app-specific stuff
19:15 tempire sri: filler release?
19:15 tempire oh, never mind.  I was just looking at 1.99
19:16 elb0w really?
19:16 elb0w er
19:17 grim_fandango joined #mojo
19:29 alnewkirk joined #mojo
19:31 chansen Who took over maintenance of M::S::FastCGI?
19:33 elb0w Dont think anyone did
19:33 chansen bah, I just read on ML that the first volunteer has vanished =(
19:34 elb0w think someone said unit test
19:34 elb0w sri: likes scaring people with that
19:34 chansen If anyone want maintain it but is afraid of writing unit tests, I'll walk you trough it, it's not as hard as sri think it is =)
19:36 chansen I have written a PP implementation of FastCGI and also  fixed a crucial bug in libfcgi, so I am familiar with the protocol
19:37 sri elb0w: UNIT TESTS!
19:37 purl unit tests are done! or what my employer deems useless
19:37 * elb0w cowers in corner.
19:37 sri volunteer has resurfaced though
19:37 sri he just mailed me
19:38 elb0w is volunteer the right word
19:38 elb0w I wonder what the most common deployment of mojolicious is
19:38 elb0w personally I love hypno + nginx
19:39 chansen elb0w: it will be a fun ride and you will learn the FastCGI protocol (which is actually beautifully designed considering it was designed more that 10 years ago and still address the "The C10K problem")
19:40 elb0w Im juggling two startups and full time job atm
19:40 elb0w I think that would make me want to put a bullet in my head
19:40 chansen depends how old you are ;P
19:40 elb0w I also have a girlfriend who lives with me and is a full time student
19:41 elb0w I work 85hr/s a week
19:41 chansen elb0w: ok, probably not a good idea then ;)
19:41 elb0w lol
19:41 tempire does hypnotoad solve the c10k problem?
19:41 chansen the offer still stands, I'll guide/work with anyone who will offer to maintain it
19:42 chansen BTW, I also maintain FCGI.(XS|PM) ;)
19:42 tempire I know that question is probably obnoxious, but if it can be said in any form, http://en.wikipedia.org/wiki/C10k_problem should be updated, for marketing purposes
19:43 elb0w chansen: anyway im semi interested but knowing 0 of the protocol would involve a lot of work on my part
19:43 elb0w How complex is it
19:44 elb0w http://www.fastcgi.com/devkit/doc/fcgi-spec.html ?
19:45 sri tempire: these days basically everything that does non-blocking io solves the c10k problem
19:46 sri and i agree with chansen, it's quite cool the FastCGI folks added multiplexing 10 years ago
19:47 sri but i disagree about it being fun to work with ;p
19:47 Skylos joined #mojo
19:47 Skylos this looks familiar   http://www.threadless.com/product/2604​/Technicolour_Rex/tab,guys/style,zipup
19:48 Skylos puking rainbows!!!
19:48 chansen elb0w: not that complex, you would have to learn stream records and a few special records, you would gain this knowledge in a few hours and if you need help I'll along your side
19:48 sri Skylos: :O
19:49 chansen elb0w: sri has no clue because he copied the broken PP implementation of FCGI ;P
19:49 * chansen just kidding
19:49 * sri sets chansen on fire
19:49 elb0w chansen: ok if my work demands lighten up a bit ill take a look
19:51 chansen I'm sure it will, start with http://search.cpan.org/dist/Net-Fas​tCGI/lib/Net/FastCGI.pod#Standards FastCGI spec and RFC 3875 and then scan the White papers and then you are done!
19:52 chansen Knowledge about HTTP, CGI or FastCGI can't possible hurt your carrier? ;P
19:53 sri i'm not particularly proud of Mojo::Server::FastCGI though, it should have had the clean abstraction of Net::FastCGI
19:53 chansen elb0w: You could always impress clueless CEO's with a shitload of RFC's on your CV ;P
19:55 elb0w lol
19:56 chansen sri: you do know who Tobias Oetiker is, don't you?
19:56 Skylos left #mojo
19:57 sri yes
19:59 chansen good. Having a disappointed user like him isn't good for PR ;=)
20:00 sri you can't make everyone happy
20:03 lammel2 joined #mojo
20:04 chansen Thats true, but it's always possible make more or less strategical decisions considering the impact
20:05 sri well, so far all discussions around the topic came to the same conclusion, that it's the right thing to do
20:09 chansen Your deprecation timeframe sucks, you announced it on ML 2011-09-11 and removed from core 2011-09-14.
20:10 sri it has not been deprecated
20:10 sri it's a split
20:11 chansen ok, my bad then
20:12 rhaen hep
20:12 * sri runs to get a pizza
20:12 metaperl1 run!!!!!
20:12 purl "Away now, Shadowfax!  Run, greatheart, run as you have never run before! Run now!  Hope is in speed!"  --Gandalf
20:12 rhaen sri: hm! MHM!
20:13 metaperl1 get a raw vegan pizza for me
20:16 lammel2 left #mojo
20:17 lammel2 joined #mojo
20:27 SmokeMachine joined #mojo
20:35 Eugene joined #mojo
20:52 rhaen holy!
20:59 sri nom nom nom
20:59 purl I eat your head!
20:59 sri vegan pizza? blasphemy!
21:03 tempire I hate the word demultiplexer
21:09 lammel2 joined #mojo
21:14 rwstauner joined #mojo
21:14 sri marcus: anything new about the config file bug?
21:21 lammel2 joined #mojo
21:31 rwstauner joined #mojo
22:00 meraxes joined #mojo
22:08 Cside joined #mojo
22:28 KayT3 omg i just created a restful service that hits an oracle database with perl in less code it would take to write a confinguation file for java Spring3
22:28 KayT3 lol... good god mojo is hot
22:31 metaperl joined #mojo
22:33 tempire retroactively, I'm really surprised perl doesn't have head and tail functions built-in
22:34 KayT3 save for the quirky syntax (me coming from php and java) perl is pretty slick so far. now I gotta build some packages to get a better mvc dynamic to my service
22:46 metaperl tempire: what do you need head and tail for?
22:47 tempire for functionally working with lists
22:48 sri what would head and tail functions do?
22:48 tempire http://search.cpan.org/~lbrocard/Lan​guage-Functional-0.05/Functional.pm
22:48 tempire head - first element of list
22:49 tempire tail - all elements except for the first
22:49 sri ah
22:49 tempire I just realized you can cheat using splice and the turtle operator
22:49 * tempire <3 turtles
22:56 tempire oh, and 5.14 allows for expressions as a parameter to splice, in addition to arrays
22:56 tempire \o/
23:38 noganex_ joined #mojo

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