Camelia, the Perl 6 bug

IRC log for #mojo, 2013-04-19

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

All times shown according to UTC.

Time Nick Message
00:08 shmuel joined #mojo
00:08 ka2u joined #mojo
00:52 hesperaux_ joined #mojo
01:08 egopro joined #mojo
01:09 hotsnow joined #mojo
01:09 mire joined #mojo
01:17 xaka joined #mojo
01:27 ka2u joined #mojo
01:32 d4rkie joined #mojo
01:52 cy joined #mojo
01:57 Meiermann joined #mojo
01:58 hide left #mojo
02:27 hesperaux__ joined #mojo
02:29 hesperaux joined #mojo
02:31 jb360 joined #mojo
02:45 d4rkie joined #mojo
02:54 preflex_ joined #mojo
03:16 rem_lex| joined #mojo
03:43 hesperaux_ joined #mojo
03:48 hotsnow joined #mojo
04:06 egopro joined #mojo
04:07 egopro_ joined #mojo
05:03 ka2u joined #mojo
05:17 davido joined #mojo
05:18 jberger_ joined #mojo
05:29 denisboyun joined #mojo
05:53 ver joined #mojo
06:20 keedi joined #mojo
06:22 Mike-PerlRecruiter_ joined #mojo
06:29 shmuel joined #mojo
06:30 dod joined #mojo
06:30 dod joined #mojo
07:00 dpetrov_ joined #mojo
07:01 dod joined #mojo
07:01 Vandal joined #mojo
07:13 throughnothing joined #mojo
07:36 dod joined #mojo
07:45 suy joined #mojo
07:49 Nei how can I do something in the child when hypnotoad spawns it, from a mojolicious::lite app?
08:07 jzawodn joined #mojo
08:23 ObseLeTe joined #mojo
08:32 jpn joined #mojo
08:56 alexko joined #mojo
09:49 yakudza joined #mojo
09:56 arthas joined #mojo
10:24 maxhq joined #mojo
10:39 cy joined #mojo
10:40 Britzel_ joined #mojo
11:15 ACE joined #mojo
11:15 ACE_ joined #mojo
11:18 whitebook joined #mojo
11:44 cy joined #mojo
11:57 yakudza_ joined #mojo
11:58 Kripton joined #mojo
12:32 sin1969 joined #mojo
12:38 sin1969 joined #mojo
12:39 whitebook joined #mojo
12:43 diegok Nei: what you mean by do something in the child?
12:44 diegok Nei: what you're trying to do? :)
12:46 moltar joined #mojo
12:49 sweet_kid joined #mojo
12:50 bowtie joined #mojo
12:51 gryphon joined #mojo
12:55 cy joined #mojo
13:06 entro joined #mojo
13:06 entro hi all
13:11 Nei diegok: thanks for asking, for example I want to run some method that creates a persistent pipe for each child
13:11 sweet_kid hi :)
13:12 diegok hm... you mean, a pipe to make childs to talk each other?
13:13 Nei no just one helper program for each child
13:13 Nei not to each other
13:14 diegok a helper thats is called the same but behaves different?
13:14 Nei you could equally abstract it as some "per child object creation"
13:14 diegok if you define a helper in your app you have that helper in all your forks...
13:14 Nei if I open a filehandle in the main program it will be shared to all forks
13:14 Nei not nice
13:15 Nei if I open it per request I cannot optimise it to stay around in each process
13:15 diegok well, you can use a global to stash the object and the first time it gets called in each child you just create a new one and store there.
13:16 Nei I see there is some reference to "spawn" in the prefork server which hypnotoad presumably uses, I'm just not sure how to make use of it from my mojolicious::lite app
13:16 diegok that's how I connect to external services like redis.
13:17 diegok Hm.. but then you don't use hypnotoad...
13:18 sin1969 left #mojo
13:18 Nei I just do "hypnotoad myapp.pl" as shown in the example
13:18 diegok hypnotoad is build around prefork so you can do that ^
13:19 Nei now would you know how  I connect something to the spawn signal
13:19 Nei I think it should work basically like mod_perl's child init handler but the docs arent quite clear to me
13:19 diegok If I understand correctly, what you need is to use a global to keep your object per child alive and setting it the first time you call your helper.
13:20 Nei I want to call it when the worker threads are forked but I don't understnad how to connect to that event
13:20 diegok What I understand is that you can't. But not sure.
13:22 Nei thanks for your opinion
13:22 diegok Those are the events you can attach to: https://metacpan.org/module/Mojolicious#hook
13:24 Nei I think I just need to get the reference for the prefork server from my app
13:25 diegok Why you don't like my proposed solution? (just curious)
13:26 Nei from what I can see it would delay the first request
13:30 Nei also I don't understand why something that fundamental isn't easily possible ;)
13:30 diegok Nei: yes, it will.
13:31 Nei I don't like bundling object initialisation to eventual, externally induced, request patterns, it just doesn't make sense
13:31 diegok What takes SO long to construct?, do you need to read something very large in memory?
13:32 Nei yes I want to set up an expensive rendering pipeline but after that it can talk to me with stdio rather quickly
13:32 diegok well... if you don't have that "external event" you don't even need that initialization :)
13:33 diegok can't you prepare something in setup() time and then reuse from each child helper?
13:33 Nei well it doesn't like to be shared and even then that would become a bottleneck as each child would have to lock it
13:34 Nei I could just go single threaded
13:34 diegok hm...
13:36 Nei I suppose the main problem here is just terse documentation, I think it should be possible somehow
13:40 diegok Well, it should be possible to do if you poke around hypnotoad code: https://metacpan.org/source/SRI/Mojolic​ious-3.95/lib/Mojo/Server/Hypnotoad.pm But it it's not documented use to be a signal of non common problem...
13:41 diegok I can't help further without looking closer I guess.
13:41 patel joined #mojo
13:42 diegok The pattern I use (and most db/services plugins) is what I already told you :-/
13:43 btyler joined #mojo
13:45 Nei see for example http://search.cpan.org/~sri/Mojolicious​-3.95/lib/Mojo/Server/Prefork.pm#spawn
13:49 diegok Sure!, then you need to use Prefork instead of hypnotoad.
13:49 Nei I thought hypnotoad uses prefork
13:49 diegok and you can call some app method on each spawn i guess.
13:49 Nei but it seems I cannot add the ->on anywhere unless I write everything myself
13:49 diegok sure, look at the hypnotoad source :)
13:50 Nei because my app never gets to add any info based on the server
13:50 Nei which is ... also stupid
13:50 Nei hope I'm somehow mistaken
13:50 patel left #mojo
13:50 * Nei should go back to mod_perl *mumble*
13:51 diegok Nei: all my needs on doing some work before is covered on the server startup time and persistent objects/connections are created on the first request that call the helper...
13:52 diegok I do concat/minify on startup for example.
13:53 diegok and set filename to placed on templates
13:53 diegok s/to/to be/
13:53 Nei yea that's apparently what you're supposed to do
13:53 Nei so I could go down your path and "heat it up" with some wget requests
13:54 Nei but I mean, sriouzly?
13:54 diegok I would never go back to mod_* because I don't want to mix my app into a whole web server.
13:54 Nei not sure if hypnotoad workers have a lifetime?
13:55 Nei can always run apache behind apache ...
13:55 Nei but I werent here if I didnt also find the idea of a perl web thing appealing
13:55 diegok I think it's 1000
13:57 Nei that  would translate to one delayed pageload in 1000
13:57 diegok oh my!
13:58 diegok I can't even imagine a service with the problem you're describing.
14:10 ryozi joined #mojo
14:11 good_news_everyone joined #mojo
14:11 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/_umUCw
14:11 good_news_everyone mojo/master 3318bcb Sebastian Riedel: mention which Mojo::DOM methods return new Mojo::DOM objects (closes #480)
14:11 good_news_everyone left #mojo
14:16 denisboyun joined #mojo
15:02 mire joined #mojo
15:17 mattastrophe joined #mojo
15:31 hide joined #mojo
15:38 asarch joined #mojo
15:40 yakudza_ joined #mojo
15:56 basiliscos joined #mojo
15:58 sh4 joined #mojo
16:16 xaka joined #mojo
16:17 mst sri: about?
16:19 sri mst: sup?
16:19 mst sri: https://rt.cpan.org/Public/Dist​/Display.html?Name=Mojolicious
16:19 mst sri: notice you now have a bugtracker link :)
16:19 sri neat :)
16:19 mst sri: inspired by schmorp, implemented by idn, sponsored by shadowcat :)
16:19 sri we never had any trouble since metacpan always linked to the right one
16:20 sri shadowcat++
16:20 duncanthrax joined #mojo
16:23 jberger hey, thats cool!
16:23 jberger shadowcat++, idn++
16:24 mst bp++ # helped with feedback, and got it deployed
16:24 jberger anyone_involved++
16:24 jberger thats really nice
16:29 Kripton joined #mojo
16:45 labrown joined #mojo
16:46 jpn joined #mojo
17:00 d4rkie joined #mojo
17:17 bc547 does anyone know what these errors mean? (I'm using Mojo::UserAgent) http://pastebin.com/E8NbHW6e
17:21 sri that stuff gets cleaned up in the wrong oder during global destruction
17:24 sri it shouldn
17:24 sri argh
17:24 sri it shouldn't really happen because of https://github.com/kraih/mojo/blob​/master/lib/Mojo/UserAgent.pm#L178
17:25 bc547 sri: i just noticed the error disappears when I create the UA object on another location in the code
17:26 sri not much i can do though if the problem can't be replicated
17:26 sri it's harmless, but annoying
17:27 bc547 sri: I get the error each time I run that code
17:27 sri well, if you can turn it into a minimal test case (oneliner), let me know
17:28 bc547 sri: I'm trying... but no success for now. (the original code is 90 lines). I'll let you know if I find something minimal
17:41 cy joined #mojo
18:17 abra joined #mojo
18:24 Mike-PerlRecruiter_ joined #mojo
18:51 good_news_everyone joined #mojo
18:51 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/mwdWUQ
18:51 good_news_everyone mojo/master 6da36db Sebastian Riedel: mention that some Mojo::DOM methods can return undef
18:51 good_news_everyone left #mojo
19:05 good_news_everyone joined #mojo
19:05 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/5tU8Yg
19:05 good_news_everyone mojo/master 8519c0d Sebastian Riedel: mention that the DOM structure is very dynamic
19:05 good_news_everyone left #mojo
19:32 hesperaux_ joined #mojo
20:05 sweet_kid joined #mojo
20:09 sweet_kid joined #mojo
20:11 njlg joined #mojo
20:18 mrphilov joined #mojo
20:29 denisboyun joined #mojo
20:33 moltar joined #mojo
21:40 mire joined #mojo
21:53 njlg joined #mojo
21:59 good_news_everyone joined #mojo
21:59 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ZL7y7g
21:59 good_news_everyone mojo/master 97f3e1d Sebastian Riedel: more consistent rendering examples
21:59 good_news_everyone left #mojo
22:12 hrupp joined #mojo
22:25 bpmedley bc547: Is the code referecing a public website that you can paste?
22:33 komodo joined #mojo
22:39 mattastrophe joined #mojo
22:49 mattastrophe joined #mojo
22:54 komodo1 joined #mojo
23:00 komodo joined #mojo
23:06 asarch joined #mojo
23:08 sri hmmmm
23:11 ka2u joined #mojo
23:15 good_news_everyone joined #mojo
23:15 good_news_everyone [mojo] kraih created portable_commands (+1 new commit): http://git.io/nk2JIg
23:15 good_news_everyone mojo/portable_commands a593c4c Sebastian Riedel: detect encoding and make portable commands easier
23:15 good_news_everyone left #mojo
23:15 sri it's just an experiment
23:16 sri couldn't think of good names for print/say/warn methods
23:16 travis-ci joined #mojo
23:16 travis-ci [travis-ci] kraih/mojo#492 (portable_commands - a593c4c : Sebastian Riedel): The build passed.
23:16 travis-ci [travis-ci] Change view : https://github.com/kraih/mojo/commit/a593c4ce1342
23:16 travis-ci [travis-ci] Build details : http://travis-ci.org/kraih/mojo/builds/6484817
23:16 travis-ci left #mojo
23:16 sri making commands portable is a PITA
23:18 sri currently the get command is utf-8 only, the routes command ascii only
23:18 sri jberger, marcus, tempire, crab: something to think about
23:21 sri perl -Ilib -Mojo -E 'use utf8; a("/☃" => {text => q{<div id="☃">Snowman</div>}})->start' routes
23:22 sri perl -Ilib -Mojo -E 'use utf8; a("/☃" => {text => q{<div id="☃">Snowman</div>}})->start' get "/☃" "#☃"
23:22 sri some oneliners to play with
23:28 sri perhaps Akron might care as well
23:28 sri and memowe
23:43 good_news_everyone joined #mojo
23:43 good_news_everyone [mojo] kraih pushed 1 new commit to portable_commands: http://git.io/obxODQ
23:43 good_news_everyone mojo/portable_commands 47274a8 Sebastian Riedel: added auto_encode method to Mojolicious::Command
23:43 good_news_everyone left #mojo
23:44 sri https://github.com/kraih/mojo/co​mpare/master...portable_commands
23:45 sri more versatile solution
23:56 good_news_everyone joined #mojo
23:56 good_news_everyone [mojo] kraih pushed 1 new commit to portable_commands: http://git.io/WCjr_Q
23:56 good_news_everyone mojo/portable_commands 6ecadc2 Sebastian Riedel: small tweaks
23:56 good_news_everyone left #mojo
23:59 good_news_everyone joined #mojo
23:59 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/I-aB0A
23:59 good_news_everyone mojo/master 30ddb4b Sebastian Riedel: fixed small encoding bug in routes command
23:59 good_news_everyone left #mojo

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