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

IRC log for #mojo, 2014-04-27

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

All times shown according to UTC.

Time Nick Message
00:08 mtj joined #mojo
00:12 sri stevan just pointed out that the DESTROY is actually not necessary :o
00:14 good_news_everyon joined #mojo
00:14 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/DcObRA
00:14 good_news_everyon mojo/master c7518f0 Sebastian Riedel: use a fieldhash for inside-out storage
00:14 good_news_everyon left #mojo
00:55 sri tempire: i need your opinion on promises and supplies!
00:57 jberger how does fieldhash accomplish that feat?
00:57 jberger (sorry I'm very in and out today)
00:58 jberger it must use some deep magic to hook on destroy
01:00 tempire Maybe I'm missing something; has the requirement of using weaken been resolved
01:00 tempire ?
01:00 sri jberger: yea, magic
01:00 tempire because making users use weaken is a no go
01:00 sri tempire: READ ALL THE THINGS
01:01 sri i have presented a way to make weaken go away earlier (seriously!)
01:01 sri but the catch is total api breakage for everything
01:01 sri literally, everything with a callback breaks
01:01 tempire supply->tap is a subscription
01:02 tempire I support the promises implementation.
01:02 sri yea, it's a level of indirection we need to hide away the callback from the evil circular references
01:02 tempire and supply is interesting.
01:02 tempire I'm just hesitant, particularly because I'm about to teach a course on mostly begin/end
01:03 tempire which would be followed the next day by your talk saying it's all going to go away
01:03 sri TELL ME WHAT TO DO
01:04 tempire I wonder how hard it would be to have begin/end distributed separately, built on top of promises/supplies
01:05 sri trivial, doesn't even need changes
01:05 tempire then I'm ok with it.
01:05 sri it's still all callbacks
01:05 tempire marcus/crab?
01:06 sri eventemitter and apis like Mojo::UserAgent are rather easy to convert... more tricky is http://mojolicio.us/perldoc/Mojo/IOLoop#timer
01:06 sri which has a callback *and* a return value
01:07 tempire I was just mocked at a ios conference about waiting for perl6
01:07 tempire *an
01:08 tempire I wanted to say, but you don't know what's happening RIGHT NOW
01:08 tempire I didn't
01:08 tempire but I wanted to.
01:09 Adura joined #mojo
01:09 Theano joined #mojo
01:11 Theano Hi! I would like to know how to extract parameters from an html post form (login.html.ep) to work on it inside Login.pm. I tried looking up some examples but I'm not sure at all to understand them.
01:11 tempire Theano: $self->param('my_param_name')
01:11 Theano oh
01:11 Theano thank you
01:11 Theano :)
01:16 Theano I get this error message : Undefined subroutine &GainXP::Login::param called at /usr/local/share/perl/5.18.2/Mojolicious.pm line 127.
01:19 tempire it's a Mojolicious controller method.
01:19 tempire You're calling it from some other object.
01:21 tempire interesting: https://www.coursera.org/course/reactive
01:24 dvinciguerra joined #mojo
01:25 Theano I had forgotten to put '$self->' in front of one of my 'param', thank you again
01:34 sri tempire: if we switch to promises we won't rush it for mojoconf, better make it the topic of the hackathon or so and release 5.0 after that
01:35 tempire I was assuming that
01:35 tempire a topic in the hackathon should be distributing begin/end as a distribution, then
01:35 * sri nods
01:36 tempire Although I don't really know what a hackathon is.
01:36 * tempire has never been to one
01:36 sri like pair programming... with 50 people :)
01:37 tempire pshaw
01:37 tempire when have you been out in public?
01:37 sri i can be copied from computer to computer!
01:39 sri i guess having the weaken problem only half solved means i won't be getting all that beer at mojoconf from batman :(
01:55 klapperl_ joined #mojo
01:55 sri ohoh
01:55 sri i might be wrong about Mojo::Supply
01:57 sri http://pastie.org/9116141 # basically how i imagined it
01:58 sri http://pastie.org/9116144 # could be used like this
01:59 sri but if course i overlooked that $ua can't be garbage collected
01:59 sri s/if/of/
02:02 sri bummer
02:05 sri (don't feel bad if you don't get why it doesn't work... i'm not sure either ;p)
02:10 sri oh, now i get it :)
02:12 sri promises and delays work because the closures are deleted after use, supplies can't ever work since the closure is permanent
02:12 sri *facepalm*
02:14 sri jberger, tempire, marcus, crab: i guess that changes everything again
02:14 sri we can solve weaken for callbacks that only get invoked once
02:14 sri not for eventemitter
02:18 jberger Nonblocking is hard...
02:18 jberger let's go sh ... ALL GLORY TO THE HYPNOTOAD!!!
02:28 sri but good i get it now... found a few new sources for leaks in delays
02:29 good_news_everyon joined #mojo
02:29 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/rcWXJQ
02:29 good_news_everyon mojo/master b8e21f3 Sebastian Riedel: fixed a few memory leaks in Mojo::IOLoop::Delay
02:29 good_news_everyon left #mojo
02:31 sri it's basically manual garbage collection
02:47 asarch joined #mojo
03:03 punter joined #mojo
03:05 beyondcreed joined #mojo
03:25 beyhugobah joined #mojo
03:25 beyhugobah yooo jo!
03:26 beyhugobah hows the thumbing ones nose at java?
03:26 beyhugobah I hate java and oracle
03:26 good_news_everyon joined #mojo
03:26 good_news_everyon [mojo] kraih tagged v4.95 at 3f9a3a6: http://git.io/kL2GIQ
03:26 good_news_everyon left #mojo
03:27 beyhugobah is there a free blog on mojo?
03:27 beyhugobah livejournal is a bit annoying
03:28 cpan_mojo Mojolicious 4.95 by Sebastian Riedel - http://metacpan.org/release/SRI/Mojolicious-4.95
03:28 good_news_everyon joined #mojo
03:28 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/mvBZ_A
03:28 good_news_everyon mojo/master 0c01c29 Sebastian Riedel: bump version
03:28 good_news_everyon left #mojo
03:32 beyhugobah sebastian shaw one of my favorite comicbook characters
03:52 beyhugobah so mojo vs dancer and catalyst?
03:52 beyhugobah why mojo m0ar win?
03:55 sri because we don't use leetspeak
04:04 beyhugobah lol
04:04 beyhugobah cmon I was trying to be hipster
04:04 beyhugobah guess i fialed
04:14 sri you fialed
04:15 sri tempire: ->begin() with splice is released now, you can use that to explain it now in your training :)
04:16 sri don't think promises will make it now that we know supplies don't work
04:18 sri at least we got pretty decent leak protection in delays now
04:24 sri hahaha, and i just discovered that you can already use delays as leak guards
04:24 beyhugobah left #mojo
04:25 sri http://pastie.org/9116315 # one step delayed with a ->begin
05:34 irq joined #mojo
06:07 irq_ joined #mojo
06:38 mire_ joined #mojo
06:48 met joined #mojo
06:53 Theano left #mojo
06:55 Vandal joined #mojo
07:13 babl joined #mojo
07:46 dod joined #mojo
07:59 sujithm joined #mojo
08:37 meshl joined #mojo
08:57 meshl joined #mojo
08:57 igorsutton joined #mojo
09:09 basiliscos joined #mojo
09:11 denis_boyun joined #mojo
09:16 sujithm joined #mojo
09:47 sujithm joined #mojo
10:39 d4rkie_ joined #mojo
10:43 eugen joined #mojo
10:53 punter sri: what are supplies and why are they so important that Promises will go down the drain?
10:53 punter I'll check the room's logs
10:58 d4rkie joined #mojo
12:05 meshl joined #mojo
12:09 punter Why should promises suffer, now that Supplies won't make it?
12:12 asarch joined #mojo
12:19 irq joined #mojo
12:39 sh4 joined #mojo
12:39 sri because most of our callbacks get called multiple times and do not work with promises
12:40 sri promises still require huge breaking changes, but are now worth much less, since they do not fix the weaken problem on their own
12:45 sri oh, since recent delay improvements we can actually change what Mojo::IOLoop->delay(sub {...}) does
12:46 sri doesn't have to be a subscriber to the finish event anymore
12:46 sri it can just be a single step and not a single test breaks
12:48 sri advantage is that the single closure passed to Mojo::IOLoop->delay(sub {...}) gets leak protection and a little more consistency
12:58 good_news_everyon joined #mojo
12:58 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/mABFow
12:58 good_news_everyon mojo/master 01c7093 Sebastian Riedel: improved Mojo::IOLoop to use Mojo::IOLoop::Delay more consistently
12:58 good_news_everyon left #mojo
13:08 sri it works because the first step doesn't get called right away, but we internally use a Mojo::IOLoop->next_tick($delay->begin) to trigger the first step automatically... which you can "delay" with new $delay->begin calls :)
13:09 * sri really likes the consistency
13:12 sri fun side effect, you can now do this for leak protection http://pastie.org/9117162
13:14 dvinciguerra joined #mojo
13:19 gryphon joined #mojo
13:34 punter Will promises be re-considered on Perl 6 Mojolicious?
13:37 abra joined #mojo
13:40 sri yes
13:40 sri perl6 is a whole different beast, we can do all kinds of crazy things there
13:40 punter good
13:42 sri there will be very few callbacks in perl6
13:42 sri since we can just use threads and coroutines
13:43 sri my $result = await $promise;
13:43 sri whole new world
13:45 sri if i was redesigning mojolicious for perl6 i would prolly start with some kind of akka-ish core
13:45 sri very very different
13:47 punter akka?
13:47 punter a, i googled it
13:49 sujithm joined #mojo
13:53 mire_ joined #mojo
13:54 rem_lex|pivo joined #mojo
14:36 cpan_mojo Mojo-Redis 0.9926 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojo-Redis-0.9926
14:42 sri https://github.com/stevan/promises-perl/pull/32 # just gonna make Promises less prone to leaks
14:49 dod joined #mojo
15:07 abra joined #mojo
15:35 dvinciguerra joined #mojo
16:02 mire_ joined #mojo
16:12 sri hmmm
16:12 sri i have kinda ignored the portability aspect of delays
16:12 sri in regards to promises
16:17 good_news_everyon joined #mojo
16:17 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/F20Tsw
16:17 good_news_everyon mojo/master 7f55448 Sebastian Riedel: use steps consistently for synchronization of events in examples
16:17 good_news_everyon left #mojo
16:17 sri the events are really an implementation detail, i like the consistency of using steps for everything
16:23 good_news_everyon joined #mojo
16:23 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/nnl0TQ
16:23 good_news_everyon mojo/master 39d3585 Sebastian Riedel: more tests for single step delay
16:23 good_news_everyon left #mojo
17:34 beyondcreed joined #mojo
18:07 janus joined #mojo
18:11 BeDa joined #mojo
18:11 maxhq joined #mojo
18:14 sujithm joined #mojo
18:22 denis_boyun joined #mojo
18:38 denis_boyun_ joined #mojo
19:49 * sri yawns
19:54 punter From within the around_action hook, am I allowed to call $next->() twice? I need it, to cover the case of MySQL deadlocks happening (if deadlock happens, I have to repeat the route)
20:00 babl joined #mojo
20:01 babl_ joined #mojo
20:02 batman punter: 1. sounds like a really bad design 2. the render has probably run, so you can't
20:02 babl joined #mojo
20:02 batman you should fix the deadlock issue.
20:02 batman and not by using http://www.prevention.com/sites/default/files/imagecache/410px-width/duct-tape-2-410x290.jpg
20:03 punter Why is it a bad design? The book "high performance mysql" says we should detect deadlocks and handle them. How do you suggest I handle them? The renderer won't have run.
20:03 good_news_everyon joined #mojo
20:03 good_news_everyon [mojo] kraih tagged v4.96 at 33421e0: http://git.io/slSA2Q
20:03 good_news_everyon left #mojo
20:04 dotandimet joined #mojo
20:04 punter batman ^^
20:04 batman because your model should probably handle the deadlocks instead of the around_action hook
20:05 cpan_mojo Mojolicious 4.96 by Sebastian Riedel - http://metacpan.org/release/SRI/Mojolicious-4.96
20:05 good_news_everyon joined #mojo
20:05 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/YBP2Hw
20:05 good_news_everyon mojo/master 05ad706 Sebastian Riedel: bump version
20:05 good_news_everyon left #mojo
20:05 punter I believe I don't get what you're saying. A deadlock causes a runtime exception (so an exception from the eval{ $next->() }) - How else can that be handled???
20:05 sri ok, no more releases before mojoconf ;p
20:05 sri (maybe one... but really no more!)
20:06 punter batman ^^ - and my model is a bunch of classes.
20:06 punter RDBO classes
20:06 punter I'm not using MongoDB here, ok?
20:06 batman ignore me. i misread your first statement :(
20:06 punter whatever
20:06 purl whatever is probably often modifying the caller namespace (the module/file you did "use ....;" from)
20:07 batman what does MongoDB have to do with anything?
20:07 punter I don't know.
20:08 punter So, let me ask again: Am I allowed to call $next->() twice? Will the same subroutine get executed again?
20:08 batman did you know you can wrap eval{} inside eval{} ?
20:08 punter yes
20:08 punter do you have an example website made with Mojolicious & MySQL?
20:08 batman sub my_action { my $c = shift; ... do { eval { $db->do_weird_deadlock_stuff } } while $@;
20:09 batman ^ that's just evil btw, but at least better than calling $next->() twice imo
20:09 punter why is it less evil?
20:09 punter It looks very complicated, if I'd have to write all this in every one of my action subroutines
20:10 batman because the around_... hook doesn't know about databases or anything.
20:10 punter Does it have to know?
20:10 batman no. that's why i told you that you should fix the model instead.
20:10 dotandimet joined #mojo
20:11 punter Can't I teach my around_action sub about databases?
20:11 sri around_* hooks are one of the most powerful extension mechanisms in mojolicious, using them for application logic is never a good idea
20:11 punter Why not good?
20:11 sri they are for adding new mojolicious features, application wide
20:12 punter Handling deadlocks is application-wide
20:12 batman punter: because deadlock is _not_ an application issue
20:12 batman it's a backend issue.
20:12 * batman gives up
20:14 punter What bad things can happen if I handle deadlocks in around_action?
20:17 sri reminds me that maybe we shouldn't encourage this stuff http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Streaming_multipart_uploads
20:18 sri although it's a cool feature, and i'm not sure what's a better way to do it
20:19 sri perhaps the hook should check the path and do the ->on() dance directly
20:25 ua_ joined #mojo
20:34 punter in case of deadlock, the entire transaction will have been rolled-back. In which case it's not enough to repeat just $db->do_weird_deadlock_stuff. I'd have to $db->begin, and redo all of the db actions (UPDATEs, INSERTs) up to the point of the deadlock
20:34 punter so I don't think there's another way
20:35 punter what if there's two possible deadlock points in an action? How many evals would I need to handle that?
20:40 cooper joined #mojo
20:41 sujithm joined #mojo
20:48 Theano joined #mojo
20:52 Theano Hi! I'm trying to get the Mojolicious::Plugin::Mail module but it always fails. What shall I check first when a module installation fails at first test? I'm using Ubuntu 14.04 on a Virtual Machine on a Mac (Mac OS X 10.9.2).
21:08 btyler joined #mojo
21:11 meshl joined #mojo
21:25 sri Theano: contact the author
21:26 Theano ok, thank you
21:28 Theano in the mean time is there anything else I can use instead of this plugin? (it's for school work)
21:31 meshl joined #mojo
21:38 meshl joined #mojo
21:55 meshl joined #mojo
21:59 ua_ joined #mojo
22:01 mudler joined #mojo
22:09 mudler joined #mojo
22:44 d4rkie joined #mojo
22:54 dvinciguerra joined #mojo
23:29 Adura joined #mojo
23:39 zivester joined #mojo

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