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

IRC log for #mojo, 2014-04-25

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

All times shown according to UTC.

Time Nick Message
00:38 shmuel joined #mojo
01:05 laouji joined #mojo
01:23 good_news_everyon joined #mojo
01:23 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/7fN9fQ
01:23 good_news_everyon mojo/master 5e24045 Sebastian Riedel: improved Mojo::IOLoop::Server to reuse cipher list from IO::Socket::SSL
01:23 good_news_everyon left #mojo
01:24 sri better to stay up to date that way
01:40 laouji_ joined #mojo
01:41 hugaooongah joined #mojo
01:46 hugaooongah all hail!
01:46 hugaooongah lol
01:46 hugaooongah so does async make everything faster?
01:54 shmuel hugaooongah: async won't make individual request faster, but makes the server able to handle more requests together faster.
01:58 sri not faster, scale better
01:58 basiliscos joined #mojo
02:00 klapperl_ joined #mojo
02:01 d4rkie_ joined #mojo
02:28 russum joined #mojo
02:28 avenj joined #mojo
02:33 d4rkie joined #mojo
03:04 btyler joined #mojo
03:29 jberger_ joined #mojo
03:30 jberger_ Async can make individual requests faster ... if they rely on multiple non related high latency requests to build the response
03:32 jberger_ http://blogs.perl.org/users/joel_berger/2013/11/writing-non-blocking-applications-with-mojolicious-part-2.html
03:32 jberger_ Non related meaning they can be requested in parallel
03:51 balazs joined #mojo
04:02 sri that's true, but i always interpret that question as referring to "raw performance", where blocking syscalls in many processes are simply faster
04:10 sri btw. still looking for creative method names for $delay->begin and $delay->begin(0)
04:19 irq joined #mojo
04:35 jberger__ joined #mojo
04:36 jberger_ joined #mojo
04:54 jberger__ joined #mojo
05:04 laouji joined #mojo
05:33 dod joined #mojo
05:42 jberger_ joined #mojo
05:46 sujithm joined #mojo
05:55 sujithm_ joined #mojo
06:27 denis_boyun joined #mojo
06:43 eugen joined #mojo
06:46 dod joined #mojo
07:03 eseyman joined #mojo
07:04 shmuel joined #mojo
07:23 Vandal joined #mojo
07:35 neyasov_ joined #mojo
07:37 sujithm joined #mojo
07:38 dod joined #mojo
07:44 rawler joined #mojo
07:47 hugaooongah hm
08:01 sugar_ joined #mojo
08:04 d4rkie_ joined #mojo
08:07 fhelmber_ joined #mojo
08:21 dod joined #mojo
08:22 trone joined #mojo
08:30 maxhq joined #mojo
08:32 dod joined #mojo
08:34 edestler joined #mojo
08:38 irq joined #mojo
08:42 jberger joined #mojo
08:51 laouji joined #mojo
08:58 neyasov_ joined #mojo
08:59 d4rkie joined #mojo
09:03 basiliscos joined #mojo
09:19 sujithm joined #mojo
09:19 meshl joined #mojo
09:31 sujithm joined #mojo
09:57 laouji joined #mojo
10:06 denis_boyun joined #mojo
10:12 laouji_ joined #mojo
10:17 sujithm joined #mojo
10:29 mire_ joined #mojo
10:32 neyasov_ joined #mojo
10:37 Jonis joined #mojo
10:50 Jonis joined #mojo
10:56 alnewkirk joined #mojo
10:58 neilhwatson joined #mojo
11:06 sugar__ joined #mojo
11:26 sujithm joined #mojo
11:32 ver joined #mojo
11:33 d4rkie joined #mojo
11:50 d4rkie joined #mojo
12:11 Jonneh_ joined #mojo
12:39 batman Mojo::Redis idea: https://github.com/marcusramberg/mojo-redis/issues/27
12:52 asarch joined #mojo
12:56 Jonneh joined #mojo
13:03 neyasov_ joined #mojo
13:06 neyasov__ joined #mojo
13:12 neyasov_ joined #mojo
13:14 sujithm joined #mojo
13:46 btyler joined #mojo
13:53 rem_lex|pivo joined #mojo
13:57 D4RK-PH0ENiX joined #mojo
14:08 sh4 joined #mojo
14:12 zivester joined #mojo
14:15 sri hmm... if we don't add something in 5.0... maybe we can remove something :D
14:16 * sri wonders if the charset plugin still makes sense these fays
14:16 bluescreen joined #mojo
14:18 neyasov_ joined #mojo
14:37 batman it sucks that $cb is optional in Mojo::Redis
14:38 batman i don't think there's anyway to make it back compat without breaking anything
14:38 batman uhm.. that sentence did not make any sense :D
14:38 gryphon joined #mojo
14:38 sri can confirm, didn't understand a word
14:39 batman oops! wrong window as well :(
14:39 stephan48 g81
14:39 sri ah, you mean $cb is optional for non-blocking operations too
14:39 sri so you can't use it as an indicator for blocking
14:40 batman exactly.
14:40 batman i'm considering Mojo::Reeeeeedis or something to clean it up ;)
14:41 sri i would go with a Mango::Bulk-ish solution
14:41 sri but it's a breaking change
14:42 sri $redis->set(foo => 'bar') # blocking
14:42 sri $redis->set(foo => 'bar' => sub {...}) # non-blocking
14:42 batman yeah. makes sense, but i don't think this is the time to break Mojo::Redis
14:42 batman it's too old
14:42 sri $redis->bulk->set(foo => 'bar')->set(bar => 'baz')->execute(sub {...}) # non-blocking bulk
14:42 batman i would rather make a new which also gets my ($redis, $err, $data) in the callback
14:43 sri $redis->bulk->set(foo => 'bar')->set(bar => 'baz')->execute # blocking bulk
14:43 sri maybe even have a blocking bulk operation
14:43 sri batman: sounds good
14:44 batman Mojo::rEdIS # the name need to be awesome, hehe
14:44 sri if you need inspiration, i like the node.js client https://github.com/mranney/node_redis
14:44 batman Mojo::Redis2 is awful imo
14:44 batman (the name)
14:45 batman sri: how do you feel about me (ab)using the on() api? $redis->on(message => "some:channel:name" => sub { ... }); ?
14:45 sri problem is if you go with a cutesy name now, everybody searching for "mojo redis" will find the old version
14:46 sri but i guess a deprecation warning would solve that
14:46 sri batman: don't
14:46 batman yeah. will mark that as deprecated though. remove all SYNOPSIS and DESCRIPTION
14:46 batman sri: too late
14:46 batman i'm doing that in both Mojo::Redis and Mojo::APNS (ref on())
14:46 sri eeeeeeeep
14:47 batman https://metacpan.org/pod/Mojo::Redis#message
14:47 batman i really like it :)
14:50 hesco joined #mojo
14:51 batman would be nice to know why it's messed up...
14:51 batman i understand that it's not the way SUPER::on() works, but it's still compatible with SUPER::on()
14:52 batman i consider on() to add a callback which is triggered on an event, and a pubsub message is an event imo
14:54 sri this is what i would do https://github.com/mranney/node_redis#publish--subscribe
14:54 mire_ joined #mojo
14:55 sri hahahaha... it even does the multi/bulk thing exactly like i wanted it https://github.com/mranney/node_redis#clientmulticommands
14:56 balazs joined #mojo
14:57 batman i don't like it, since it takes over the connection. got pretty much the same here: https://metacpan.org/pod/Mojo::Redis::Subscription
14:57 batman i would probably like it more, if leaking wasn't so incredible easy in perl :(
14:58 moritz it's just the mixture of many callback closures with OO that makes those leaks so easy and so hard to detect
14:58 sri well, you can basically find all my opinions in Mango
14:59 moritz in most "normal" application code, leaks are usually not a problem
14:59 sri what's "normal"?
14:59 purl i guess "normal" is relative
15:00 batman it think it's not the same as normal,.
15:00 batman since normal is hard, "normal" is probably easy
15:01 sri batman: i just use a connection pool, if one of those connections gets taken over for pub/sub it's just busy and not available for the pool
15:01 sri all operations are round robin on the connection pool though
15:03 sri moritz: but yea, it's objects and callbacks that's the big problem... one of the reasons promises don't work so well in perl5
15:03 * sri is still disappointed about that
15:05 * batman wonder why promise() is harder than delay()
15:05 batman i've looked at the code, but i don't get it :(
15:05 sri because of the invocant
15:06 batman sri: hm... connection pool... *thinking*
15:06 sri delay makes it easy to pass around the invocant, but with promises it's against the whole concept
15:06 batman right. i still don't really spot it.
15:06 batman have to look at it later.
15:06 sri you *can* pass around the invocant with promises too... but it's very awkward
15:06 batman invocant = $delay?
15:07 sri $foo->bar()
15:07 sri $foo is the invocant
15:07 sri $foo->$cb
15:07 sri and again
15:07 batman like $ua?
15:07 sri yes, the object the method is called on
15:08 sri if we pass it to the callback, we don't have to worry about circular references
15:08 batman what would happen if you add promise functionality to the Mojo::EventEmitter ?
15:08 nic BOOOOOM!!!
15:08 sri i don't see a connection between those
15:09 sri anyway, the conceptual problem with promises is that they are supposed to stand for *one* value that will be assigned in the *future*
15:11 sri but to get the same circular reference protection you get from callbacks and delays, you'd have to store the invocant with the promise too
15:11 batman my brain is busted. trying to solve a hard problem the easy way all day long.
15:11 batman need a break
15:12 sri and it can get really awkward when you have a chain like $ua operation -> something else -> $ua operation
15:13 sri how would you get $ua from the first to the third thenable?
15:14 sri delays have a sledgehammer that always works now with $delay->data, just put something in there and weaken it... and you're fine all the time
15:15 * sri still would like to hear from mst regarding leaks in promises... since he has been such a vocal proponent
15:16 sri https://gist.github.com/kraih/11276761 # the problem
15:16 * batman wonder if there could be some evil PadWalker thing that automatically did weaken on $self in caller...
15:16 batman *bbl*
15:42 bluescreen_ joined #mojo
15:43 cmihai joined #mojo
15:44 d4rkie joined #mojo
15:57 beyondcreed joined #mojo
16:06 jim joined #mojo
16:09 mport joined #mojo
16:10 irq joined #mojo
16:10 denis_boyun joined #mojo
16:20 romel joined #mojo
16:27 romel hello everyone. trying to catch everyting under /admin (e.g including /admin/) with a route and pass it through a callback: http://pastebin.com/Qgs5VZdw . unfortunately i receive a 302 code only for urls like /admin/dashboard when user is unauthenticated but for /admin/ or /admin it doesn't work
16:28 romel i certainly do something wrong but can't get what exactly
16:33 cmihai joined #mojo
16:37 sri http://mojolicio.us/perldoc/Mojolicious/Lite#Optional_placeholders
16:47 romel sri: it's a shame but i can't figure out how to apply optional placeholders here. should i use something like route('/admin/:controller/:action/:id') ?
16:48 sri where did you learn ->get('*')?
16:48 romel i tried many different approaches, it was just a last try :)
16:49 romel i think it looks lame
16:49 sri that's the problem, you can't understand optional placeholders if you don't understand placeholders
16:50 sujithm joined #mojo
16:51 romel okay, i see.
16:51 romel thanks
16:52 nic There's lots of flexibility in how you declare routes, but it pays to follow examples from the docn
16:53 nic romel: Another approach which would be easy to add... redirect /admin to /admin/main
16:54 nic (If you're app isn't modular then that doesn't look v good)
16:57 romel thank you, nic. i have a package MyApp::Admin if that's what you mean with 'modular' (yes, i suck in terminology as well :))
16:58 nic I guess I'm talking about richness of the app
16:58 nic If /admin has 12 sub-modules then directing them to /admin/main looks ok IMO
16:59 nic but if it's just one or two screens then adding 'main' would look daft
16:59 romel okay, i see
17:16 cmihai joined #mojo
17:19 dod joined #mojo
17:25 ua_ joined #mojo
17:37 cmihai joined #mojo
17:54 denis_boyun_ joined #mojo
17:56 disputin joined #mojo
18:16 irq joined #mojo
18:45 sri maybe $delay->begin would be more intuitive if the arguments were ($start, $offset)
18:45 sri with a default of $start = 1 and no offset
18:51 meshl joined #mojo
19:56 cfedde seconds?
19:56 purl it has been said that seconds is second
19:57 sri http://mojolicio.us/perldoc/Mojo/IOLoop/Delay#begin
20:23 jberger_ joined #mojo
20:23 jberger_ sri begin takes a slice spec, I love it
20:23 jberger_ Easier to document and explain
20:24 jberger_ And perhaps it might even be more useful on occasion
20:25 jberger_ Slices the callback arguments seems much simpler to explain than removes the callback invocant
20:47 sri jberger: i do have a patch
20:47 sri http://pastie.org/9113060 # review maybe
20:48 * sri pokes tempire too
20:49 sugar joined #mojo
20:49 sri http://pastie.org/9113060#44-48 # more elegant way to write this would also be welcome
20:50 sri i especially wanted $delay->begin(0, 0) to work, for capturing no arguments :)
20:53 sri jberger: it's splice though, not slice
20:54 stryx` joined #mojo
21:01 maxhq joined #mojo
21:09 sri POKE ALL THE DEVS
21:15 basiliscos joined #mojo
21:26 mire_ joined #mojo
21:30 bluescreen_ joined #mojo
21:35 * tianon spontaneously combusts
21:35 bowtie joined #mojo
21:44 sri :o
22:02 jberger_ joined #mojo
22:03 denis_boyun joined #mojo
22:03 jberger__ joined #mojo
22:11 btyler joined #mojo
22:31 davido__ joined #mojo
22:36 good_news_everyon joined #mojo
22:36 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/RsXX8w
22:36 good_news_everyon mojo/master 27cbd2e Sebastian Riedel: improved Mojo::IOLoop::Delay to allow argument splicing
22:36 good_news_everyon left #mojo
22:36 * sri dictates!
22:37 sri hope the documentation brings the point across http://mojolicio.us/perldoc/Mojo/IOLoop/Delay#begin
22:39 d4rkie joined #mojo
22:41 d4rkie joined #mojo
22:42 d4rkie_ joined #mojo
22:50 davido___ joined #mojo
23:09 d4rkie joined #mojo
23:16 zivester joined #mojo
23:23 batman +1 on splice
23:31 jberger Yeah that's so much more readable
23:31 jberger sri++
23:32 * jberger extinguishes tianon
23:33 tianon :D
23:34 * jberger just loves that the change is naturally backward compatible
23:34 jberger so rarely works that way
23:35 sri \o/
23:40 tempire sensible
23:40 * tempire approves
23:47 ua joined #mojo

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