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

IRC log for #mojo, 2014-11-02

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

All times shown according to UTC.

Time Nick Message
00:06 jberger sri: have you looked at the UV module lately, has it gotten any better?
00:06 sri jberger: no updates since 2013
00:07 nicomen what's particularly bad about it?
00:07 jberger on linux we could just 'open my $resolv, '-|', "host $fqdn"'
00:07 jberger :{
00:07 jberger :P
00:08 jberger that's what I learned here: https://gist.github.com/jberger/93b3a192fc68a0d7ca14
00:08 nicomen not sure you want to make a new process for every dns lookup though
00:08 jberger nicomen: I'm (mostly) kidding
00:08 D4RK-PH0ENiX joined #mojo
00:08 jberger the overhead wouldn't be worth it on a successful resolve
00:09 D4RK-PH0ENiX joined #mojo
00:10 jberger I hadn't used -| before the other day, and I was really impressed at how easy it was to use
00:10 jberger (assuming you don't deadlock yourself)
00:10 nicomen isn't there an async host command?
00:10 preaction ooh, that'd be a good addition to my weird perl things talk
00:10 preaction open is amazingly powerful
00:11 jberger preaction: did you see that gist I posted, I was rather proud of it
00:11 nicomen please mention Open3 as the real way to do those things ;-P
00:11 preaction yeah, is nice
00:11 * jberger slaps nicomen with a carp
00:11 preaction why? open3 is cumbersome. sometimes i don't care to do cumbersome things
00:14 nicomen oh well, I just recently implemented an "exec_pipe" using the same "hack", Capture::Tiny::capture { open my $fh, '|-', "$cmd_args"; print {$fh} $pkgs; close $fh; }
00:14 nicomen felt a bit ugly
00:14 jberger nicomen: if you need to pipe to it and read from it then yes, open3 is the way to got
00:14 nicomen I felt I _should_ have used Open3
00:14 jberger go
00:14 preaction if you care about bidirectional, sure. but opening a pipe just for output doesn't need open3
00:15 preaction or just for input
00:15 preaction open2 might even be fine. open3 is for when you need stderr and stdout to be different
00:36 bpmedley http://pastie.org/9690545 <— Is there anything wrong with my callback?
00:37 bpmedley Starting at line 15.
00:40 ningu left #mojo
00:41 jberger bpmedley: what are you trying to accomplish? that code makes no sense to me
00:42 bpmedley The end goal is that whenever a $tx finishes it will print the URL that was requested.
00:43 jberger $delay->begin->() # almost never what you mean
00:43 bpmedley Understood; I’m sure there’s a much better way to set the finish event of the $tx.
00:45 jberger when that cb gets called, the transaction is already finished
00:45 jberger and to ->begin, you need need to do it before starting the transaction
00:45 bpmedley Hrrm.  That details some significant ignorance on my part.. :)
00:46 jberger :P
00:47 jberger the second step is going to print out the url anyway right? so why have the transaction do it too?
00:47 bpmedley Because a few of the URLs are taking a while.
00:47 bpmedley At least, I think that’s what is going on.
00:48 jberger are you using hoppie's url list?
00:48 bpmedley Yes
00:48 jberger the problem is that some of those don't resolve
00:48 jberger and resolving is blocking
00:49 bpmedley I believe I understand the getaddrinfo issue; this one is different, I think.  More for my own curiosity.
00:51 sri now that you mention it, i think this might be a different problem too
00:51 sri too bad i've already deleted the test data
00:54 jberger sri: forwarded to your cpan email
00:57 jberger screw it, private gist: https://gist.github.com/jberger/9297fbf0fb76e740433f
00:58 bpmedley Gaw
00:58 sri what was the script again?
00:58 jberger sri: mine or his?
00:59 sri yours
00:59 jberger http://pastie.org/9689740
00:59 woz joined #mojo
01:04 sri nope, it's nothing else as far as i can see
01:05 sri once the bad domains are cached it's all fast
01:07 bpmedley http://pastie.org/9690579 <— For posterity, this is a working snippet of what I was trying to accomplish.  There’s usually a few URLs at the end that take much longer to process than the rest (no surprise); however, I just wanted to see which ones they were.
01:07 memowe joined #mojo
01:09 * sri wonders if hoppie has actually considered the worst case memory usage for 200 concurrent requests :)
01:12 jberger if I put that URLQueue on CPAN I would rename workers to concurrency or some such
01:12 jberger I would also probably invert the {lazy} attribute
01:13 hoppie jberger: +1, I was confused initially thinking there were 40 workers. I ran ps -ef | egrep for count
01:13 jberger while( $self->{active} < $self->concurrency and ...
01:13 hoppie In my code, I called it depth.
01:13 jberger I wrote the first implementation a very long time ago
01:14 jberger I didn't have my terminology down yet
01:14 hoppie it was fun today -- but the last several days just digging and learning Mojo -- liking it alot
01:16 jberger came from here: http://stackoverflow.com/questions/15152633/perl-mojo-and-json-for-simultaneous-requests/15166898#15166898
01:16 jberger I called it "idle" which kinda means you need an noun to be idle, so it was workers
01:17 hoppie yea, I got it after reading a couple times, then everything clicked.
01:18 hoppie So, this does the same thing using MCE: http://pastie.org/9690197   (excuse for the misspelled max_connections).
01:18 sri i think the only way we would get non-blocking resolver support into core would be a) one of the cpan modules gets reliable, b) libuv binding, or c) there's another huge advantage, such as super reliable forked background processes
01:19 hoppie you controlled chunking with workers => 40 so to speak.
01:19 hoppie yea, Mojo is (already rocking) going to rock more.
01:20 hoppie I have found during testing that 40 was too high. Therefore lowered to 32.
01:21 hoppie And increased the number of workers.  The scripts completes in no time. Can get down to 6 seconds.
01:22 sri the number will depend on your timeout settings, number of bad domains, and server timeouts
01:22 hoppie yes.
01:22 sri rather complex
01:23 hoppie The script on pastie completed in ~ 6 seconds several times.  But sometimes 9 ~ 14 seconds.
01:24 sri dns cache
01:24 hoppie that too.
01:24 sri well... actually lots and lots of variables with real world servers ;p
01:24 hoppie A slow chunk in MCE will not impact other workers.
01:26 hoppie All the fast chunks will fly. It's possible that 1 worker may process only 1 chunk for the duration of the script (not this one). While other workers may have process several. Kind of like the bank-teller model. The line being the input stream.
01:27 sri someone should build a module for pre-resolving transactions ;)
01:27 hoppie The thing I have found with Mojo (steps) is that it doesn't begin the next step until all is completed in the current step.
01:27 jberger hoppie: that is a feature
01:27 hoppie sub { step 1 }, sub { step 2 }.
01:28 hoppie jberger: awesome.
01:28 jberger each step can start one or more non-blocking tasks but you don't move to the next step until they all complete
01:29 hoppie I miss understood. You mean that is a feature and design.
01:29 hoppie got it.
01:29 jberger yeah
01:29 hoppie it's a feature, because you can preserve order between steps.
01:29 hoppie ha ha. nice.
01:30 hoppie Doing chunking in MCE, I can see what you mean and benefits to that. Very nice.
01:31 jberger the first step might look up several unrelated bits of needed info (db calls or web services), then the second step might combine that info into a further call, then the third might render a response
01:32 jberger hoppie: here are some examples: https://github.com/jberger/MojoForum/blob/master/lib/MojoForum/Helpers.pm
01:32 hoppie each chunk in MCE comes with a chunk_id. So in the last step or gather, easy to ensure order in real time. it does not have to wait for all chunks to complete. Out of order chunks are held temporarily.
01:33 hoppie That's like a goal-mine of treasures. Thanks.
01:34 jberger disclaimer, it is a toy app, but it should work enough for a demonstration
01:35 hoppie everyone likes toys :) I like the various examples.
01:35 jberger if you are interested, I have a 3 part blog series that I think makes the patterns fairly clear: http://blogs.perl.org/users/joel_berger/2013/10/writing-non-blocking-applications-with-mojolicious-part-1.html
01:37 hoppie It has been a while. I once sent out a thank you note to various folks. I mentioned your name.
01:37 hoppie I knew about Joel through interacting with David Mertens. The inspiration from Joel was from reading an article using Mojo::IOLoop::Delay. In the article he mentioned the word step. MCE::Step was created by taking MCE::Flow and a touch of MCE::Stream for transparent use of MCE::Queue between user tasks.
01:37 hoppie :)
01:38 jberger :)
01:38 hoppie I came across your 3 part blog at the time. And MCE::Step was created.
01:38 jberger I remember your work on MCE+PDL well, the thing for me was that I was in the final stages of my Ph.D. and since then I don't use PDL all that much anymore
01:38 jberger ah cool
01:40 hoppie All of this is coming to Ruby soon. :)  Will create MCE 1.6 after completing Ruby MCE 1.0.
01:42 hoppie For clarity, MCE is coming to Ruby soon.
01:43 hoppie I took time off from that to focus on show-casing Mojo to the fellow who created a presentation on the web. And he totally left out Mojo. I felt the need to introduce him to Mojo.
01:48 jberger hoppie++ # sharing the love
01:48 hoppie That's the one which inspired me to create MCE::Steps:  http://blogs.perl.org/users/joel_berger/2014/01/writing-non-blocking-applications-with-mojolicious-part-3.html
01:48 hoppie I remember the time.
01:51 hoppie And barrier synchronization came from interacting with David Mertens. :)
01:54 jberger David is great, I miss him being in Chicago
01:55 hoppie you guys are definitely dynamic duos.
01:59 jberger re-reading I think my favorite part was part 2, when "accidentally" the refactor of the two non-blocking callbacks becomes n non-blocking callbacks without really trying :-)
01:59 jberger "Actually now that you look at it, you can see that it doesn’t matter how many @urls you have, this will work exactly as expected for any number of parallel calls."
02:00 jberger :-)
02:03 hoppie yes. it follows a bank-teller model. it does not matter how long the line is.
02:03 hoppie Or it does not matter the distance driving a car (MCE engine) on a very long highway.
02:04 hoppie Each chunk will never do more than 32 at a time.
02:05 hoppie One can even increase the number of workers to 50, no problem. Even 100 or 200 workers no problem either, each with a depth (chunk_size => 32).
02:07 hoppie The interval => 0.05 with MCE->yield can be useful to ensure only 1 worker initiates IODelay at any given time. Everything else coming from the power of randomness at plat.
02:07 hoppie s/plat/play/
02:07 hoppie See examples/interval.pl in MCE.
02:10 hoppie Many folks taught it wasn't possible, but the MCE driven SNMP poller sustained (polling 1250 devices per second), about 40 metrics.
02:10 hoppie The server sustained 24 CPU load (zero spikes). No problems with the OS either.
02:11 hoppie for clarity, 40 metrics per device.
02:26 hoppie Will try to do something interesting with the MCE + Mojo example instead of just getting the body length. Will make use of retrieving something via dom.
02:26 KCL joined #mojo
02:28 good_news_everyon joined #mojo
02:28 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/-nqmig
02:28 good_news_everyon mojo/master e45c263 Sebastian Riedel: documentation tweak
02:28 good_news_everyon left #mojo
02:33 klapperl_ joined #mojo
02:33 * jzawodn keeps meaning to try out MCE
02:35 KindOne joined #mojo
02:36 hoppie jzawodn: :)
02:37 hoppie You may have seen this: https://gist.github.com/tardisx/9088819
02:37 hoppie by Justin Hawkins
02:37 hoppie We were mentioned http://perltricks.com/article/73/2014/2/28/The-Perl-Nerd-Merit-Badge-Contest-results
02:38 hoppie It took me several attempts after receiving an email from Justin. He polished it afterwards.
02:39 mst hoppie: every time I google MCE I get microsoft TV remote controls
02:39 mst hoppie: what should I be googling?
02:39 hoppie Perl MCE
02:39 jzawodn "cpan mce"
02:40 hoppie I use: many core engine
02:40 hoppie in google search
02:40 hoppie it comes up first the code.google page.
02:40 hoppie and the url for cpan comes next
02:40 mst hoppie: thanks
02:41 hoppie MCE was mentioned here (however, not using Mojo though): http://perltricks.com/article/61/2014/1/21/Make-your-code-run-faster-with-Perl-s-secret-turbo-module
02:42 * sri wonders why there are type declarations in MCE (my MCE $self =...)
02:43 hoppie Thanks for asking. I was kind of new to creating a module 2 years ago. I cannot remember which module I looked at for a sample and it had the type declarations.
02:45 hoppie Is that needed?
02:45 preaction no. i'm surprised it works
02:45 sri as far as i know it does pretty much nothing
02:45 hoppie Will remove it for the 1.520 release. I have to do an update anyway. Will ensure workers flush STDOUT after running.
02:46 mst sri: unless you use fieldhashes
02:46 sri mst: do tell
02:46 mst if you do 'my Foo $thing' then if you're using fieldhashes $thing->{foo} is type checked at compile time
02:47 mst noticed it with Danga:: code
02:47 sri oh
02:47 mst never seen it anywhere else
02:48 woz joined #mojo
02:50 sri think i saw them first in Plucene many years ago... and forgot to read up on them
02:52 sri (not that there is much to read)
03:39 hoppie joined #mojo
03:42 hoppie sri, bpmedley: this obtains the IP address for FQDNs using MCE and Socket: http://pastie.org/9690691
03:42 zivester joined #mojo
03:44 sri hoppie: use getaddrinfo() or you don't get ipv6 addresses
03:45 hoppie Threads is not required. Add "use threads" at the top to enable threads (wanting to see memory utilization while running and increasing # of workers). 200 workers no problem, but not necessary either.
03:46 hoppie oops. forgot about ipv6. will update.
03:48 hoppie Yeah, just saw this: As of Perl version 5.14.0, Perl already supports getaddrinfo in core.
03:49 hoppie For the small demo will use 5.014;
04:15 basic6_ joined #mojo
04:17 hoppie sri: http://pastie.org/9690725
04:37 woz joined #mojo
05:28 sri oh wait, i was wrong about IO::Async and the one resolver process per worker process thing
05:28 sri i just played a little with it and now i have 7! resolver processes per worker -.-
05:30 sri yea, if your hypnotoad has 10 workers that would be 70 resolvers ;p
05:30 marmez joined #mojo
05:45 rem_lex|pivo joined #mojo
06:01 irq joined #mojo
06:26 woz joined #mojo
07:29 marcus joined #mojo
07:39 dod joined #mojo
07:46 basiliscos joined #mojo
07:54 amon joined #mojo
08:03 jamesaxl joined #mojo
08:15 woz joined #mojo
08:20 Vandal joined #mojo
08:23 sujithm joined #mojo
08:30 berov joined #mojo
08:41 hrupp joined #mojo
08:44 dotan joined #mojo
08:47 hrupp Hi, I'am searching for an ecommerce solution on top of Mojo. Who knows about ?
08:47 marcus joined #mojo
09:08 sh4 joined #mojo
09:27 marcus joined #mojo
09:32 marcus joined #mojo
09:37 marcus joined #mojo
09:42 marcus joined #mojo
10:04 woz joined #mojo
10:08 marcus joined #mojo
10:21 batman sometimes i want to use a custom Mojolicious::Validator object in my models. would anyone think it could be a good idea to be able to "inject" that validation object into the $controller later on?
10:23 batman let's say i have User.pm with "has validation => sub { ... };" then i would like to do $c->validation($user->validation) unless $user->validation->is_valid;
10:23 batman not sure if i'm doing this backwards...
10:26 basic6 joined #mojo
10:54 marcus joined #mojo
10:54 oetiker joined #mojo
10:58 oetiker joined #mojo
11:15 marcus joined #mojo
11:45 denis_boyun joined #mojo
11:53 woz joined #mojo
12:28 sujithm joined #mojo
12:50 sujithm joined #mojo
12:58 jamesaxl joined #mojo
13:08 irq joined #mojo
13:15 ashimema joined #mojo
13:33 ashimema joined #mojo
13:42 woz joined #mojo
13:55 amon joined #mojo
14:14 ashimema joined #mojo
14:19 irq joined #mojo
14:26 KCL_ joined #mojo
14:52 ilbot2 joined #mojo
14:52 Topic for #mojo is now 🐯 hear me roar | http://mojolicio.us | http://irclog.perlgeek.de/mojo/today
14:59 moritz joined #mojo
15:07 basiliscos joined #mojo
15:22 zivester joined #mojo
15:32 berov Does any one knows what is needed to get started with Mojolicious::Plugin::OAuth2 ?
15:32 batman you need an oauth2 provider, such as google, facebook or similar
15:32 berov I created a project on https://console.developers.google.com/project
15:33 batman berov: did you read this https://metacpan.org/pod/Mojolicious::Plugin::OAuth2#CONFIGURATION ?
15:34 berov ok but do I always need an known URL of my app what if it is accessible via different doamins
15:34 sri quick reminder that we still need to solve the Mojo::DOM::val problem if we want to deprecate stringification of Mojo::Collection https://github.com/kraih/mojo/issues/684#issuecomment-59544773
15:34 berov there is not much to read there
15:35 batman berov: you need to know the domain of your app to make oauth2 safe
15:37 batman berov: here is an example config for google: https://gist.github.com/jhthorsen/0db5395df07bdba79970
15:38 berov ant that is all?
15:38 dod joined #mojo
15:39 batman yeah, then you need to use the documentation here to actually log in https://metacpan.org/pod/Mojolicious::Plugin::OAuth2#SYNOPSIS
15:39 batman s!documentation!example!
15:39 batman just replace "facebook" with "google"
15:39 dod joined #mojo
15:40 * sri wonders who came up with the idea for Mojo::DOM::val
15:40 sri maybe we deprecate Mojo::DOM::val completely
15:41 berov batman: some info for a newbie like "how to enable Oauth2 authentication for your site using Mojolicious::Plugin::OAuth2"
15:41 berov ?
15:42 batman i agree
15:42 batman can you open an issue?
15:42 sri and reopened with proposal to deprecate Mojo::DOM::val https://github.com/kraih/mojo/issues/684#issuecomment-61411363
15:43 batman berov: https://github.com/marcusramberg/mojolicious-plugin-oauth2/issues # please mention @jhthorsen (me) if you like
15:43 batman i can write it. just not now :(
15:45 berov batman: ok, I will read all of https://developers.google.com/console/help/new/ and then will create a new issues or eventually create a merge request containg links to be added to the POD for newbies
15:45 berov batman: thanks
16:19 batman berov: can you review this: https://github.com/jhthorsen/Mojolicious-Plugin-OAuth2/tree/doc#readme ?
16:19 batman let me know if it makes more/less sense
16:20 berov sure
16:25 batman berov: i pushed "References" to the doc now (under DESCRIPTION)
16:26 berov batman: now it is definitely better. The unninitiated knows at least where to get the ID and tokens from.
16:26 berov and I would add a link for newbies to get started https://developers.google.com/+/quickstart/
16:26 berov let me see
16:27 batman i can add the "quickstart" link to "google" here https://github.com/jhthorsen/Mojolicious-Plugin-OAuth2/tree/doc#configuration
16:27 batman what do you think?
16:28 berov yes
16:28 berov please
16:30 batman ok. i'm adding more details to "get_token" as well... i'll let you know
16:32 berov batman:thanks!, that surely will help people to get started
16:32 batman i appreciate the (any feedback :)
16:43 batman berov: care to look at https://github.com/jhthorsen/Mojolicious-Plugin-OAuth2/tree/doc#get_token ?
16:44 batman i also added the links as you suggested
16:44 batman links = i also added one for facebook
16:52 batman berov: also, please comment here if you have any input: https://github.com/marcusramberg/Mojolicious-Plugin-OAuth2/pull/34
16:53 batman tempire: Happy Birthday :)
16:53 tempire WOO
16:54 batman got any cake?
16:59 berov batman:why so many duplicate letters? is this on purpose?
17:00 berov https://github.com/marcusramberg/Mojolicious-Plugin-OAuth2/pull/34/files
17:01 berov in README
17:01 batman berov: no. i forgot -tT when i wrote the README file
17:01 batman fixed now
17:01 batman thanks
17:01 berov thanks
17:04 batman sri: have you seen this before:
17:04 batman Early return for async query    <- execute(1414947776, undef, ...)= ( '0E0' ) [1 items] at Database.pm line 116
17:04 batman it's from Mojo::Pg::Database
17:05 batman it seems like it gets tripped over on error... i will try to make narrow it down
17:06 sujithm joined #mojo
17:06 jberger sri: follow the lead of every_param and return a collection for every_val and the first for val
17:07 jberger maybe every_value
17:08 jberger its tempire's birthday?!
17:08 jberger tempire: happy birthday!
17:13 Claudio joined #mojo
17:15 batman sri: nevermind. i got another issue (ignore the warning)
17:31 sri tempire: happy birthday!
17:34 * tempire expects expensive gifts
17:36 * jberger sends tempire his credit card statement
17:37 jberger that'll set you back
17:37 jberger :p
17:39 * sri fedexes tempire a pony
17:39 tempire ZOMG I LOVE PONIES
17:39 batman tempire: the most valuable gift is the gift of life
17:39 batman ;D
17:40 * batman hides
17:41 * tempire wonders if batman is going to deliver a baby
17:41 batman hehe
17:42 batman tempire: how's your day? any breakfast in bed? cake with frosting and candles...?
17:43 jberger the problem now is that my birthday will never be able to compete with tempire's
17:44 jberger he's getting a pony, a baby, and a tiny amount of unsecured debt to repay
17:44 batman haha
17:44 jberger then again i did get to go indoor skydiving
17:45 jberger which was pretty cool
17:45 batman sounds cool! do you know how much it cost?
17:45 jberger about $75 per person
17:46 batman ok. how many minutes?
17:46 jberger a little steep but a lotto
17:46 jberger lot of fun
17:47 jberger not as long as you might think, but it turns out that it is much longer than the freefall you get when actually skydiving
17:48 batman yeah, i heard...
17:48 batman i friend of mine paid 110USD for three minutes
17:49 jberger We got two 1.5 minute runs, so the same amount of time but a bit less price
17:50 batman yeah.
17:51 * batman starts getting the hang on Mad::Mapper
18:13 good_news_everyon joined #mojo
18:13 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/lVoGEg
18:13 good_news_everyon mojo/master 3a29749 Sebastian Riedel: deprecated Mojo::DOM::val and stringify support in Mojo::Collection (closes #684)
18:13 good_news_everyon left #mojo
18:14 woz joined #mojo
18:14 sri i'm going to force the issue with the deprecation
18:14 sri if anyone wants to keep Mojo::DOM::val and/or stringification they've got 3 months to find a solution
18:15 sri jberger, tempire, marcus, batman, crab: *poke*
18:15 batman i don't get why val() have to go
18:16 sri kinda funny how we're moving backwards from say $dom->find('p')->text to say $dom->find('p')->pluck('text')->join("\n")
18:17 mst I still think map should accept a method name
18:17 mst and pluck should just be there for the method vs. hash key DWIM
18:18 sri mst: i think that actually works, just not documented
18:18 mst and $dom->find('p')->map('text')->join("\n") reads really clearly to me
18:18 sri although, i don't like duplicated functionality
18:19 sri pluck would have to go imo
18:19 batman i like map() better than pluck()
18:19 mst I found the existence of pluck surprising, tbh
18:23 sri i guess it's bye bye pluck then :o
18:24 woz joined #mojo
18:29 nicomen never used pluck
18:30 nicomen (and looking at the documentation I have no idea what it does)
18:31 nicomen ah shortcut for map
18:35 good_news_everyon joined #mojo
18:35 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/8xx67Q
18:35 good_news_everyon mojo/master 2551b57 Sebastian Riedel: deprecated Mojo::Collection::pluck in favor of Mojo::Collection::map
18:35 good_news_everyon left #mojo
18:35 sri holy deprecation batman
18:37 batman \o/
18:37 batman DEPRECATE ALL THE THINGS!
18:38 * batman <3 Mojo::Pg
18:40 Eke- joined #mojo
19:00 davido__ joined #mojo
19:33 denis_boyun joined #mojo
19:41 good_news_everyon joined #mojo
19:41 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/5zsnDQ
19:41 good_news_everyon mojo/master 4efe43a Sebastian Riedel: just use overload twice
19:41 good_news_everyon left #mojo
20:01 good_news_everyon joined #mojo
20:01 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/JRpkwg
20:01 good_news_everyon mojo/master 25b4237 Sebastian Riedel: fixed typo
20:01 good_news_everyon left #mojo
20:03 * sri is a little sad about the loss of Mojo::DOM::val, but there doesn't seems to be a better solution
20:03 sri (honestly... ->every_val looks terrible)
20:06 mst ->value_of and ->every_value_of looks nice to me
20:06 mst maybe a bit verbose
20:06 sri there is only <select> that can return multiple values
20:06 sri and 3 elements that always return a single value
20:07 sri splitting this up is just ugly imo
20:07 sri stringified collections were a fun way to combine them
20:08 sri but this is not parameters, where we can always have multiple values
20:13 sri it's not exactly pretty in jquery either http://api.jquery.com/val/
20:14 nicomen can you point me to the discussion about val()?
20:14 sri https://github.com/kraih/mojo/issues/684
20:16 nicomen thanks ;)
20:32 basiliscos joined #mojo
21:00 neyasov joined #mojo
21:12 neyasov joined #mojo
21:19 good_news_everyon joined #mojo
21:19 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/Y1qV9w
21:19 good_news_everyon mojo/master b46d507 Sebastian Riedel: improved tap method in Mojo::Base to be able to call methods
21:19 good_news_everyon left #mojo
21:34 good_news_everyon joined #mojo
21:34 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/8gPZbA
21:34 good_news_everyon mojo/master 142efd8 Sebastian Riedel: better tap tests
21:34 good_news_everyon left #mojo
21:43 jberger egad, I step away for a few hours and you deprecate half of the framework!
21:45 jberger that said, I like the map and tap improvements
21:46 axlrose joined #mojo
21:47 hoppie joined #mojo
21:48 hoppie MCE will turn 2 years old in the next few days. Therefore, adding a touch to help make MCE 1.600 + Mojolicious beautiful. http://pastie.org/9692072
21:49 hoppie Adding the ->start method to all MCE models.
21:49 nicomen sri: would it what's an MCE?
21:49 hoppie This looks nicer than calling mce_loop { ... }.  The old API will still work.
21:50 hoppie MCE is Many-core Engine for Perl.
21:50 hoppie https://code.google.com/p/many-core-engine-perl/
21:51 nicomen ah
21:51 nicomen why did I ask sri... sorry about that
21:52 hoppie Although this will continue to work...  MCE::Loop::init { ... };  mce_loop { ... } <>;  It just needed something to look nicer with Mojo.
21:53 hoppie Thus, the reason for the start method.  MCE::Loop->init( ... ); MCE::Loop::start { ... } <>   (or)   MCE::Loop->start( sub { ... }, <> );
21:54 hoppie MCE wraps Mojo nicely for true multi-core parallelism for several use-cases.
21:54 hoppie Many workers, each worker many concurrency.
22:10 sri if you're redesigning the MCE api, it might be worth getting rid of the globals too
22:12 sri like the global max_workers setting
22:19 sri you don't have to go all OO with MCE->new(max_workers => 100)->loop(sub {...}, <>);, but maybe export customized functions with the configuration passed to import
22:21 sri (Mojolicious::Lite works that way, when you do "use Mojolicious::Lite" it custom builds all the exported functions for that one app)
22:22 sri global config on import always reminds me of Getopt::Long *shudders*
22:27 hoppie The 1.6 will not change the API too much. Maybe a rewrite for 2.0 -- but that is after Ruby MCE 1.0. The things I'm learning in Ruby will carry over. Thanks for your suggestion sri. Will take a look at Mojolicous::Lite. No promises.
22:28 hoppie I wished I remembered the module I followed when initially creating MCE. I followed the style.
22:28 hoppie At the time a newbie at creating a Perl module, etc.
22:29 hoppie There are just a few globals (package level).
22:29 sri that kind of configuration is actually pretty rare
22:29 hoppie ok.
22:30 sri personally, i only use one module that does it, Getopt::Long... and that has cause *a lot* of problems in the past... requiring workarounds in mojolicious
22:30 sri like this to reset all defaults https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Commands.pm#L31-L36
22:32 hoppie The few package global vars in MCE are somewhat like a constant allowing one to pass the value when loading the module. The value does not change afterwards.
22:32 sri if you're looking for api inspiration, i think perl6 has parallel map and grep
22:32 hoppie nice, will take a look.
22:35 hoppie Am happy that Perl6 has parallel map and grep.
22:37 Adura I remember talking about MCE when I was trying to get Mojo::IOLoop::ForkCall to work on Windows.
22:39 hoppie Adura: MCE defaults to threads on Windows automatically.
22:39 Averna joined #mojo
22:41 Adura I used the MCE example scripts and was never sure if things were going as intended. matmult_perl.pl does show > 100% CPU usage, though.
22:43 Adura Good to see a possible Mojo utilization of it, though.
22:45 Adura Not that I'd put production Mojo stuff on Windows, heh.
22:50 hoppie Recently, received a report from Greece where MCE is running in production on Windows (MCE 1.516+).
22:51 good_news_everyon joined #mojo
22:51 good_news_everyon [mojo] kraih tagged v5.57 at 04ed68d: http://git.io/0KdFWQ
22:51 good_news_everyon left #mojo
22:52 good_news_everyon joined #mojo
22:52 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/-hbTqQ
22:52 good_news_everyon mojo/master 1d7dd9b Sebastian Riedel: bump version
22:52 good_news_everyon left #mojo
22:53 Adura Kudos to the Perlers that make efforts on the MSWin32 front.
22:54 hoppie Adura: Was not easy at the time.
22:54 Adura I can imagine, hah.
22:59 sri hmm, pause seems to be having a problem
22:59 Adura I blame SSL3.
23:00 sri "The PAUSE indexer could not store the indexing result in the DB due the following error: C< Lock wait timeout exceeded; try restarting transaction >. Please report the case to the PAUSE admins at modules@perl.org."
23:09 neyasov joined #mojo
23:10 good_news_everyon joined #mojo
23:10 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/JlnxJQ
23:10 good_news_everyon mojo/master 5de54e0 Sebastian Riedel: better collection example
23:10 good_news_everyon left #mojo
23:15 sri nicomen: you specifically ignored my request to open new issues :(
23:16 sri nicomen: so, from me you won't be getting any feedback on it
23:46 hoppie thank you. came across this: http://jnthn.net/papers/2013-yapceu-conc.pdf
23:49 hoppie glad to see Perl6 having better support for parallelism.
23:50 hoppie Sorry to hear of the issue with PAUSE.

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