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

IRC log for #mojo, 2015-03-19

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

All times shown according to UTC.

Time Nick Message
00:05 cpan_mojo Net-Easypost 0.15 by MCMILLHJ - http://metacpan.org/release/MCMILLHJ/Net-Easypost-0.15 (depends on Mojolicious)
00:59 Averna joined #mojo
01:01 sri marcusr: the minion object is stored in a helper, which emits events
01:01 sri jberger: are you using Mojo::mysql?
01:01 jberger sri: not yet
01:02 jberger one step at a time
01:02 sri ah, ok
01:02 sri sth cache might be of great value there too
01:02 * sri pokes batman
01:02 jberger it was a big deal getting dbix connector there
01:03 jberger their app was still very much in the cgi philosophy
01:03 jberger even if the app had been ported (hastily) to psgi and served by starman
01:04 jberger you could tell it was designed without persistence
01:05 zivester joined #mojo
01:37 sri i guess prepare_cached could be used with some crazy magic... but that would be worse than the current solution https://metacpan.org/pod/DBI#prepare_cached
01:38 sri would need an actual lock on the sth... ->{Active} is too unreliable
01:39 sjn joined #mojo
01:48 cpan_mojo Mojo-Pg 1.16 by Sebastian Riedel - http://metacpan.org/release/SRI/Mojo-Pg-1.16
01:49 sri oh well, you had your chance ;p
02:01 sri you can now test caching and prepared statements very easily
02:02 sri my $pg = Mojo::Pg->new('postgresql://postgres@/test?pg_server_prepare=0')->max_statements(0);
02:02 sri to disable prepared statements as well as sth caching
02:02 mst sri: make a large table with a boolean active column. WHERE for it being true. watch it do a table scan anyway.
02:04 sri i believe crab said earlier that's not the case anymore
02:04 sri since 9.2 or so
02:08 mst sri: that's the one that murdered me earlier, but it's a clear example of "preparing things that don't need to be can deprive the optimiser of information", which is the real point
02:09 sri not saying you're wrong, but so far all benchmarks i've seen suggest prepared statements are a good default
02:10 hshong joined #mojo
02:10 mst sri: I suspect more complicated queries will disprove that, but I'm unable to provide direct answers
02:10 mst sri: what I do know is that the primary maintainer of DBD::Pg wishes he'd defaulted it to zero
02:11 mst sri: and I'm willing to assume he knows better than me
02:11 sri my benchmarks were certainly not very elaborate (nobody else even tried!), but across the board there have only been gains
02:12 jberger can you contact the maintainer of DBD::Pg?
02:12 sri my most elaborate tests have been the minion queries btw.
02:12 jberger sounds like he would know what to try
02:12 mst yes, or the owner of one of the best pg consultancies out there
02:12 mst or the staff at a bunch of others
02:12 mst or one of the best DBAs I've ever known
02:12 mst and I'd be happy to with a defined question
02:12 sri point is... prove me wrong and i'll change it :)
02:13 mst sri: tell me what the question is and I'll have it investigated
02:13 mst otherwise you're just assuming you're right just as much as I have been
02:13 klapperl joined #mojo
02:15 sri what i've been asking for all day was a benchmark for something that was faster in Mojo::Pg 1.15 than in 1.16
02:16 sri not a special case, something you'll see commonly in apps
02:16 sri something that proves sth caching and/or prepared statements are not a good default
02:17 jberger clearly so far no one had such an example
02:17 mst sri: sure, I'll try and find people who prove the DBIx::Class community aren't idiots
02:18 sri no, i don't trust blindly anymore
02:18 jberger sri: have you reached out to the maintainer?
02:18 sri you may very well be wrong, but all evidence i've seen points in the other direction
02:18 sri jberger: no, i don't know him
02:19 sri s/wrong/right/
02:19 sri ;p
02:19 jberger it sounds to me like he knows the question and hopefully the answer too
02:20 mst sri: G_SabinoMullane - if you haven't spoken to him, you know even less than I do
02:20 sri for now i'll trust the numbers
02:21 sri prove me wrong, don't use Mojo::Pg, i'm ok with it either way
02:22 sri for everyday queries it was faster https://gist.github.com/anonymous/2acf4dcfff46593a2175
02:22 mst sri: sure, just find queries whose best plans are different depending on the bind params and show they're better overall
02:23 sri the option for disabling it is there
02:24 mst sri: if you show #postgresql benchmarks of them, you make your case for turning it on
02:25 sri i try to avoid #postgresql
02:25 mst shame, really, they're smarteer than us both put together
02:27 sri this post by GSM sounds quite encouraging too http://blog.endpoint.com/2014/04/custom-plans-prepared-statements-in.html
02:29 sri crab is also a postgresql developer (in case you didn't know)
02:29 purl okay, sri.
02:29 * sri kicks purl
02:29 * purl kicks sri
02:29 * sri kicks purl
02:29 * purl kicks sri
02:32 kaare joined #mojo
02:33 Grinnz pillow fight!
02:33 * sri kicks Grinnz
02:35 mst sri: um, duh, I showed him the perl community and tried to hire him once
02:36 mst sri: he's one of my favourite #postgresql people and one of the reasons I think you're wrong for avoiding it
02:36 sri http://fc00.deviantart.net/fs70/i/2012/052/b/9/well__duh__by_cptflowers-d4qidaz.jpg
02:44 sri latest one-liner btw., showing how to benchmark with and without caching/prepared-statements https://gist.github.com/anonymous/ac75855b071fa133cb9b
02:45 sri in case someone wants to give it a try after all
02:47 sri (btw. Mojo::Pg does not specifically enable pg_server_prepare, it just uses the DBD::Pg default)
03:07 bpmedley sri: Just letting you know I did some rudimentary benchmarks with the code from a few hours ago (the statement cache handles).
03:08 bpmedley I didn’t find anything to report; however, I just wanted you to know people were listening… :)
03:14 noganex_ joined #mojo
03:28 sri bpmedley: :)
04:18 inokenty-w joined #mojo
04:20 alexbyk joined #mojo
04:32 asarch joined #mojo
04:36 melo joined #mojo
04:39 melo1 joined #mojo
04:47 irq joined #mojo
04:49 alexbyk hi Mojo::People)
04:53 basic6 joined #mojo
05:32 marmez joined #mojo
05:59 alexbyk Yesterday my example wasn't so expressive. Today I have an excellent "real world" (I know you like this word) example/excersice/explanation. You surely should check it out.
05:59 alexbyk But please, read comment before executing a code - this is an exercise too, which may surprise even experienced perl developers
05:59 alexbyk It's not about Mojo::Base, it's about "should I write local $@?" in general
05:59 alexbyk Here is the secret link link: https://gist.github.com/alexbyk/33795e2fc4718ca2845a
05:59 alexbyk It's free and opensource) Don't miss it)
06:00 alexbyk jberger: hi, check a link above pls
06:00 alexbyk sri: hi, check a link above
06:00 alexbyk everyone pls)
06:01 Adurah You forgot the opening parens.
06:11 alexbyk where?
06:12 Oleg joined #mojo
06:12 Adurah "It's free and opensource) Don't miss it)", "everyone pls)"
06:13 alexbyk Adurah: didn't get it))) But thanks)))
06:14 Oleg alexbyk: Why you are checking $@ inside DESTROY if you haven't any eval before inside DESTROY? Adding something like eval{1} before checking fixes your issue
06:14 Adurah Wait, I get it, you have a lisp.
06:15 Oleg Adurah: This is Russian-style smiles :D
06:15 alexbyk https://gist.github.com/alexbyk/33795e2fc4718ca2845a
06:15 alexbyk Consider this as an exuce for my a little bit rude behaviour)) As you see these bugs are non trivial so it's not simple to explain it)))
06:15 Adurah Oh, looks like some lisp issues.
06:15 alexbyk Oleg: that's the point) Try to answer the question in the comment without executing a code)
06:17 alexbyk Adurah: Don't listen to oleg) This isn't a smile) In post USSR the internet is very expensive, every message costs about 1cent for me. But if you use ")" - it's free
06:18 Oleg I never check $@ if I have no eval{} one line before.
06:18 Oleg Don't understant why you are doing this
06:20 alexbyk Oleg: we were arguing yersterday about my proposal at Mojo::Base. Could you please read it?) Because it will explain that. And why am I doing this - this is a kind of Guard.pm at cpan but for errors only
06:21 Oleg link?
06:23 alexbyk Oleg: irc log above contains our conversation) But it's boring) It only interesting for participant) Don't waste your time because it's much to read and don't worth it)
06:25 alexbyk Oleg: In short - I told that Mojo::Base is far from perfect. r u OlegWhatAFCK - the author of the prev article? Because I was talking that I'm not good in explanations but maybe oleg will come and write a new article)
06:28 Oleg You should know that wtf is http://www.worldtaekwondofederation.net/
06:54 dotandimet joined #mojo
06:54 dod joined #mojo
06:58 dod joined #mojo
06:59 Eke- joined #mojo
07:08 mattastrophe joined #mojo
07:20 yiminy joined #mojo
07:26 McA joined #mojo
07:28 coolo joined #mojo
07:29 yiminy yo, can I listen to a file forever with Mojo::IOLoop::Stream?
07:29 Lee batman: great! cheers
07:29 * Lee updates examples
07:29 yiminy entropy!
07:29 purl entropy is a good measure of commonness * surprise value or H[n](p[1],p[2],...,p[n])=-sum(i=1,n,p[i]*log2(p[i])))
07:31 yiminy like tail
07:33 Vandal joined #mojo
07:42 Oleg Mojo::IOLoop::Stream works only for sockets, I believe
07:42 melo joined #mojo
07:43 Oleg yiminy ^^^
07:43 melo1 joined #mojo
07:44 yiminy yeah that must be the feel I'm going for from fs
07:45 yiminy a space for things to put content + stream updates to content
07:46 cpan_mojo Mojolicious-Plugin-OAuth2-Server 0.11 by Lee Johnson - http://metacpan.org/release/LEEJO/Mojolicious-Plugin-OAuth2-Server-0.11
07:47 yiminy know any other ways to?
07:47 Oleg however you can implement it yourself with Linux::Imotify2. This article describes how tail -F works https://freethreads.wordpress.com/2010/10/20/how-tail-f-work/
07:48 reneeb joined #mojo
07:48 Oleg s/Linux::Imotify2/Linux::Inotify2/
07:48 yiminy seems like somebody would have got it working nice somewhere
07:48 yiminy by now
07:50 yiminy yeee... it's all needing a map isn't it?
07:50 Oleg which map?
07:51 yiminy a map of how to do everything
07:51 yiminy to chase out the bogs
07:51 yiminy it's not that much stuff you just have to know the spells
08:02 bpmedley_ joined #mojo
08:03 yiminy maybe App::RabbitTail::FileTailer
08:04 eseyman joined #mojo
08:05 Oleg ohh, which a horrible dependencies
08:08 yiminy hmm
08:08 yiminy isn't this like the simplest thing ever?
08:11 Oleg may be opening a pipe to tail -F will be good enough for you? Mojo::IOLoop::Stream should work good with pipes
08:12 AndrewIsh joined #mojo
08:14 Oleg yiminy: like this: open my $fh, '-|', 'tail', '-F', "/foo/bar.txt" or die $!; $s = Mojo::IOLoop::Stream->new($fh)
08:14 yiminy yeah spose only the streamy need to stream
08:14 yiminy if they stream about the sluprs
08:14 yiminy life ... etc!
08:16 eseyman joined #mojo
08:16 yiminy yeah that'll be sweet! thanks man
08:17 yiminy ah so everyone does this aye
08:17 yiminy so we need like a flux field of irc converstations
08:17 punter joined #mojo
08:22 dotandimet joined #mojo
08:23 mattastrophe joined #mojo
08:26 trone joined #mojo
08:30 batman Lee: yeah. thanks for noticing so early :)
08:30 batman hopefully we'll get rid of that back compat in a april/may
08:31 marcusr <o/ \o>
08:31 * marcusr is stuck on the subway.
08:31 marcusr 'Signalfeil'.
08:33 crab feil!
08:34 marcusr we're rolling!
08:35 fhelmber_ joined #mojo
08:35 marcusr it's no biggie anyways, oslo recently updated the subway net with 4g coverage
08:35 marcusr as long as I don't run out of battery...
08:35 marcusr crab: I've progressed some with my bot project btw - github.com/marucsramberg/marvin
08:37 coolo batman: good morning. did you see my question of last night?
08:38 janus joined #mojo
08:39 batman coolo: sorry about that.
08:39 batman i missed out :/
08:39 batman but...
08:39 batman are you using a custom bootstrap.scss or the default?
08:41 coolo well, not a custom bootstrap.scss but overwriting things in there - but that's not my problem. I want to add other css together with bootstrap to THEONE.css
08:41 coolo so right now I'm helping myself with this: https://github.com/os-autoinst/openQA/pull/280/files#diff-ca54f079f3e69dc7778e4f0c33e92c96R19
08:42 crab marcusr: 404
08:42 crab oh, that's just because you have trouble spelling your name too
08:43 kaare joined #mojo
08:45 batman coolo: there's no good way to do that actually, but you don't need the plugin if you're not cutomizing. just do this instead: $app->asset("foo.css" => qw( http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css /css/yourasset.css ));
08:46 batman i guess i should mention that in the documentation.... coolo: do you mind opening a ticket on github for that, so i don't forget?
08:49 batman coolo: did that make sense...?
08:49 coolo batman: a) I *do* customize and b) I deploy from packages and these packages build without network access
08:49 batman customizing = changing the scss files.
08:50 coolo batman: I overload files of the sass sources
08:50 batman with a .css file or a .scss file?
08:52 batman you should choose: do you want to build one asset from a bunch of .scss files or do you want to combine a lot of .css files.
08:52 coolo batman: I actually don't even use the bootstrap.scss but I do this: https://github.com/os-autoinst/openQA/blob/80ce9b3df15197a7dae4a7f29a5f153c1d978c6d/public/sass/bentostrap.scss
08:53 coolo batman: actually I want to combine all my .css files with all .scss files from bootstrap - as I'm used to from rails (sorry for that :)
08:54 batman can you write some pseudo code of what you want? i think i fail to understand :(
08:54 batman make a pastebin or something
08:54 crab do_what_i_want()
08:54 crab #scnr
08:55 batman crab: that's assetpack. bootstrap3 is not quite there yet ;)
08:55 uma joined #mojo
08:56 batman coolo: can't you just do $app->asset("app.css" => qw( /sass/bentostrap.scss /css/otherfile.css )); ?
09:00 wikihead joined #mojo
09:01 coolo batman: yes, I figured that part after asking here :)
09:01 batman ok :)
09:01 coolo batman: but it was far from obvious - and I still have no solution on how to do that for js
09:02 batman so what i would do is $app->plugin(Bootstrap3 => {css=>[],js=>[]});
09:02 batman it will simply make the assets available in your "manual" assetpacking
09:02 coolo after that I'd still do /js/bootstrap.js ?
09:03 batman coolo: yeah. you can use any of the files in this list: https://metacpan.org/pod/Mojolicious::Plugin::Bootstrap3#STATIC-FILE-STRUCTURE
09:03 batman those files are available after loading the plugin. so you can either just go to http://localhost:3000/js/bootstrap/tab.js or use them in $app->asset(....)
09:04 coolo ok
09:05 coolo so my main problem yesterday was that I named my THEONE.js bootstrap.js
09:05 coolo so I had two assets with the same name
09:05 * coolo is in progress of porting the app to bootstrap, so I have 2 themes on different routes atm
09:07 marcusr crab: spelling is hard, let's go shopping :'(
09:10 crab why did you become marcusr anyway? i just _cannot_ type that correctly. always comes out as marcurs. even just now when i was thinking about it.
09:16 batman coolo: have you seen the theme support i added some days ago? https://metacpan.org/pod/Mojolicious::Plugin::Bootstrap3#register
09:16 marcus crab: it's my university username
09:17 marcus guess I should bribe someone so I can have 'marcus'.
09:18 crab should've just written your name down as marcu sramberg
09:25 coolo batman: yes, but it seems to require a URL and I want my customizations with the app
09:25 coolo batman: I just want to avoid duplicating all of bootstrap assets
09:29 coolo batman: so the solution with $app->plugin(Bootstrap3 => {css=>[],js=>[]}); sounds actually what I want
09:29 arthas joined #mojo
09:30 batman coolo: sweet!
09:35 coolo batman: now I want a plugin like that for jquery2 and jquery.datatables :)
09:35 batman you don't need it.
09:35 batman just add the url to your asset() definition
09:37 coolo batman: yes, I would - if it wouldn't conflict with my deployment strategy. It's a bit unusual, but linux distributions tend to make a package out of *everything* and so we do the same with our apps :)
09:38 batman coolo: i don't see how they conflict. just bundle the /public/packed files and it won't download the jquery2 file again
09:38 coolo batman: oh, btw: you forgot to mention in your talk another gotcha
09:38 batman the http://cdn.com/asset.js files are only downloaded once.
09:38 batman coolo: the file above will be cached as public/packed/http___cdn_com_asset_js.js
09:38 coolo batman: yeah, but during package build there is no network available to get reproducible builds
09:39 batman then bundle it up front.
09:39 kwa joined #mojo
09:39 coolo yeah, that's what I would need to do
09:39 batman i think you're making up problems now.
09:39 * coolo already considered that option
09:39 batman at least i won't make a jquery2 plugin, since it's really not required.
09:39 batman what other gotcha?
09:39 coolo batman: I don't say you should. It's just my wishlist
09:39 coolo ah, right
09:40 coolo my /public/stylesheets/jquery.chosen.css refers an image from public/stylesheets/
09:40 batman but it's really stupid to make it. it only add delay. it doesn't give you anything extra.
09:40 coolo but as the assetpack plugin moves the .css to public/packed the png is no longer found
09:41 coolo so I need to move/symlink the pngs
09:41 batman no. use relative urls.
09:41 batman url(../background.png)
09:42 batman background-image: url(../images/background.png);
09:42 coolo batman: it's not mine, it's upstream: https://github.com/harvesthq/chosen/blob/master/sass/chosen.scss
09:43 coolo but I guess I could take the sass instead and overwrite the url
09:43 coolo batman: all I'm saying it's a gotcha
09:43 batman aha. then use this trick: https://github.com/mojoconf/MCT/blob/master/lib/MCT.pm#L44
09:44 batman i think i need to add that example to https://metacpan.org/pod/distribution/Mojolicious-Plugin-AssetPack/lib/Mojolicious/Plugin/AssetPack/Manual/Assets.pod ...
09:45 batman i think i will just copy/paste this test to the pod: https://metacpan.org/source/JHTHORSEN/Mojolicious-Plugin-AssetPack-0.42/t/online-example-expand-src-url.t
09:45 batman does that make unittest sense coolo?
09:47 OmarOthman1 joined #mojo
09:49 coolo batman: took me a while, but I understand it, yes :)
09:53 irq joined #mojo
09:59 melo joined #mojo
10:06 batman Awesome!
10:06 batman coolo++
10:07 alnewkirk joined #mojo
10:08 wikihead Hey, anybody here knows a Good Example of Full Webapp/Website made on Mojolicious
10:09 wikihead All i see is only LiteApplications
10:09 wikihead Looking for a proper Full Applications with Nice GUI
10:10 stl Full application without nice GUI https://github.com/kraih/mojo-pg/tree/master/examples/blog
10:10 Zoffix :D
10:11 stl Full application with nice gui  https://github.com/Nordaaker/convos
10:11 Zoffix Also, batman++ # AssetPack is awesome
10:11 batman Zoffix: thanks :)
10:11 batman sri++ # making me make assetpack :)
10:12 marcus asspack <3
10:20 coolo wikihead: ours is a full application: https://openqa.opensuse.org/
10:20 jwang joined #mojo
10:22 wikihead @coolo, can i see the code?
10:23 coolo wikihead: https://github.com/os-autoinst/openQA
10:23 * coolo even has selenium tests! :)
10:26 OmarOthman joined #mojo
10:26 wikihead openqa seems too advanced for me to learn
10:27 wikihead i am using perl for automation of my jobs
10:27 wikihead i had some basic knowledge in html/js
10:28 wikihead i wish to build a site for my automatated jobs
10:30 uma joined #mojo
10:31 uma a simple web ui with a header, menu, some good looking forms, send data to server which processses them and returns the response (preferbly ajax calls)
10:31 uma any ides as how to kickstart
10:32 bpmedley wikihead: Do you mean automation using something like Minion?
10:34 wikihead joined #mojo
10:35 wikihead similar to minion, however it is blocking requests. Application takes the input, processes it in the background and returns the enriched response
10:36 bpmedley wikihead: https://github.com/brianmed/patches  <— Maybe somethink like this?
10:39 amon joined #mojo
10:40 wikihead yup pathes looks be helpful example
10:41 wikihead do you recommend me to learn jquery/bootstrap?
10:42 bpmedley wikihead: Yes, they’re used quite a bit in web development.
10:44 Oleg bpmedley: why you stopped mojo_book project?
10:45 bpmedley I need to return to that.  I’ve moved around some, and I think where I’m at I’m stable.  However, I’m not doing much perl at $work.
10:46 Oleg i see
10:48 wikihead yea, mojo_book will be very helpful, i am checking the same
10:50 bpmedley I’ll return to it soon.  Thanks for the kudos.
10:57 uma joined #mojo
11:22 wikihead he need some idea in designing
11:22 wikihead I have the fully made commandline application based on perl
11:23 wikihead C:\MyApp\conf, \lib, \bin, MyApp.pl
11:23 wikihead when i invoke MyApp.pl, It opens a console on which i give command and it gives me the results
11:23 wikihead its a while(1) console
11:24 wikihead Now i have created another folder \web when Mojo App is residing with C:\MyApp\Web\scripts, \lib, \t
11:25 wikihead i use >morbo scripts\MyAppWeb to invoke the server
11:26 wikihead Now my concern here is how to combine the functionality of web app with my console app
11:26 wikihead Any ideas if i make sense?
11:28 wikihead Had i not have the console app, I should be recoding all of it under C:\MyApp\Web\lib\MyAppWeb\Controller\XYZ.pm
11:29 wikihead It like mapping my existing code C:\MyApp\lib\XYZ.pl -> C:\MyApp\Web\lib\MyAppWeb\Controller\XYZ.pm
11:30 wikihead As i am talking here, i am thinking if It is possible for C:\MyApp\Web\lib\MyAppWeb\Controller\XYZ.pm talk to C:\MyApp\lib\XYZ.pl and get the result and pass to render?
11:38 Oleg wikihead: I would made /lib/MyApp /lib/MyApp/Web /bin/myapp-cli /bin/myapp-web
11:42 Oleg this is how one of my project looks like https://gist.github.com/olegwtf/3fba6146211fa747decb
11:45 Snelius very good idea :)
11:46 Oleg Snelius: go and continue your vacation :D
11:49 wikihead it means you would invoke the web app as morbo /bin/myapp-web
11:50 Oleg yes
11:51 wikihead all my code in \lib are under package MyApp;
11:51 Oleg Web part will be MyApp::Web
11:52 wikihead if i have too speak to that library, how should i write in MyAppWeb\Controller\XYZ.pm?
11:53 deserted hey all, so Mojo::URL is determined to make me break stuff tonight, can someone point out what I'm doing wrong here http://paste.scsys.co.uk/469965
11:53 Oleg i like this variant: MyApp/Web/Controller/XYZ.pm
11:54 Oleg deserted: show an example for us
11:54 deserted gah nvm
11:54 deserted sorted, but I did have a paste link there lol
11:55 deserted was trying to call url->host on a URL object, not a base object
11:55 deserted url->base->host is working
11:55 deserted clearly time for sleep methinks
12:03 neilhwatson joined #mojo
12:13 wikihead hey, link is not working
12:14 wikihead It is saying Whoops
12:19 wikihead @oleg, link not working
12:20 shadowpaste "wikihead" at 217.168.150.38 pasted "testing nopaste" (1 line) at http://paste.scsys.co.uk/469966
12:23 wikihead @Oleg, you mean XYZ.pm use package MyApp::Web; use lib 'C:\MyApp\lib'; use 'MyApp'; call_from_mypplib();
12:24 wikihead files in C:\MyApp\lib are configured under package MyApp;
12:24 jb360 joined #mojo
12:27 Oleg wikihead: https://paste.kde.org/pwtwkr7jf
12:29 wikihead Thanks
12:30 wikihead Is it possible to share the code with me ? that would be helpful in understand Mojocode, Hmtl, ep etc
12:30 Oleg don't think so, this is private project at $work
12:31 wikihead Oh
12:31 wikihead Ok, NP
12:31 wikihead do you have anythink in your mind that is similar to this that is public?
12:32 wikihead any others repos?
12:33 Oleg I didn't see such repos :)
12:36 wikihead cool
12:36 wikihead thanks Oleg, you are very helpful :)
12:37 jberger alexbyk (if you are reading the log): https://gist.github.com/jberger/0ae0f52894ea4d6c44af
12:37 jberger but I disagree that that is useful
12:38 jberger that kind of object doesn't do something on an exception, it does something on a trapped exception, at which point you should be dealing with it there
12:38 jberger as nicomen was saying yesterday, there is absolutely no way to expect that surrounding code is polite about $@ once you get to CPAN
12:39 Oleg jberger: may be just $@ = undef
12:39 jberger Oleg: sure, however you want to do it
12:40 jberger but its still not a useful module, and I absolutely expected the result that alexbyk thought was a bug would happen
12:40 Oleg I agree that this example is strange and I didn't expect it will work
12:41 jberger rather than using the guard object, alexbyk should himself be using Try::Tiny
12:41 jberger anyway, like it or not, $@ is a global and people don't regularly localize it, or clean it up after use
12:42 jberger its a wart in perl true, but it is what it is
12:42 Oleg i agree
12:42 jberger and I think for my vote I'm -1 on changing Mojo::Base::attr's logic if $@ is the reason
12:43 ribasushi I haven't followed all of this
12:43 jberger I'm still trying to weigh the balance of a slight performance gain (still dubious) vs the debuggablility of string evaling the accessor method
12:43 ribasushi but are you basically trying to figure out "did I get out of scope due to a die() stack unwind, or did I just pass out of scope as part of execution" ?
12:43 jberger ribasushi: I'm not trying to do any of that
12:43 ribasushi because if that - I have a ton of prior art to point you at ;)
12:44 nicomen ribasushi: alexbyk wants Mojo::Base to play nice with $@ (the exceptionally nice version), so that he can use Mojo::Base code after getting an exception, but before he has handled it
12:44 jberger alexbyk is trying to do stuff, and I think his example is not the "real world" case he thinks it is
12:44 nicomen jberger: do you have an example of how doing it "nice" affects the stacktrace/introspection?
12:47 jberger wasn't that the other reason for his *attr = sub { ... } branch, rather than evaling it into the namespace?
12:47 jberger maybe I misunderstood
12:49 jberger anyway, alexbyk's benchmarking showed that there was a performance gain in not string eval'ing the accessors
12:50 jberger yet if that's the case, why do things like Sub::Quote exist? I thought they were for performance of runtime generated code
12:51 cpan_mojo Mojo-SMTP-Client 0.05 by Oleg G - http://metacpan.org/release/OLEG/Mojo-SMTP-Client-0.05
12:54 irq joined #mojo
12:58 uma joined #mojo
13:01 ribasushi jberger: depends largely on how the benchmark was written
13:02 jberger https://github.com/alexbyk/perl-bench-oo
13:02 jberger note that I have no opinion on the included code, and am not advocating for it, this is purely discussion purposes
13:04 ribasushi jberger: reading still...
13:04 marmez left #mojo
13:08 melo joined #mojo
13:16 ribasushi sorry distracted, will read/verify in another 10~20
13:17 Kripton joined #mojo
13:33 Lee i don't believe those benchmarks. i would expect Mouse to be at least an order of magnitude quicker than Moo
13:33 Lee otherwise why bother with Mouse?
13:33 zivester joined #mojo
13:33 Lee i suspect there's a "bottleneck" somewhere in the benchmarking code
13:34 uma joined #mojo
13:44 wikihead Hi, Can you please review where i am wrong at packages
13:44 wikihead http://paste.scsys.co.uk/469970
13:46 jberger wikihead: all of the contents of lib need to be in a folder called AutoAnalyst
13:47 wikihead oh
13:47 jberger lib/AutoAnalyst/Analyst.pm --> AutoAnalyst::Analyst
13:48 jberger that's not strictly required, but until you really understand namespacing, just trust that that works
13:50 uma joined #mojo
13:50 cpan_mojo Mojolicious-Plugin-Qooxdoo 0.902 by Tobias Oetiker - http://metacpan.org/release/OETIKER/Mojolicious-Plugin-Qooxdoo-0.902
13:52 marty joined #mojo
13:56 wikihead joined #mojo
14:20 mattastrophe joined #mojo
14:27 juikuen joined #mojo
14:40 asarch joined #mojo
14:43 Ptolemarch joined #mojo
14:49 mgrimes joined #mojo
14:57 uma joined #mojo
15:06 woz joined #mojo
15:06 uma joined #mojo
15:09 woz Hi guys, any ideas why this doesn't work anymore
15:09 Adurah Seems like it's working fine to me.
15:09 jabberwok "it" depends on what the definition of "it" is ?
15:10 woz if (grep{$_->name() eq 'mycookie'} $ua->cookie_jar->all) {.....
15:10 woz I get can;t call method 'name' on unblessed reference
15:10 woz Since upgrading to Mojo 6.04
15:11 jberger woz: I'd have to check, but are you sure you don't need to @{ } the return from ->all
15:11 woz Possibly, although this worked before
15:12 jberger https://github.com/kraih/mojo/commit/4e934d0fa3cd24c100414f8810a70738b00bcb57
15:12 jberger changed
15:12 woz Yup, that fixed it :-)
15:12 woz You're my hero Joel
15:13 jberger right in the changelog :-P
15:13 woz I did try and look through the change logs!!
15:13 jberger eh, I just went to github blame, seemed faster
15:16 alexbyk joined #mojo
15:16 woz I'll check blame next time :-)
15:16 wikihead joined #mojo
15:17 jberger probably sufficient to read the .0 release changes
15:17 jberger those are the only ones that come without a deprecation cycle
15:18 tianon joined #mojo
15:20 vmb joined #mojo
15:27 mattastrophe joined #mojo
15:31 alexbyk joined #mojo
15:34 uma joined #mojo
15:35 irq joined #mojo
15:39 mattastrophe joined #mojo
15:40 wikihead joined #mojo
15:52 uma joined #mojo
16:07 Ptolemarch joined #mojo
16:08 eseyman joined #mojo
16:09 OmarOthman Hi
16:09 OmarOthman I have a quick question: Is there a recommended way of passing data from a step to another in Mojo::IOLoop::Delay->steps()?
16:09 OmarOthman Or it is usually just depending on variables in the scope that encapsulates the call?
16:12 batman OmarOthman: you can use $delay->data(foo => 123);
16:13 OmarOthman batman: OK, thank you. I'm sorry for missing that, I read it before then forgot it.
16:13 batman no problem. i tend to use variables defined in the outer scope, but private to the current delay
16:13 batman but it's up to you
16:17 Anon021 joined #mojo
16:28 jb360 joined #mojo
16:29 csson joined #mojo
16:32 Oleg joined #mojo
16:37 kwa joined #mojo
16:38 jberger OmarOthman: also ->pass depending on if you want the values to show up as arguments or stored in the delay (data)
16:38 wikihead joined #mojo
16:39 sh4 joined #mojo
16:42 Ptolemarch joined #mojo
16:43 OmarOthman jberger: Thank you, I think I'll go with the first solution, since persisting the data from Step(N) to Step(N + x), x > 1, is useful for me.
16:43 jberger yeahh
16:44 jberger pass is more like "I don't actually need to make this async call this time, so pass undef to the next step as a placeholder"
16:44 jberger data is for what you just said
16:44 uma joined #mojo
16:46 OmarOthman Exactly. That's my initial trial to do the "semaphore" behavior I asked you guys about to synchronize Mojo::IOLoop::Delay objects. Something like:
16:46 OmarOthman $semaphore{$id} or shift->pass;
16:48 uma_mahesh joined #mojo
16:52 sri no new benchmarks, so i'm going to assume everyone is happy with the new Mojo::Pg :)
16:52 niczero joined #mojo
17:05 mattastrophe joined #mojo
17:05 tempire I'M HAPPY ZOMG
17:05 tempire !!!!!!!!!!!!!!!!!!!
17:06 tempire \\o//
17:07 genio ????
17:09 dod joined #mojo
17:10 * jberger tranqs tempire with a dart gun
17:10 tempire https://www.youtube.com/watch?v=C9FFfuqMWnw
17:11 sri jberger right now http://i.imgur.com/bFxtWMs.gif
17:17 jberger oh, I have to point the gun at him?! welllll t h a  t wouuuuuld  make mo r  e se n    s e
17:18 uma joined #mojo
17:20 dod joined #mojo
17:28 dod joined #mojo
17:34 wikihead joined #mojo
17:35 Onigiri joined #mojo
17:39 juikuen joined #mojo
17:44 dod joined #mojo
17:52 dod joined #mojo
18:00 uma joined #mojo
18:12 punter joined #mojo
18:13 jabberwok Is there a recommended way to write a multi-tenant Mojo program? At the very least I'd like to give Mojolicious::Static a different webroot path for various per-request-domains.
18:14 jabberwok I think i can handle most of the rest by examining the requests inside the (fixed across domains) route handlers.
18:16 sri http://mojolicio.us/perldoc/Mojolicious/Plugin/Mount
18:17 jabberwok Ah!
18:17 jabberwok =bow=
18:19 sri and for details http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Embedding-applications
18:20 jabberwok thank you.  there are quite a few puzzle-pieces that all fit together.
18:21 ribasushi (unrelated) so it looks more likely I will make ::NA
18:21 ribasushi which means I should try to make a stop at your humble gathering as well ;)
18:21 ribasushi idly wondering if there is something dbic-ey people want to hear about?
18:22 sri \o/
18:22 jberger :o
18:22 jberger ribasushi++
18:23 jberger translated for the common (wo)man: does anyone have an interest in a model-layer talk at mojoconf?
18:23 purl babelfish cannot translate from en to en.  Try translating through English.
18:24 ribasushi jberger: yes, this (concentrated on the particular model that is DBIx::Class)
18:24 jberger ribasushi is the current lead developer of DBIx::Class
18:24 ribasushi introductory talks for this are "done to death" in the wider community, but I don't really know how it is among mojo-folk
18:24 wikihead joined #mojo
18:25 jberger to be honest, an introductory talk wouldn't probably be beneath us, though if it could have some eye towards non-blocking (is that even possible?) people would probably be in awe
18:26 jberger the mojo community has had very little chatter about model layer stuff
18:26 jberger the loss of Mango didn't help things
18:26 tianon joined #mojo
18:26 jabberwok Models? can i sit next to the runway?  oh, wait
18:27 ribasushi jabberwok: I can do a talk on that, but you may get more than you bargained for >.>
18:29 irq joined #mojo
18:31 uma_mahesh joined #mojo
18:32 sri just be prepared for the inevitable "can it do non-blocking" question :)
18:32 jberger inevitable?! I already asked :-P
18:32 sri you know someone is gonna ask again ;p
18:33 marcus https://www.youtube.com/watch?v=JLjyvzMCQaY sri vs ribasushi
18:37 Eke- joined #mojo
18:41 ribasushi naturally ;)
18:42 uma joined #mojo
18:42 mst I'm so disappointed the mst vs. ribasushi at Madison didn't come out well on the video
18:43 ribasushi ditto
18:48 jberger and I'm disappointed that I didn't know you guys better then
18:48 jberger I was there
18:48 Eke- joined #mojo
18:50 wikihead joined #mojo
18:51 juikuen A newbie question. Should i use system perl, or should i go some other way for production? And what is good/best practice, to go "Mojolicious way" in production? Please:)
18:52 hernan604 if im system i would definately use system perl
18:52 jberger I think most of us here would say not to use the system perl
18:52 hernan604 but as im not, i usually use perlbrew or local lib
18:52 mst juikuen: system perl + local::lib works if system perl is new enough for you
18:52 mst juikuen: perl-build from http://p3rl.org/Perl::Build + local::lib is a sane option if not
18:53 mst juikuen: perlbrew is nice for managing multiple perls for development but doesn't make any sense for production
18:53 jberger mst: the biggest thing that keeps me using perlbrew is that it does the local::lib-ing for me
18:54 jberger which I know isn't hard
18:54 jberger but still
18:54 mst which, as I say, is totally sane for development
18:54 mst for deployment I prefer to be explicit
18:54 jberger true
18:54 * jberger wished for a dev-ops person
18:56 juikuen thanks
19:00 marcus i prefer plenv/perl-build these days .
19:16 disputin joined #mojo
19:20 * sri tries to keep dev and production environments as similar as possible, and just uses perlbrew
19:21 sri (if i have the choice)
19:21 Eke- joined #mojo
19:22 sri travis ci is perlbrew too
19:24 marcus I feel like plenv has less magic and is more robust.
19:27 sri as long as it doesn't have rvm levels of magic i'm not too concerned
19:35 fhelmber_ joined #mojo
19:36 sri batman: seen your discussion about forcing RaiseError in Mojo::mysql, been thinking about doing the same in Mojo::Pg actually :)
19:38 sri both, RaiseError and AutoCommit are pretty much assumed by all the code
19:40 berov joined #mojo
19:44 sri it's all not very clear atm., migrations force both, listen/unlisten force autocommit, and non-blocking queries disable raiseerror to catch and pass them along to the callback
19:44 Ptolemarch joined #mojo
19:45 mst I think forcing it on, except in the places you're intentionally turning it off, is a pretty good choice
19:45 sri maybe those "local $dbh->{...}" calls should just all get removed and a warning added that stuff will go wrong if you change the defaults
19:46 sri RaiseError and AutoCommit are just that essential to the whole distribution
19:48 sri especially listen/unlisten depend on autocommit
19:49 sri we need to keep track of chat channels we are still subscribed to
19:49 sri s/chat/what/
19:50 uma joined #mojo
19:51 uma hi, is it mandatory to define package MyApp::Controller::ControllerName in Controller.pm
19:51 sri batman: anyway, if you come up with a consistent solution i'm interested :)
19:52 batman sri: TURN IT ON!
19:52 batman Hehe
19:52 mst uma: life will become complicated if you don't do it that way.
19:52 mst uma: lib/X/Y/Z.pm should pretty much always start 'package X::Y::Z;'
19:52 sri batman: sure, the question is just make the global setting mandatory, or have it localized everywhere
19:52 sri ?
19:52 batman I really dislike $obj->{err} in 99% of the cases
19:53 sri i'm all for RaiseError/Autocommit = 1 everywhere
19:53 sri but where to set it?
19:53 batman Global setting mandatory. So they have to do $db->dbh->... to turn it off
19:54 batman I like the idea that people an do crazy stuff. I just don't want it to be easy.
19:54 sri lets do this
19:54 sri http://www.mainlinetheatre.ca/fr/sites/default/files/imagecache/325w/laright-lets-do-this.jpg
19:55 batman sri: I also don't want to keep remembering where to localize.
19:55 batman So if they want to shoot themself in the foot... Please go ahead :)
19:56 sri "Not that C<AutoCommit> and C<RaiseError> are considered mandatory, and deactivating them can have..."
19:56 sri end the sentence!
19:57 batman I got this crazy coworker who loves checking {err} everywhere.
19:57 sri ...terrible consequences
19:57 batman I don't like him.
19:57 Ptolemarch joined #mojo
19:57 sri s/Not/Note/
19:57 batman sri: +1
19:57 purl 1
19:57 uma I had a good chuck of perl code under package MyApp
19:57 uma the code that i have accumulated over last 2 years
19:57 uma when i started coding, i dont know perl
19:58 sri ...attract the wrath of the old gods
19:58 mst sri: 'deactivating them is foolish, dangerous and entirely unsupported'
19:58 mst though I like 'attract the wrath of the elder gods'
19:58 uma so my code doesnt have perl modules, but all code is under one package, under different files
19:59 batman mst: Yeah. "Unsupported" is good.
19:59 batman I like it.
19:59 sri +1 for elder gods
19:59 uma any part of the library can access any function as they are all under one package and are require'ed
19:59 batman Haha
19:59 sri cthulhu fhtagn!
20:00 mst deactivating them may result in bugs, loss of SAN points, and death
20:00 uma now if i wanted to create a web interface and yet i would like to call those functions to get the data and render, i am not getting a way to access those functions as Controller has different namespace as my previous code
20:01 mst OldNamespace::subroutine_name($args, $go, $here)
20:01 batman Keep away from RaiseError or error will raise. :P
20:02 batman Something else... I thought Postgres supported nested transactions..?
20:02 mst it supports savepoints, which are not quite the same thing
20:03 batman Ok. I better Google that...
20:03 uma Use of inherited AUTOLOAD for non-method AutoAnalyst::sum() is deprecated at C:/AutoAnalyst/web/lib/
20:03 uma AutoAnalyst/Controller/PatternManager.pm line 11.
20:04 batman Can someone help me out here? https://github.com/mojoconf/MCT/pull/42#discussion_r26788227
20:05 uma mst: thats the error
20:05 batman I wonder if there's a way I can make sure the charge is stored in nth systems.
20:05 batman *both
20:05 mst uma: uh, that's nothing to do with Mojo
20:05 * sri is sadly not familiar with stripe
20:06 batman Maybe I should just fetch the payment information later on if the db failed...
20:06 uma any idea why is that error came?
20:06 mst uma: why does AutoAnalyst even *have* an AUTOLOAD
20:06 mst uma: wait
20:06 mst uma: did you try and jam your Mojo app into the same namespace as the old code?
20:06 uma yes
20:06 mst uma: well, that was a very silly idea
20:06 uma lol
20:07 uma all my old code has package AutoAnalyst and all are .pl files
20:07 mst ...
20:07 uma i created new app under \web directory of my old repo
20:08 mst you will need a new package name.
20:08 mst call it AutoAnalystNG or something
20:08 mst and then in your controller code you can do AutoAnalyst::subroutine_name(...);
20:08 mst to call the old stuff
20:08 mst until you have time to kill it with fire
20:11 batman sri: Could you comment on Mojo::mysql, about the RaiseError change?
20:14 sri batman: https://github.com/kraih/mojo-pg/commit/fe4c3ae84015bf0ed87cc2fd2de6b43d9a2607bd
20:15 batman sri: Cool. Good enough for me :)
20:16 mst uma: ^^
20:18 uma yea trying with new package name
20:18 sri eeep, that reminds me of what crab said yesterday... that pg_notifies only throws exceptions with RaiseError
20:19 sri so, notifications wouldn't have worked properly before
20:19 sri (if you had set RaiseError=0)
20:19 * sri nods
20:19 sri making it mandatory makes a lot of headaches go away
20:20 wikihead joined #mojo
20:21 sri mst: btw. i've actually tried to contact GSM, to settle the pg_server_prepare thing once and for all, not heard back yet though
20:21 mst sri: crab and I have been chatting about it and he's chasing GSM up
20:22 marmez joined #mojo
20:22 mst my current understanding is "you and I were both slightly wrong, I give up, let's wait for the experts to weigh in"
20:24 coolo batman: FYI, the url filter works great
20:25 wikihead yippe, working :)
20:26 wikihead thank mst
20:26 wikihead this is uma (my other chatname)
20:26 sri don't care at all who was wrong, but i hope pg_server_prepare=1 ends up being better, because that would make postgres a bit cooler
20:27 sri so fingers crossed
20:28 coolo batman: https://github.com/os-autoinst/openQA/pull/283
20:31 sri oi! this one hurt https://github.com/os-autoinst/openQA/blob/master/lib/OpenQA.pm#L76
20:31 sri but it's true... they should have at least given json support for comments
20:32 batman coolo: sure. i use it myself ;)
20:32 batman hehe... i'm glad it worked out for you!
20:34 sri if you can go all perl, Mojolicious::Plugin::Config is not so bad though
20:34 batman perl++
20:34 batman ;)
20:36 sri batman: btw. just in case you missed it, take a look at the sth cache in Mojo::Pg
20:37 sri even without prepared statements it's a performance gain in all my tests
20:37 sri smarter than the one we had in the beginning
20:38 wikihead mst: do you have any code repos of yours, i would like to review them for learning
20:39 dotandimet joined #mojo
20:40 disputin joined #mojo
20:51 disputin joined #mojo
20:57 jb360 joined #mojo
21:00 Eke- joined #mojo
21:16 dod joined #mojo
21:19 jberger sri: isn't Mojolicious::Plugin::JSONConfig treated as a template?
21:19 jberger if so, can't you "comment" it with %# ?
21:19 mst somebody should write ::JSONYConfig
21:19 sri jberger: good point
21:19 purl nice and sharp
21:19 mst then they could use #
21:20 marcus I'd like to see a python JSONy - so I could use it with ansible.
21:21 punter joined #mojo
21:21 punter Am I correct in saying that when a web app is running in Mojolicious blocking mode, then there's no reason to use Minion at all ever?
21:22 punter because instead of launching 10 minions, I can just run run 10 extra processes of Hypnotoad
21:22 mst wat
21:22 marcus wat indeed
21:22 punter no, eh?
21:23 punter oka
21:23 punter y
21:23 good_news_everyon joined #mojo
21:23 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/h2em
21:23 good_news_everyon mojo/master fcba84b Sebastian Riedel: test comments in json config files
21:23 good_news_everyon left #mojo
21:23 tianon joined #mojo
21:23 sri jberger: totally works
21:23 punter I mean: Minion is used to run a long-running task. But if I'm running Mojolicious in blocking mode, then I can run this task inside the same Hypnotoad worker
21:23 jberger punter: Minion isn't intended to serve web pages
21:23 jberger sri++
21:24 mst punter: but the hypnotoad worker should send a response to the client
21:24 sri coolo: ^^
21:24 mst while minion handles the task in the background
21:24 punter mst, I see, you're right!
21:24 punter thanks!
21:24 mst which document lists the breaking changes for 6.0?
21:25 sri Changes
21:25 sri and i usually open a thread on google groups where people post stuff they encounter, it was very silent this time though
21:26 mst hrm, that says what will break but not what you're supposed to replace things with (barring the renames)
21:33 dod joined #mojo
21:35 good_news_everyon joined #mojo
21:35 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/h2UZ
21:35 good_news_everyon mojo/master 83e73b0 Sebastian Riedel: more complete examples for config files
21:35 good_news_everyon left #mojo
21:36 dod joined #mojo
21:36 fhelmber_ joined #mojo
21:37 good_news_everyon joined #mojo
21:37 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/h2U9
21:37 good_news_everyon mojo/master 8ca2b0b Sebastian Riedel: the value is not actually random
21:37 good_news_everyon left #mojo
21:37 sri jberger: better?
21:37 dod joined #mojo
21:38 jberger sri: yeah, I like that
21:38 jberger coolo: ^^
21:38 sri not sure i like the blank lines http://mojolicio.us/perldoc/Mojolicious/Plugin/JSONConfig#SYNOPSIS
21:38 jberger looks fine to me
21:39 jberger comments are about reability, as as blank lines
21:39 jberger readability
21:39 purl readability is a threat to job security
21:39 * jberger pushes purl down the stair
21:39 jberger s
21:39 jberger feck
21:39 * mst hugs purl
21:39 purl mst: get off me, you botvert!
21:39 sri botsnack
21:39 purl thanks sri :)
21:44 ZoffixWork joined #mojo
21:45 ZoffixWork I think I found a bug (or lack of feature). This selector doesn't work for Mojo::DOM: perl -MMojo::DOM -MMojo::UserAgent -wle 'print Mojo::DOM->new( Mojo::UserAgent->new->get("http://example.com")->res->body )->at(q|a[href^="http"]:not([href~="example.com"])|)'
21:45 ZoffixWork Should I report it somewhere?
21:46 nicomen make a small text case first?
21:48 ZoffixWork nicomen, like what? (I'm unsure what else to make, other than the above one liner).
21:48 nicomen right now a) we can't see what eaxample.com returns, nor what you expect the selector to return
21:48 ZoffixWork Ah
21:48 ZoffixWork Sure, I can make that
21:48 tianon joined #mojo
21:48 ZoffixWork And actually if you put :not() portion first, then it works. Gonna submit an Issue on GitHub.
21:49 nicomen did you try any other css3 selector implementations?
21:49 ZoffixWork Yes, I checked in Firefox and the target element did get selected.
21:49 nicomen ok
21:49 woz joined #mojo
21:50 mst sri: looking at minion, I can't see how to say "die instead of migrating", and I tend to prefer having DDL operations handled by an orchestration script rather than 'whichever worker restarts first'
21:51 sri mst: unsupported so far
21:52 sri ZoffixWork: these are the supported selectors http://mojolicio.us/perldoc/Mojo/DOM/CSS#SELECTORS
21:52 mst I mean, if the minion user doesn't have DDL privs, it's going to die anyway
21:52 mst but it would seem nice to be able to die with a more semantic error
21:52 sri you can prevent the migration though, with app->minion->pg->unsubscribe('connect')
21:53 ZoffixWork Yes, I checked. Both are listed, and the combination works if you put :not() first.
21:53 sri but i've not put much thought into different deployment strategies yet
21:54 sri ZoffixWork: oh, i misread.... q|a looked like a namespace selector
21:55 sri unfortunate quoting choice for a selector ;p
21:55 marcus mst: I agree that being able to check if there's a migration and triggering it manually would be nice.
21:56 sri mst, marcus: proposals welcome
21:57 marcus I'm not sure startup is the right time tho, you probably want to check after upgrading then either just restart to migrate or handle it gracefully? (depending on your needs?)
21:57 riche joined #mojo
21:57 mst I'm fine with auto migrate on restart as a default, I'd just like something like
21:58 mst app->minion->migrations->verify_only(1);
21:58 mst or similar
21:58 mst I think that'd be sufficient
21:59 sri that would be a Mojo::Pg feature
21:59 mst yeah, and then nobody else has to reinvent it ever again
21:59 mst this doesn't seem like a disadvantage :)
21:59 sri app->minion->backend->pg->migrations->verify_only(1) actually -.-
22:00 marcus does other migration frameworks have this?
22:00 mst certainly the migrations seems like a neat place to put it, since it knows how to verify
22:00 marcus I guess they don't auto migrate, mostly
22:00 sri yea, they are mostly tied into a build system like rake
22:01 sri restart of a worker cluster is an interesting problem even then though
22:02 mst down, migrate, up is what I'd do
22:02 marcus I've been scheduling a tiny downtime for db migrations
22:02 mst on the assumption minion jobs can be delayed long enough to do that
22:02 marcus minimizing it with automation
22:03 marcus you will probably want to migrate the db for your web app at the same time as minion :)
22:03 sri you could do the app->minion->backend->pg->unsibscribe('connect') thing in your apps and migrate from a cerntal node manually with "./script/myapp eval 'app->minion->backend->pg->migrations->migrate'"
22:03 ZoffixWork Done: https://github.com/kraih/mojo/issues/765
22:04 mst sri: yeah, I'd just like to still get an 'is this the version I was expecting' check
22:04 sri building blocks are there, just need to formalize it
22:04 marcus of course, if you are crazy you can do https://blog.rainforestqa.com/2014-06-27-zero-downtime-database-migrations/
22:04 sri mst: that's the tricky bit
22:05 mst that's why I'm thinking it could be a feature of the migrations
22:05 sri and if other migration systems have a version check is a good question
22:08 marcus sequel does http://sequel.jeremyevans.net/rdoc/files/doc/migration_rdoc.html#label-Checking+for+Current+Migrations
22:09 sri ZoffixWork++ # good bug report
22:09 ZoffixWork \o/
22:09 sri not sure when i get around to looking into it though
22:09 mst sri: DBIx::Class::Schema::Versioned has ->get_db_version but no ->assert_version_current
22:10 sri Mojo::Pg::Migrations has ->active
22:11 sri although it's greedy, and will try to create the migrations table
22:12 mst I think I'd want a verify_only like flag to stop it doing that too
22:14 marcus mst: what does it matter if you don't even have any migrations applied?
22:14 sri i think auto migrations will be a common pattern with Mojo::Pg, so a verify_only attribute that makes ->migrate only verify the current version might be a good idea
22:14 marcus sri: why not just a ->verify method as an alternative?
22:14 mst marcus: because I want a 'no migrations table' exception, not an error from CREATE TABLE not having permissions
22:15 marcus mst: fair point.
22:15 marcus a verify method could handle that tho.
22:16 mst sure, but then every app needs to take a flag itself to decide between calling migrate and calling verify
22:16 sri but you'd have to disable auto migrations yourself then
22:16 mst right, or it becomes manual
22:19 marcus with the verify_only attribute every app would have to support setting that? guess that's easier tho. don't need to modify code.
22:20 sri i'd expect the Mojo::Pg to be accessible through some attribute
22:20 sri *object
22:21 sri of course i'm a sucker for the delegation pattern
22:30 sri Zoffix: oh, think i know what's wrong actually
22:31 sri the pseudo class is behind the attribute selector and the tokenizer didn't know that's valid too
22:31 sri wonder what the spec says
22:32 * batman <3 migrations
22:32 batman g'night
22:32 sri yea, looks like they are valid anywhere
22:46 cpan_mojo Mojolicious-Command-generate-lexicont 0.04 by DOKECHIN - http://metacpan.org/release/DOKECHIN/Mojolicious-Command-generate-lexicont-0.04
23:04 good_news_everyon joined #mojo
23:04 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/h2wu
23:04 good_news_everyon mojo/master 298ee90 Sebastian Riedel: fix bug in Mojo::DOM::CSS where pseudo-classes following attribute...
23:04 good_news_everyon left #mojo
23:07 good_news_everyon joined #mojo
23:07 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/h2r6
23:07 good_news_everyon mojo/master 55ba812 Sebastian Riedel: fix typo in comment
23:07 good_news_everyon left #mojo
23:32 marmez joined #mojo
23:41 vmbrasseur joined #mojo
23:50 juikuen_ joined #mojo

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