The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2014-03-18

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

All times shown according to UTC.

Time Nick Message
00:00 jberger I don't hate it, I dislike schemas
00:01 jberger back to the issue at hand, do you need one client to be able to block the requests of all odd the other clients?
00:02 jberger or do you just need to be able to block the request of the client in question
00:02 punter There's only going to be one client being served per server process.
00:02 punter So I don't mind blocking everyone else.
00:02 jberger well then it doesn't matter
00:03 punter But delay won't make the route handler to wait before returning, will it?
00:03 punter If I put all my code in delay, the route handler will finish early
00:04 punter and COMMIT will be sent before I have a chance to write what I want to the database
00:04 punter If I didn't need transactions, I'd probably use Mongo
00:05 jberger what do you mean by route handler? is this a controller method/action or a bridge?
00:05 punter and table joins, as well
00:05 punter I mean the controller method action.
00:06 jberger so you are worried about some scope guard falling out of scope and committing?
00:07 punter I don't know what scope guards are, but I've written an "around_action" hook, that executes BEGIN TRANSACTION before the action, and COMMIT afterwards
00:08 punter which means that if the action completes, commit will be maded
00:08 punter made
00:09 jberger ok well imo that sounds like a bad idea
00:10 punter Is there any other way transactions can be done with Mojolicious? (not necessarilly a better one, just any other way)
00:10 mst are you using DBIx::Connector for transaction management or DBIx::Class ?
00:10 punter No, I use Rose::DB::Object
00:11 mst oh. right.
00:11 mst hahahahahahahahahahahahaha.
00:11 purl Shut the hell up.
00:11 mst their transaction management code is optimised for speed rather than actually committing reliably
00:11 punter I'll learn DBIC one day, but until then RDBO is what I have.
00:11 mst I won't touch it except for money
00:11 jberger now now, let's be nice (I'm looking at you purl)
00:11 punter o
00:12 mst I spent two days tracking down a bug in a customer app once
00:12 punter i didn't imagine committing was that hard
00:12 mst because they trusted mysql to tell them the truth all the time
00:12 mst so when it didn't, everything broke
00:12 mst DBIx::Class and DBIx::Connector don't, so both committed reliably even with the buggy mysql lib
00:12 jack joined #mojo
00:12 jberger I would only use transactions in the tightest scope allowed
00:13 mst right, making them across a whole request is usually icky
00:13 jberger and I wouldn't automate the commit side at all
00:13 mst then again, RDBO is kinda icky in general
00:13 mst the close-to-3000 line single sub that generates the SQL is hilarious
00:13 mst there's like three classes co-operating to do that in DBIC
00:13 jberger automating a rollback if not committed might be sane, but even then you have transaction logic in an around hook
00:14 mst DBIC's $schema->txn_do or DBIx::Connector's $conn->txn both work great
00:14 mst aha, Rose::DB provides ->do_transaction
00:15 mst basically, batch the db work together, do it as a single txn at some point
00:15 mst then the rest of your stuff can still be async
00:15 mst and ->do_transaction will basically work the same way as in everything else, except slightly faster and significantly more dangerous
00:16 punter dangerous?
00:16 d4rkie joined #mojo
00:16 punter it's got the commit problem of mysql that you said before?
00:16 punter hm
00:17 mst I don't trust Rose::DB's transaction management
00:17 mst because the author works around problems as he finds them, rather than coding defensively
00:17 mst no no, once I reported the problem, he worked around it
00:18 mst http://paste.scsys.co.uk/326758
00:18 mst see - it checks now.
00:18 mst of course if any other driver ever gets the same bug, or DBD::mysql adds it back, everything will be broken again
00:18 mst but HEY FAST
00:18 punter I'm used to RDBO and I write good-looking code with it. If I can achieve the same level of tidiness with DBIC I have no problem switching
00:19 mst DBIC is harder to learn than RDBO but much more powerful
00:21 jberger I liked dbic, for my part. If I was forced to use a relational/sql db I would be using it still
00:22 jberger my biggest problem was that I was not tied to that and so schema management just finally broke my will
00:25 spoot joined #mojo
00:29 freman joined #mojo
00:30 freman greetings gentle folk, I'm trying to set up a route with a restrictive placeholder but it's not working
00:30 asarch joined #mojo
00:30 freman $admin_bridge->get('site/config/:id', id => qr/\d+/)->name('site_config')->to('sites#site_config');
00:30 freman if I go to /admin/site/config/100 it's saying route not found
00:40 freman remove the id => qr/\d+/ and it works fine
00:41 sri what gave you the idea that those are the correct arguments?
00:50 dvinciguerra joined #mojo
01:03 freman http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#More_restrictive_placeholders
01:03 laouji joined #mojo
01:04 freman have I made a mistake in assuming get() is equiv to route->via('GET')
01:14 good_news_everyone joined #mojo
01:14 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ux1bog
01:14 good_news_everyone mojo/master e2de323 Sebastian Riedel: make differences between route generators a little more obvious
01:14 good_news_everyone left #mojo
01:14 freman guess not
01:16 freman actually to be fair, you probably didn't need to remove the first definition
01:17 laouji_ joined #mojo
01:18 sri freman: let me guess, you skipped the lite tutorial?
01:18 sri "because you only need a full app"
01:19 freman I haven't read the lite tutorial for some time (I have read it, and I have even converted a lite app to a full app) but I'm not doing lite, I'm doing a full app.
01:19 freman so I didn't think to go back and reference a tutorial when tutorials are usually cut down versions of documentation for the sake of getting people started and instead went to the reference manual
01:20 sri that's not true, you read half of it and made assumptions
01:21 sri you ceetainly did not read http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#More_convenient_routes
01:21 sri s/e/r/
01:21 freman I read more_resitrictive_routes because that's what I was after
01:21 * freman sighs, I don't know why I bother with you lot
01:21 freman left #mojo
01:22 sri meh
01:23 sri guess i'll be taking a break from answering questions again
01:26 laouji joined #mojo
01:28 laouji_ joined #mojo
01:30 mattastrophe joined #mojo
01:40 ua_ joined #mojo
01:41 hesperaux__ joined #mojo
02:06 cfedde I've been using Mojolicious::Plugin::Mount under Hypnotoad on a custom port.  With direct access this seems to work but if I access via an apache proxy paths get shortened.  Is there a clean way to deal with this?  Am I just doing it wrong?
02:25 rem_lex joined #mojo
02:28 abra_ joined #mojo
02:46 marcus sri: https://twitter.com/Fremean/status/445732103141871616 :D
02:52 klapperl_ joined #mojo
03:01 Adura Some people can't deal with opensourcitis well.
03:02 hesperaux_ joined #mojo
03:04 hesperaux_ joined #mojo
03:12 damaya joined #mojo
03:13 damaya Hmm, at what point do you decide that a full app is a better solution than a lite app?
03:13 damaya E.g., you're designing something, seems simple enough and so you start with a liteapp... as you're going about it, the idea begins to grow... has it outgrown the liteapp?
03:18 damaya I guess there's no real clear cut answer to that question.
03:20 jberger I only use lite apps for examples
03:21 damaya Yeah, I mean you could do even the simplest thing with a full app if you so choose, or complex stuff with liteapps.
03:21 damaya Hrm, hehe
03:21 Adura When your lite app file is larger than 1MB.
03:22 russum How do I select an HTML element with an existing "style" attribute (doesn't matter what's in it as long as it exists)? I tried http://mojolicio.us/perldoc/Mojo/DOM/CSS#Efoo but it's not returning anything with 'div[style]' selector.
03:23 lucs Adura: Should that be 1024 bytes, or can we round it off to 1000?  ;)
03:23 lucs (add a k in there...)
03:24 Adura That'd be MiB.
03:25 damaya hehe
03:40 jberger russum: just checking, but is the element a div?
03:43 russum jberger: yes, it was, but this was my mistake. the attribute was added by a js code and did not exist yet when I was trying to select it. thanks!
03:54 espent joined #mojo
03:57 jberger ah yeah, that's easy to miss
04:13 sujithm joined #mojo
04:31 cpan_mojo Mojolicious-Command-secret 0.03 by sshaw - http://metacpan.org/release/SHAW/Mojolicious-Command-secret-0.03
05:27 laouji joined #mojo
06:57 mishantil joined #mojo
07:00 basiliscos joined #mojo
07:08 toebu joined #mojo
07:08 toebu good morning
07:08 purl Lies!
07:12 mishantil Looks good from here.
07:12 laouji joined #mojo
07:15 toebu I have written this largish mojo app. to see if my controller instances get 'released' after doing their duty, I added a DESTORY method printing "Good Bye World" to one of the larger ones ... unfortunately it never prints this ...
07:15 toebu I checked with a simple mojo demo app and there it works fine
07:15 toebu so I must be keeping some reference to the controller
07:15 toebu or there is a circular reference inside
07:16 toebu are there any automated tools for figuring out what is 'holding' it ?
07:16 toebu s/DESTORY/DESTROY/
07:16 mishantil Devel::Cycle perhaps?
07:17 toebu yea, that one outputs A LOT :-)
07:17 toebu if an object contains a circular reference it will not get destroyd ?
07:17 toebu even when noone outside knows about it anymore, right ?
07:19 toebu where in the mojo infrastructure would be the ideal location to look at a controller ready for cleanup ?
07:19 laouji joined #mojo
07:19 laouji joined #mojo
07:20 gnephiak joined #mojo
07:39 laouji joined #mojo
07:41 dod joined #mojo
07:43 Vandal joined #mojo
07:49 denisboyun joined #mojo
08:03 dod joined #mojo
08:07 eseyman joined #mojo
08:20 rawler joined #mojo
08:21 laouji joined #mojo
08:21 laouji joined #mojo
08:35 Andy2 joined #mojo
08:38 rawler joined #mojo
08:39 radixo joined #mojo
08:40 radixo hello guys.. I am with a little problem.. how to test if get('example.com')->res->dom('a#id1') has encountered something?
08:45 sujithm joined #mojo
08:47 moritz radixo: you could check if ->content_xml is non-empty, for example
08:49 moritz I'm sure there are better ways though
08:58 radixo moritz: I discovered it is an array
08:58 radixo so..
08:59 radixo justd @$obj
09:00 moritz an array, or a Mojo::Collection?
09:00 trone joined #mojo
09:04 jack joined #mojo
09:10 radixo moritz: every perl obj is a reference to a type
09:11 radixo it could be an array, a hash, or a scalar reference
09:12 moritz radixo: I know, but that doesn't quite answer my quesition :-)
09:12 moritz radixo: maybe I should have asked "is the array ref blessed?"
09:12 radixo yeap
09:12 radixo ;)
09:13 radixo thanks guy
09:13 radixo see you
09:19 laouji joined #mojo
09:20 denisboyun joined #mojo
09:25 dod joined #mojo
09:35 laouji joined #mojo
09:38 ver joined #mojo
09:47 spoot joined #mojo
09:48 spoot joined #mojo
09:52 pernicious mst: Just saw your comments from 00:18
09:53 pernicious Are people really using transactions with auto_reconnect?
09:53 pernicious but but but that's insane
09:55 espent joined #mojo
09:58 pernicious The real fix should have been "die q{You are a dangerous lunatic; we are now sending a 600V 200A charge to your keyboard.}"
10:01 dod joined #mojo
10:29 denisboyun joined #mojo
10:29 laouji joined #mojo
10:37 laouji joined #mojo
10:42 laouji joined #mojo
10:46 good_news_everyone joined #mojo
10:46 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/FVoOpw
10:46 good_news_everyone mojo/master 116d280 Sebastian Riedel: mention which methods are considered low-level
10:46 good_news_everyone left #mojo
10:47 maxhq joined #mojo
10:55 laouji joined #mojo
11:01 d4rkie joined #mojo
11:13 good_news_everyone joined #mojo
11:13 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/qxuQlg
11:13 good_news_everyone mojo/master 14352dc Sebastian Riedel: mention return values
11:13 good_news_everyone left #mojo
11:26 Jonneh joined #mojo
11:32 mattastrophe joined #mojo
11:50 xmerlin joined #mojo
11:50 xmerlin_ joined #mojo
11:55 tardisx joined #mojo
12:07 fhelmber_ joined #mojo
12:14 hesperaux__ joined #mojo
12:17 sjn joined #mojo
12:21 abra joined #mojo
12:46 malikai how do i know if a file write fails with spurt? what if everything's ok until the cache gets flushed?
12:49 moritz malikai: it throws an exception if anything files
12:49 moritz as for cache flush time: it's the operating system's job to ensure that nothing goes wrong at that point, and there are no user-space APIs to deal with such errors
12:50 malikai oh so i get an exception for anything then.. perm denied, no space, etc..?
12:51 moritz malikai: yes
12:54 malikai it confused me, it was too easy..
12:54 malikai "wtf.. where's the callback?"
13:04 doby joined #mojo
13:26 sujithm joined #mojo
13:43 Jonneh joined #mojo
13:56 mishantil joined #mojo
13:57 abra joined #mojo
14:00 jack joined #mojo
14:03 neilhwatson joined #mojo
14:05 good_news_everyone joined #mojo
14:05 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/mxNABw
14:05 good_news_everyone mojo/master 141cce6 Sebastian Riedel: removed deprecated secret method from Mojolicious
14:05 good_news_everyone left #mojo
14:06 neilhwatson Is that the odd message I see in morbo output?
14:13 sh4 joined #mojo
14:25 nic neilhwatson: Does it mention changing your secret(s)?
14:25 rawler joined #mojo
14:44 gryphon joined #mojo
14:59 neilhwatson nic: Yes.
15:07 nic neilhwatson: You're seeing something else. A very cryptic message which actually means you need to change your secret
15:19 rawler joined #mojo
15:21 Eke|| joined #mojo
15:29 asarch joined #mojo
15:40 spoot joined #mojo
15:44 neilhwatson What secret?
15:44 purl secret is in the url :)
15:53 odc neilhwatson, are you serious? read this: http://mojolicio.us/perldoc/Mojolicious/Lite#Sessions
16:02 meshl joined #mojo
16:03 hummeleBop joined #mojo
16:03 spoot joined #mojo
16:05 abhishekisnot joined #mojo
16:14 neilhwatson The work I'm doing does not require session keeping.
16:23 odc neilhwatson, yup, me neither. But we still have to set the secrets
16:23 odc or accept the warning
16:24 ua_ joined #mojo
16:28 neilhwatson Thanks for the tip. Still learning mojo.
16:39 ua_ joined #mojo
16:55 dvinciguerra joined #mojo
16:55 spoot joined #mojo
16:59 ua_ joined #mojo
17:19 spoot joined #mojo
17:23 abra_ joined #mojo
17:41 mire__ joined #mojo
17:52 dod joined #mojo
17:53 davido_ joined #mojo
17:59 abra joined #mojo
17:59 denisboyun joined #mojo
18:16 Eke- joined #mojo
18:23 mattastrophe joined #mojo
18:32 punter joined #mojo
18:59 spoot joined #mojo
19:27 dexteruk joined #mojo
19:27 dexteruk Hi All
19:29 dexteruk mojo, sorry if this is a stupid question, i know i can do this a long way around, but i want to know if there is a quick way.  I grab just the last placeholder
19:30 dexteruk so the www.something.com/holidays/uk/london i want to just grab the last placeholder london in this case
19:46 neilhwatson mojo::url ?
20:08 spoot joined #mojo
20:11 Eke- joined #mojo
20:45 spoot joined #mojo
20:46 meshl joined #mojo
20:49 marty dexteruk:  something like $r->route(‘/holidays/uk/:city’) might work.  This assumes all your url's are formed similarly.
20:49 dexteruk its ok i did it with regular expression
20:50 dexteruk but thanks :marty
20:56 spoot joined #mojo
21:06 mire__ joined #mojo
21:12 Eke- joined #mojo
21:22 beyondcreed joined #mojo
21:25 cpan_mojo Mojolicious-Plugin-RenderFile 0.07 by Viktor Tuskyi - http://metacpan.org/release/KOORCHIK/Mojolicious-Plugin-RenderFile-0.07
21:26 spoot joined #mojo
21:44 meshl joined #mojo
22:10 Adurah joined #mojo
22:12 meshl joined #mojo
22:34 asarch joined #mojo
22:50 jack joined #mojo
23:08 AirDisa joined #mojo
23:19 Zx3 joined #mojo
23:38 mire_ joined #mojo

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