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

IRC log for #mojo, 2014-11-06

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

All times shown according to UTC.

Time Nick Message
00:04 sri i've added a t-shirts ribbon to the frontpage... once there's more stuff to advertise like books *hint hint* we should find a more permanent place for promotions
00:05 sri like a box next to the description... with images of book covers and a t-shirt or so
00:31 Averna joined #mojo
00:34 neyasov joined #mojo
00:40 jberger hoppie, hernan604, others: thanks
00:41 jberger sri: what was the issue with fork?
00:42 sri crash of the forked process on os x
00:43 jberger and what was the resolution?
00:43 sri https://github.com/olegwtf/p5-Net-DNS-Native/commits/master
00:46 jberger cool
00:47 jberger vote recorded
00:47 sri \o/
00:48 jberger and this speeds up hoppie's tests then too I assume?
01:01 laouji joined #mojo
01:14 Kripton_ joined #mojo
01:30 bowtie joined #mojo
01:34 neyasov joined #mojo
01:42 woz joined #mojo
02:06 bowtie_ joined #mojo
02:13 hasan joined #mojo
02:13 hasan hi
02:13 bpmedley Morning
02:13 hasan can anybody tell me if it is possible to make the calls to my psql db non blocking?
02:13 hasan or the whole request non blocking?
02:13 hasan http://nopaste.info/c9c52b6bcf.html
02:14 bpmedley https://metacpan.org/pod/Mojo::Pg may help
02:14 hasan bpmedley: yeah I like to stay with dbix
02:14 hasan dbic
02:15 sri then it's not possible as far as i know
02:27 KCL joined #mojo
02:28 bpmedley_ joined #mojo
02:32 hasan ok I think I will work with Mojolicious::Plugin::PgAsync
02:34 sri what made you choose that plugin?
02:38 hasan it is like DBD::Pg but is non-blocking
02:39 hasan do you ask why I don't use Mojo::Pg?
02:39 sri yes
02:39 hasan it's the syntax
02:40 hasan e.g. $db->query('select * from names')->hashes is different from fetchall_hashref
02:40 hasan of DBD::Pg
02:40 sri i see
02:41 hasan $db->query('insert into names values (?)', 'Sara'); <- is the equivalent of prepare() and execute( $foo ) in DBD::Pg I guess.
02:41 hasan this would mean I would have to learn new directives.
02:42 hasan oh and the big "oh :(" was the "Note that this whole distribution is EXPERIMENTAL and will change without warning!" line in your docs.
03:17 doublelel joined #mojo
03:25 neyasov joined #mojo
03:31 woz joined #mojo
03:40 tempire This community needs to embrace carton more.
03:41 tempire Maybe it needs a blog entry
03:41 tempire Though carton really needs support for non-cpan libs
03:45 doublelel joined #mojo
03:54 Zx3 joined #mojo
04:13 doublelel joined #mojo
04:16 jberger tempire: Alien!
04:35 franzkafka joined #mojo
04:45 basic6 joined #mojo
04:54 doublelel joined #mojo
04:57 irq joined #mojo
04:58 tempire alien?
05:00 jberger Alien modules which provide those non-cpan deps
05:00 jberger oh, wait, you meant non-cpan but still perl I guess, right
05:01 tempire yes
05:02 jberger nevermind then
05:03 jberger either a mini-cpan+Carton or else Pinto then
05:14 neyasov joined #mojo
05:20 woz joined #mojo
05:34 guacamole joined #mojo
05:35 preaction we're using orepan, haven't asked calid about the status of that. have to convince him to give a talk on what he's learned
05:36 preaction i know Carton doesn't have the nice "choose a mirror to use" inside, like Bundler does (and I think setup.py does too)
05:36 preaction it'd be nice if carton supported everything cpanm did, like git repos or plan tarballs
05:44 sri ooh, the first few orders shipped
05:50 sri too bad i can't actually see what people ordered
05:54 laouji joined #mojo
05:54 dabudabu that's weird
05:55 dabudabu you'd think they could have figured out that people might want to know what's selling
05:56 sri oh wait... there's hidden stats
05:57 sri haha, one tie dye limited edition!
05:58 sri whoever you are, you rock!
06:00 sri normal cloud and raptor shirts sell most
06:05 sri (not many orders though... so all shirts are pretty rare still)
06:13 pfc joined #mojo
06:17 dotandimet joined #mojo
06:18 rem_lex|pivo joined #mojo
06:39 Snelius joined #mojo
06:49 dotandimet OMG, while I was checking out T shirts you killed off pluck()? pluck was my favorite!
06:53 dotandimet how do I enable deprecation warnings, and how is BINGOS getting them?
06:57 marmez joined #mojo
06:59 dotandimet There's MOJO_FATAL_DEPRECATIONS, but I'm not getting the deprecation warnings BINGOS is http://www.cpantesters.org/cpan/report/c469cf82-64ee-11e4-9dc2-bfba930e45bb
07:02 neyasov joined #mojo
07:02 dotandimet maybe my perl is using an old version of Mojolicous?
07:03 Snelius maybe
07:05 ashimema__ joined #mojo
07:05 ashimema_ joined #mojo
07:07 dotandimet no it isn't :(
07:09 woz joined #mojo
07:11 dotandimet Oh, I was just running make test, I should have been running the script with the failing test.
07:11 dotandimet Or prove -l t/*.t
07:13 Vandal joined #mojo
07:15 Lee joined #mojo
07:21 dod joined #mojo
07:35 amon joined #mojo
07:45 dotandimet joined #mojo
07:46 basiliscos joined #mojo
07:53 dotandimet joined #mojo
08:09 irq joined #mojo
08:18 woz joined #mojo
08:20 KCL_ joined #mojo
08:22 stryx` joined #mojo
08:23 allison joined #mojo
08:24 jnbek joined #mojo
08:33 neyasov joined #mojo
08:49 Eke- joined #mojo
08:51 bowtie joined #mojo
09:45 denis_boyun joined #mojo
09:54 Shaeto joined #mojo
10:02 Shaeto joined #mojo
10:09 Shaeto1 joined #mojo
10:10 mpw left #mojo
10:22 Shaeto joined #mojo
10:25 dp_ joined #mojo
10:34 Shaeto1 joined #mojo
10:38 neyasov joined #mojo
11:23 denis_boyun joined #mojo
12:16 da5id joined #mojo
12:58 neilhwatson joined #mojo
12:59 fhelmber_ joined #mojo
13:03 jberger "Mojolicious is the porn for every Perl WebAPI developer. If you don’t know it, you should be ashamed and start reading about it right away."
13:03 jberger http://jmorano.moretrix.com/2014/11/perl-ssl-communication-in-web-applications/
13:04 punter joined #mojo
13:04 bpmedley The server script is much prettier.. :)
13:05 jberger it's also a little out of date
13:05 jberger secrets
13:05 ribasushi jberger: .oO( Wanking to Unicorn DP action )?
13:06 jberger woah! that escalated quickly
13:07 jberger http://gifrific.com/wp-content/uploads/2012/06/Boy-That-Escalated-Quickly-Anchorman.gif
13:11 ignacio_ joined #mojo
13:22 bpmedley_ joined #mojo
13:33 hernan604 joined #mojo
13:56 Insane joined #mojo
13:57 Insane hi all, does mojo do any caching for configs? I have mojo app with exernal config and rewritten it, but after mojo restart I can see old config sections in controller dups
13:58 Insane s/dups/dumps/
14:01 odc joined #mojo
14:16 rawler joined #mojo
14:23 jberger Insane: did you change the external config file our did you change the config inside the running app?
14:23 jberger s/our/or/
14:25 Insane jberger, I don't understart what is going on... I added Mojo command to print app config to console and it is ok, and I have before_render hook which reports condtroller dump to Redmine if any error occurs. In these dumps I can see config section which was actual for previous version of config, but not fo rcurrent version...
14:26 Insane all my config is stored in external file
14:27 KCL joined #mojo
14:32 jberger Insane: to answer your question, no, there is no caching of config files between restarts
14:34 jberger if you are using hypnotoad and you use the hot deployment option, it's possible that the workers still have the old config while they are serving connections which were open
14:36 Insane ok, will do some tests later
14:38 Ptolemarch joined #mojo
14:55 ignacio_ joined #mojo
15:08 nicomen Insane: another way to ask your question would be: does mojo watch any changes to a previously loaded config file, and make sure the config object in perl's memory is reloaded whenever the config file changes. Tha answer is no. As mentioned it is loaded by default on app start. Using a forking server means occasionally some processes will get the newer config version.
15:09 nicomen if you want to be able to change the config file but not restart all processes, you need to use a config system that checks the file continuously, or something that lets you tell it to reload it
15:09 sri hmm, no new Net::DNS::Native yet :S
15:26 tempire wat
15:26 tempire https://gist.github.com/tempire/c1cfa6eaeb29829e43f4
15:27 tempire (5.57)
15:29 tempire strange.
15:29 tempire uninstall/install, problem went away.
15:29 jberger tempire: Successfully installed Mojolicious-5.57 (upgraded from 5.56)
15:39 sh4 joined #mojo
16:03 good_news_everyon joined #mojo
16:03 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/J4WgLw
16:03 good_news_everyon mojo/master 17e2d5f Sebastian Riedel: more tag helper examples
16:03 good_news_everyon left #mojo
16:07 neyasov joined #mojo
16:14 disputin joined #mojo
16:17 rawler joined #mojo
16:35 sri this is one of the reasons i hate deps... you want to merge a branch but have to wait for a 3rd party release first that takes forever -.-
16:42 nicomen that only happens if you choose to not be backwards compatible I guess?
16:49 dotan joined #mojo
16:51 ribasushi sri: a pretty simple but very effective (and battle tested) way to include random stuff with your dist
16:51 zackiv31 joined #mojo
16:52 ribasushi https://metacpan.org/source/RIBASUSHI/DBIx-Class-0.082700_15/lib/DBIx/Class/_TempExtlib
16:52 ribasushi sri: this is the entire commit that does this, main piece is linked: https://github.com/dbsrgits/dbix-class/commit/31351088#diff-c13797cc2e5864c4a1d6a92ba65871b6L28
16:52 sri hahaha
16:55 ribasushi sri: it pollutes the inc-path on-disk, true, but is never referenced unless someone adjust @INC, so meh
17:01 Oleg joined #mojo
17:02 sri Oleg: release!
17:05 irq joined #mojo
17:07 Oleg sri: test doesn't pass on NetBSD, and I want to test on OpenBSD now
17:07 sri oh noes
17:07 Oleg can we ignore NetBSD?
17:08 Oleg btw, without pool option works everywhere
17:09 sri even if it forks while a thread is still active?
17:09 Oleg difficult to test this
17:10 sri yea, having it die randomly because a thread was still active would be horrible
17:10 Oleg so, i'll go to test a little more
17:11 sri guess that would be best
17:12 sri i was a little too eager to get the branch merged, but it really is too dangerous, it needs a few weeks on cpantesters first
17:15 d4rkie joined #mojo
17:15 * sri wonders if we should merge the parts making IO::Socket::IP a hard dependency
17:16 sri to see how that works out
17:16 Oleg sri: will all the things work in ipv4 environment after this merge?
17:17 sri i would hope so
17:17 sri IO::Socket::IP is supposed to be 99.9% backwards compatible
17:18 Oleg i am still a happy ipv4 user :)
17:18 sri only change is that you have to install IO::Socket::IP on perls older than 5.20
17:19 stephanj np.
17:19 sri batman, jberger, tempire, marcus, crab: thoughts on that?
17:23 dvinciguerra joined #mojo
17:25 Oleg IO::Socket::IP still has bugs, so I don't like it a little. For example this may break LWP https://rt.cpan.org/Public/Bug/Display.html?id=98759
17:25 odc joined #mojo
17:26 neyasov joined #mojo
17:29 jwang joined #mojo
17:34 sri we already use IO::Socket::IP automatically if it is installed
17:35 sri so always on 5.20+
17:36 Oleg Thanks to debian stable we are still on perl 5.14 and without IO::Socket::IP
17:36 sri whole patch https://gist.github.com/anonymous/ce9606650d378e939bef
17:39 sri Oleg: the bug argument is really silly though... for comparison https://rt.cpan.org/Public/Dist/Display.html?Name=IO
17:42 Oleg all IO::Socket::INET bugs have become features :) I really didn't found any. But already two for IO::Socket::IP
17:44 dod joined #mojo
17:45 sri funny thing is Net::DNS::Native support in mojolicious will depend on IO::Socket::IP
17:45 dod joined #mojo
17:46 marty joined #mojo
17:47 sri and it's time for your daily Mojo::DOM::val reminder https://github.com/kraih/mojo/issues/701
17:48 sri batman, jberger, tempire, marcus, crab: another decision you should think about!
17:49 Oleg If we'll leave as is with IO::Socket::INET we can use ->inet_aton() for ipv4 and ->getaddrinfo() for ipv6. So, I think it is not very depend
17:50 sri Oleg: i would be opposed to a patch that was that complicated
17:51 Oleg I see, you want to remove IO::Socket::INET :)
17:51 sri if possible, ido
17:51 sri IO::Socket::IP could stay optional too, but Net::DNS::Native support would be tied to it
17:52 sri PeerAddrInfo in IO::Socket::IP makes Net::DNS::Native support very very easy https://github.com/kraih/mojo/compare/net_dns_native#diff-4b4175417080883ed2af6e92086dc8f2R85
17:53 tempire arg arg arg
17:53 tempire Every time I've attempted to convert to postgres, I've gotten tripped up on the permissions.
17:53 sri denied
17:53 crab i::s::ip optional and n::d::native support tied to it sounds like a sensible situation
17:53 crab tempire: what do you mean?
17:53 tempire But this time, I'm dedicated.
17:54 crab if there's anything i can do to help, feel free to ask.
17:54 sri crab: so you're -1 on https://gist.github.com/anonymous/ce9606650d378e939bef
17:55 sri quick reminder, i've made this change just a few days ago https://github.com/kraih/mojo/commit/df0d57f4ee691058409634b7212c9fc8087deb56
17:58 sri should i revert that as well?
17:59 Vytas_ joined #mojo
17:59 sri i'm not sure where we stand on IO::Socket::IP right now
18:00 sri do we want to just keep everything the way it was in 5.57? are we going to try and get rid of workarounds? do we try to switch to IO::Socket::IP completely?
18:00 Oleg N::D::N tied to optional I::S::I - I don't like this :)
18:03 Oleg making IO::Socket::IP hard dep looks better
18:03 tempire Switch to IO::Socket::IP for ipv4 too?
18:03 tempire or just ipv6
18:03 sri for everything
18:04 sri in case it's not clear, we already do that if IO::Socket::IP is installed
18:04 crab sri: after reading the patch, i can't say i'm -1 on it. switching to IO::Socket::IP completely sounds like it'll lead to the cleanest code.
18:04 Andreas2 joined #mojo
18:04 tempire That will effectively mean mojolicious requires a dependency
18:05 crab ...on older perls
18:05 tempire I seriously doubt that many people are using 5.20 yet
18:05 sri which is already the case
18:05 tempire yeah, but only for v6
18:05 tempire It would need to be a hard dependency.
18:05 sri http://cpanmetadb.plackperl.org/versions/#
18:05 crab i don't feel strongly enough about it that we should make it that way *now*
18:05 crab but i feel that it's certainly the direction to go in
18:05 tempire I'm -1 on going all ::IP now
18:06 tempire Maybe once 5.20 has been out for a year
18:06 sri tempire: so you're +1 on reverting the test patch too?
18:06 basiliscos joined #mojo
18:06 sri allright, this puts a serious dent into the Net::DNS::Native proposal
18:07 crab oh, it's only in 5.20? i thought 5.18. hmm, then ok, we should wait longer, i think.
18:07 Oleg For me from better to worse: 1) (IO::Socket::INET || IO::Socket::IP) + Net::DNS::Native 2) IO::Socket::IP + Net::DNS::Native 3) Net::DNS::Native ties to optional IO::Socket::IP
18:08 sri Oleg: 1 is out of the question for me, too complicated and too hard to test
18:08 mst I think (3) is the only sane way to go
18:08 mst since Net::DNS::Native is already an XS dep
18:09 mst so you lose nothing by having an additional XS dep to make it work
18:09 Oleg I thought it will require maximum 1 more line of code.
18:09 sri IO::Socket::IP is a pure-perl dep
18:09 sri if you have the right version of Socket
18:09 sri guess that's what you meant though
18:09 mst right, but on older perls you don't, so ...
18:10 mst yeah, my words were imprecise; generally I think in terms of "fatpackable" versus "not fatpackable"
18:10 crab yeah, so i guess (3) is sensible. which means the test patch should also be reverted for now
18:11 crab i agree strongly that (1) would be terrible
18:11 sri one more data point, we currently disable IO::Socket::IP support for all tests that run by default
18:11 sri i've changed that in master 2 days ago, should i revert it?
18:11 sri https://github.com/kraih/mojo/commit/df0d57f4ee691058409634b7212c9fc8087deb56
18:11 crab sri: i think so.
18:11 sri ok
18:15 salparadise so what is the best strategy for passing parameters on a redirect_to after validating data? I am using flash, but it doesn't feel right, should I just do a redirect_to('page?param=val') ? sorry for the simple question
18:17 good_news_everyon joined #mojo
18:17 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/8T8Ocg
18:17 good_news_everyon mojo/master 5b37319 Sebastian Riedel: use IO::Socket::INET for tests again
18:17 good_news_everyon left #mojo
18:17 denis_boyun joined #mojo
18:17 sri this is bad for Net::DNS::Native support because there's so much less test coverage
18:17 sri to the point where i'm no longer +1 on the feature
18:19 Oleg salparadise: redirect_to('page?param=val') looks right for me
18:20 salparadise Oleg: yeah seems more elegant
18:21 salparadise cool thanks.
18:24 * sri thinks the non-blocking resolver feature might be dead now
18:24 Oleg sri: too bad, i'll implement (1) after release to see how ugly this may be
18:24 sri unless someone finds a clean way to test it
18:25 sri (my goal with making IO::Socket::IP a hard dep was to get good test coverage for Net::DNS::Native support)
18:26 sri but yea, it's all just workarounds
18:29 Oleg don't understand why (1) will be difficult to test
18:29 sri because there's so many code paths
18:29 sri and odds are the code will be pretty ugly
18:32 sri guess i'll stop asking about Mojo::DOM::val now
18:33 sri nicomen seemed to really care about it, so wanted to check everyone on the team is sure we want to remove it
18:33 Oleg 2 code paths. Can't imagine how ugly it will be, need to see
18:34 sri kinda sucks we don't have better support for grabbing form values out of html
18:35 nicomen sri: I'm ok with removing it, but then I want something proper, and I think it justifies an own module to handle forms
18:35 nicomen I will see what I can come up with
18:36 * sri doesn't like that idea actually
18:36 nicomen I would like to do it like that at least for prototyping
18:36 nicomen if parts can be extracted or simplified and reused in the framework, I would be happy
18:37 nicomen sri: what would you prefer?
18:37 sri i would have liked to keep Mojo::DOM::val
18:37 nicomen but?
18:38 sri it's not as nice after removing stringification from Mojo::Collection, and nobody else seems to care
18:39 sri so i can't really justify dictating to keep it
18:39 nicomen well, I must admit I don't see the problem with it returning a Mojo::Collection that doesn't stringify, wouldn't it fix all the gotchas of people getting multiple values expecting only one?
18:51 rwp joined #mojo
18:56 jnbek joined #mojo
18:57 jnbek joined #mojo
19:01 crab i didn't know about Mojo::DOM::val. pointer to relevant patch(es)? what's not as nice?
19:25 sri crab: https://github.com/kraih/mojo/commit/3a29749ea383b8d61f61c51bb337a1ffd382f74b#diff-24fe40937fb0bc295d664900b1a94f0eL859
19:26 sri $dom->parse('<input name="a" value="b">')->at('input')->val would have to become $dom->parse('<input name="a" value="b">')->at('input')->val->first
19:32 hasan joined #mojo
19:32 hasan hi. how can I access $self (like the one in Mojolicious::Controller) in a Mojolicious base where which is a moose class?
19:33 hasan in my Foo::Model::Bar use Mojo::Base 'Mojolicious' I use "Moose". and after some operations I would like to "self->render(...)" or use $self->someplugin_loaded
19:34 sri i think what annoys me is that multiple values is very minor use case
19:34 sri while almost always you only one the value of a single form element
19:34 sri *+want
19:34 sri argh
19:34 sri s/one/want/
19:36 jberger hasan: Mojo::Base classes are just plain perl classes, they should work comparably
19:36 hasan jberger: I guess the problem occurs when I use "my $self = shift" in my Moose subs
19:36 jberger hasan: are you doing both 'use Mojo::Base 'Mojolicious'' and 'use Moose'?
19:37 hasan since then "$self->render" won't be available of course.
19:37 hasan jberger: yes both
19:37 jberger hasan: don't use both
19:37 hasan jberger: well I need the mojo base class to access loaded plugins in my main mojo app.
19:37 hasan don't I?
19:38 hasan $self->plugin( someplugin) <- in my main mojo app. so I can say $self->plugin->do_something
19:38 jberger hasan: Mojo::Base is an OO system, like Moose
19:38 sri http://blog.atom.io/2014/11/05/linux-packages.html # for the penguins hanging out here
19:39 hernan604 hasan: one option i use is: I create a mojo My::Main::App (class). Then i create Custom::App with Moo/Moose extending My::Main::App
19:39 hasan hernan604: and the Custom::App in this case would be my App::Model::Foo
19:39 jberger woah!
19:39 hasan it is about my models in my example
19:39 hernan604 coould be
19:40 jberger what is the point of My::Main::App if you are just going to extend it later
19:40 priodev joined #mojo
19:40 mst what's wrong with
19:40 mst use Moose; extends 'Mojolicious';
19:40 jberger what mst said
19:40 jberger (I was just typing that)
19:41 jberger I haven't tried it with Moose, I have tried it with Moo
19:41 mst of course that's for an application
19:41 hernan604 i tested with Moo also, not moose
19:41 mst using Mojolicious in a model is just fucking wrong
19:41 hasan ok so far I understood. but am I able to use my plugins loaded in my main app (startup sub)
19:41 hasan ?
19:41 mst a model shouldn't need to know about the web framework at all
19:41 mst hasan: you're imagining problems that don't exist
19:41 hasan so the model should not render stuff at all?
19:41 mst ...
19:41 mst no!
19:41 mst jesus fucking christ no
19:42 hasan well. then I don't have any problem anymore :)
19:42 hernan604 =D
19:42 jberger hasan: helpers are installed as methods in the application and controllers (and templates as functions)
19:42 hasan I see.
19:47 good_news_everyon joined #mojo
19:47 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/kMi5AA
19:47 good_news_everyon mojo/master d5671cf Sebastian Riedel: better deprecation message
19:47 good_news_everyon left #mojo
19:50 sri or am i the only one who thinks $dom->parse('<input name="a" value="b">')->at('input')->val->first looks silly?
19:51 hernan604 val->second ?
19:52 jberger sri: I see it, but it just is kinda sad to lose a feature over it
19:52 jberger ;/
19:52 mst sri: yes. but if you changed it to ->values it'd look fine
19:52 Eke- joined #mojo
19:52 sri mst: it's not the name at all imo
19:52 sri just the use case
19:52 jberger sri: recall, I proposed value and values
19:53 jberger value could just call values->first
19:53 sri in fact, the jquery feature of the same name also returns arrays optionally
19:53 sri but it only returns arrays if there are multiple values, and strings for stuff like <input>
19:54 sri http://api.jquery.com/val/
19:54 good_news_everyon joined #mojo
19:54 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/qQmjzQ
19:54 good_news_everyon mojo/master a002000 Sebastian Riedel: use tags in example
19:54 good_news_everyon left #mojo
19:56 sri jberger: splitting it up only makes it worse imo
19:57 jberger sri: call values if you expect values, call value otherwise, how is that worse; or do you mean you would prefer what jquery does to that?
19:58 sri jberger: i mean there is pretty much no use case for ever using $dom->values
19:59 sri if you had two methods why would you even merge handling of one and multiple values?
20:00 sri when was the last time the value you wanted to extract with Mojo::DOM::val was a <select> with multiple pre-selected <option>s *or* a plain <input>?
20:00 sri this feels so ridiculously overengineered
20:01 sri the proposal makes kinda sense because we are coming from the current Mojo::DOM::val behavior
20:01 sri but we would never ever consider it as a new feature on its own
20:03 sri merging it all only made sense because Mojo::Collection stringified, and things just worked
20:04 ignacio_ joined #mojo
20:05 sri haha, and now we are back to "this is all too complicated" and "i don't care enough about it" :)
20:05 sri nicomen: if you want to sell an undeprecation of the current behavior... better do it now
20:06 sri this is not a super major feature, we don't have to choose the solution that sucks the least
20:07 hasan just to make it more clear for me: http://search.cpan.org/~romanenko/Mojolicious-Plugin-PgAsync-0.03/lib/Mojolicious/Plugin/PgAsync.pm <- shouldn't the part in SYNOPSIS (controller part) actually be done by the model?
20:08 sri hasan: yes
20:08 hasan because like this (the given example in the plugin docs) I don't need a model abstraction at all. everything is done in my controllers, right?
20:09 hasan I wanted to outsource these parts to my model. and in combination with Mojo::IOLoop (delay) it is very complicated for me.
20:09 sri note that i never said the plugin was a good choice yesterday
20:09 hasan I know
20:09 hasan I will check out Mojo::Pg
20:10 hasan sri can I query you?
20:10 sri don't do that if you're worried about backwards compatibility, the warning you mentioned yesterday is very serious
20:10 sri please don't query me
20:11 hasan ok
20:12 sri i may make Mojo::Pg stable later this year, but it depends very much on the feedback i'm getting until then
20:12 hasan so I guess there is no way to implement a nice mvc with the tools we have for now? pgasync plugin and mojo::pg.
20:12 sri and i'm not in a hurry, Mango was experimental for almost 2 years
20:13 hasan only DBIx::Class afaik. but it's not non blocking.
20:13 hasan sri: yeah. heard about that and you giving it up.
20:13 denis_boyun joined #mojo
20:14 sri i currently have no plans to change anything in Mojo::Pg, but that can change any time
20:16 sri (switching to transaction scope guards was a pretty quick decision)
20:37 disputin joined #mojo
20:38 disputin1 joined #mojo
20:40 disputin joined #mojo
20:41 disputin1 joined #mojo
20:42 disputin joined #mojo
20:44 disputin1 joined #mojo
20:45 disputin joined #mojo
20:46 d4rkie joined #mojo
20:49 mattastrophe joined #mojo
20:50 janus joined #mojo
20:59 neyasov joined #mojo
21:04 punter joined #mojo
21:15 disputin joined #mojo
21:32 franzkafka Hi
21:33 franzkafka Given this: https://www.linkedin.com/ta/company?query=ba
21:33 franzkafka Any ideas why this doesn't work: http://paste.scsys.co.uk/438203?hl=on ?
21:34 franzkafka Use of uninitialized value in say... Though it should not be uninitialized, it should be "British Airways"
21:35 franzkafka res->dom->content contains this: {&quot;resultList&quot;:[]}
21:38 hernan604 and you are trying to call its content in the last line...
21:38 hernan604 the array is empty, so wont be possible to access displayName
21:38 franzkafka I don't get why, considering the content in the browser for the exact same url, that the array would be empty.
21:39 franzkafka That's what I am trying to understand.
21:40 hernan604 franzkafka: in your last line, try this: http://paste.scsys.co.uk/438205
21:40 hernan604 :sh
21:41 hernan604 dont get it?
21:42 franzkafka I still don't get it :)
21:42 franzkafka It's empty, I get that
21:42 hernan604 yes
21:42 hernan604 its empty, so what dont you understant
21:42 franzkafka I just don't get why it is empty, considering the content of the URL
21:42 hernan604 well, you might be using it wrong
21:42 hernan604 thats not my probl
21:43 franzkafka Here's one that works
21:44 franzkafka http://paste.scsys.co.uk/438207
21:44 hernan604 So what ?
21:44 franzkafka And compare https://www.linkedin.com/ta/company?query=ba with the one that works: https://www.linkedin.com/ta/fieldofstudy?query=ba
21:45 hernan604 franzkafka: thats linkedin problem
21:45 hernan604 not mojo, neither perl
21:45 hernan604 what are you trying to prove ?
21:45 franzkafka OK, is there any way to debug this, to figure out why the hell the company URL is returning nothing with the script vs. a populated array in browser?
21:46 franzkafka The URL works perfectly fine in browser, so I don't see the difference.
21:46 hernan604 its not a URL
21:46 hernan604 its a request
21:46 dp_ joined #mojo
21:46 hernan604 its built of http method, url, headers and content
21:46 hernan604 you are only focusing on url
21:46 hernan604 im out
21:46 hernan604 gtg see ya
21:48 franzkafka Ah ha, the headers
21:48 franzkafka Got it
22:03 sri this is what Mojo::DOM::val would look like if it was brought back https://gist.github.com/anonymous/8b6d33f31a01a5b6aaf5
22:03 franzkafka thanks hernan604, I got it working
22:04 tianon sri: I love how every single example there uses ->first because that's basically what everyone always wants anyhow :P
22:05 sri yea :(
22:06 tianon fwiw, I agree with you that there aren't likely to be many people parsing HTML with Mojo::DOM that have multiple pre-selected <option>s
22:07 denis_boyun joined #mojo
22:07 sri i guess it just has to die
22:08 tianon and to earn my reputation for getting set on fire, you could just have ->val die if there are going to be more than one val returned :trollface: (with a nasty message like "multiple selected <option> elements - traverse the tree yourself, sucka!")
22:08 sri backwards compatibility
22:08 tianon yeah :(
22:08 sri anything sensible basically requires us to wait 3 months and not have a replacement until then
22:10 sri it's telling that nobody has actually said anything positive about ->val, just new workarounds
22:10 sri even nicomen
22:11 sri allright, it's decided now, bye bye ->val
22:11 * tianon lights the funeral pires
22:11 tianon *pyres
22:13 hasan i have a little problem understanding Mojo::IOLoop->delay. can I delay any subroutine with this?
22:13 hasan when I have $obj->method() from my own class. how can I call it in mojo delay?
22:13 * sri closes #701
22:14 hasan do I have to implement my own callback to this or what exactly must I do?
22:15 sri hasan: delays are not magic, they can only be used with non-blocking apis
22:15 jmmills Has anyone done any magics with mojo and swagger.io yet?
22:16 hasan I want to use it with DBD::Pg 'async'. I can call my queries to postgres async and it works. but now I just have to figure out how to not block within the route (controller) which is the caller.
22:16 jmmills hasan: abstract with a distributed worker
22:16 jmmills like gearman
22:16 hasan will check that out
22:16 jmmills although you still have to do async stuff on the request side
22:17 hasan jmmills: the problem is that the request blocks. not the query to postgresql
22:17 jmmills but that seems like a design issue with the over all app... if you are using a forking model... or plack across multiple machines then it's only that specific instance that is blocked
22:18 hasan jmmills: I would use this app with hypnotoad (for now only morbo)
22:18 hasan hyptnotoad in production then.
22:18 jmmills load balancer, with nginx as a local proxy, with plack running multple processes
22:19 jmmills preforking
22:19 jmmills that means it forks on request
22:19 jmmills 1:1 between request and process
22:19 jmmills which means if you blocking in the controller than it's only that request that's blocking, which should be fine no?
22:22 hasan jmmills: is this true non-blocking?
22:23 sri quite the opposite... it's "true blocking"
22:24 jberger hasan: in some sense that's the old way
22:24 sri http://mojolicio.us/perldoc/Mojolicious/Guides/FAQ#What-is-the-difference-between-blocking-and-non-blocking-operations
22:25 jberger hypnotoad uses some of the old way (preforking) with the new way (nonblocking)
22:26 jmmills No, it's not true non-blocking in the sense of concurrent multi-tasking
22:26 sugar joined #mojo
22:27 jmmills but you could always use a worker queue, finish the request returning something to indicate to the client that it's queued, and then poll the worker queue to determine when it's done
22:27 jmmills or use web sockets
22:28 jberger hasan: if you need to "unblock" something, you can use Mojo::IOLoop::ForkCall, but you should make sure that it is worth the overhead
22:29 jberger and there is a known perl bug that makes it not very useful on windows
22:29 disputin joined #mojo
22:29 jberger but then again, ForkCall on windows is even less performant anyway, so there you go
22:30 dvinciguerra joined #mojo
22:31 hasan does Mojo::IOLoop the same when we talk about non-blocking? spawning/forking a new process?
22:31 hasan or thread.
22:31 sri no
22:32 sri http://mojolicio.us/perldoc/Mojolicious/Guides/FAQ#What-is-an-event-loop
22:42 sugar_ joined #mojo
22:54 sugar__ joined #mojo
23:04 Ptolemar_ joined #mojo
23:05 neyasov joined #mojo
23:05 neyasov_ joined #mojo
23:28 denis_boyun joined #mojo
23:39 good_news_everyon joined #mojo
23:39 good_news_everyon [mojo] kraih pushed 2 new commits to master: http://git.io/rFV_ww
23:39 good_news_everyon mojo/master 09501cb Sebastian Riedel: better deprecation warnings for AUTOLOAD methods
23:39 good_news_everyon mojo/master a318e7f Sebastian Riedel: use real names in example
23:39 good_news_everyon left #mojo
23:44 good_news_everyon joined #mojo
23:44 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/zI-DeA
23:44 good_news_everyon mojo/master 335c59f Sebastian Riedel: change all names
23:44 good_news_everyon left #mojo

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