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

IRC log for #mojo, 2017-05-15

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

All times shown according to UTC.

Time Nick Message
00:13 punter joined #mojo
00:16 punter Can some Mojo::* module help me with opening "shellcommand.sh |" and reading the output non-blocking?
00:16 punter maybe Mojo::IOLoop::Stream ?
00:29 punter Actually what I want is to grab the shellcommand's output in real-time
00:29 punter is that possible with Mojo?
00:32 punter What I get when I open $fh, "... |" in ordinary perl (no mojo or event loops) is that the loop in while(my $line = <$fh>) {...} gets executed many times but only in the end, after the shellcommand has finished executing
00:39 punter found the solution. thanks!
00:49 punter (perl scripts, when outputing to something other than terminal, don't output their output line-by-line, unless autoflush(1))
01:06 tchaves joined #mojo
01:30 abracadaniel joined #mojo
02:13 noganex joined #mojo
03:11 litwol joined #mojo
03:11 litwol Hello
03:51 aborazmeh joined #mojo
03:55 inokenty-w joined #mojo
04:04 dboehmer_ joined #mojo
04:31 dabudabu joined #mojo
04:40 punter joined #mojo
04:50 disputin joined #mojo
05:04 disputin joined #mojo
05:25 dod joined #mojo
05:29 dod joined #mojo
05:59 simbabque joined #mojo
06:01 dod joined #mojo
06:09 Lee joined #mojo
06:34 mtths joined #mojo
06:39 Vandal joined #mojo
07:08 AndrewIsh joined #mojo
07:09 rshadow joined #mojo
07:28 Phil21 joined #mojo
07:29 trone joined #mojo
07:49 dod joined #mojo
07:52 dod joined #mojo
08:39 dod joined #mojo
08:48 prg joined #mojo
08:58 rshadow joined #mojo
09:01 dod joined #mojo
09:03 disputin1 joined #mojo
09:39 dod joined #mojo
09:42 dod joined #mojo
09:55 kes joined #mojo
09:57 kes Hi. May you please provide 'merge' method in M::P::Config. To allow inherit this plugin and override 'merge' strategy. (I want to use deep merging)
10:27 kes hm... The $app->defaults->{ config } is exactly $app->config
10:27 kes HASH(0x57bd390)  HASH(0x57bd390)
10:50 nic kes: Sounds like you have a niche use-case there.  It's very easy to write your own.  You're not even tied to a particular format of file content
11:25 renormalist joined #mojo
11:26 dod joined #mojo
11:41 tchaves joined #mojo
12:00 dod joined #mojo
12:02 dod joined #mojo
12:16 gizmomathboy joined #mojo
12:33 dod joined #mojo
12:36 dod joined #mojo
12:36 gryphon joined #mojo
12:38 karjala_ joined #mojo
12:57 dantti_laptop joined #mojo
13:02 skycarl joined #mojo
13:37 Pyritic joined #mojo
13:44 karjala_ Is there a module similar to Mojo::IOLoop::Subprocess, which doesn't exactly fork, but launches a second process instead and communicates with the master process through SysV IPC or pipes or any other way? I need this, because the master process consumes too much RAM, and so (I believe, please correct me if I'm wrong) forking it (as Subprocess does) will temporarilly consume twice as much RAM
13:54 pink_mist you're wrong.
13:54 pink_mist unless you're on windows
13:55 karjala_ Ok, that's good. I need to learn more. Where am I wrong?
13:55 karjala_ Does forking not double RAM usage?
13:55 pink_mist when you believe it will consume twice as much ram, temporarily or otherwise
13:56 PryMar56 joined #mojo
13:56 pink_mist indeed it does not.
13:56 karjala_ But, aren't the variables of the fork process completely separate from those of the master?
13:56 pink_mist not until you change them.
13:56 karjala_ Is there shared memory?
13:56 karjala_ oh
13:56 pink_mist no, it'w COW
13:56 pink_mist *it's
13:57 karjala_ COW?
13:57 purl moooo!! or a programming language for bovines at http://www.bigzaphod.org/cow/ or copy on write or Cave of Wonders or Choke on Weiner or copy-on-write or Milk cow. Be nice to cow. Worship cow. Let cow lie in street. Then fondle cow, make cheese from milk, have tacos. or mostly copy on write when we're talking about computers, which we should get back to programming just now
13:57 pink_mist "copy on write"
13:57 karjala_ What if I have a hashref of hashrefs, and "write" somewhere deep in the structure - what gets copied?
13:57 karjala_ the subtree or the whole var?
13:58 karjala_ excellent! I'm so happy!
13:58 karjala_ I'll use COW
13:58 pink_mist you don't use COW
13:58 pink_mist the kernel uses COW
13:58 pink_mist and sometimes perl
13:58 purl i heard sometimes perl was fun
14:00 pink_mist and I don't know how much gets copied when you write somewhere deep in the structure, probably just a couple of structs with pointers
14:00 Pyritic joined #mojo
14:01 karjala_ Is there a way to measure COW with an experiment on my Linux system?
14:01 karjala_ to measure the memory savings I mean
14:01 pink_mist no idea
14:01 pink_mist this isn't the right place to ask
14:01 karjala_ ok
14:01 pink_mist I'd start by asking in ##linux or something on freenode
14:03 mcsnolte joined #mojo
14:07 marty joined #mojo
14:35 foursixnine joined #mojo
14:48 stryx` joined #mojo
14:51 maschine joined #mojo
14:59 karjala_ joined #mojo
15:01 irqq joined #mojo
15:02 zivester joined #mojo
15:03 abracadaniel joined #mojo
15:45 Grinnz because of COW, preloading all the modules you will need before forking is usually a good idea
15:45 Grinnz you could use IO::Async::Function to implement the preforked workers communicating via pipes but that would be worse on RAM usage, not better
16:09 D joined #mojo
16:18 dotan_convos kes: You're not the first one to ask for a deep-merging config, I made this just to show that it's simple to do: https://metacpan.org/pod/Mojolicious::Plugin::ConfigHashMerge
16:18 kes dotan_convos: thank you.
16:19 kes nic: yes. It is easy to write, but it is more easily to override only one method
16:20 kes I do not want to re-implement (copy/paste) code to detect configuration files when application mode is changed
16:24 Pyritic joined #mojo
16:31 dod joined #mojo
16:34 dotan_convos I have already copy-pasted it for you. From an older version, but the functionality should be identical. Annoying that I had to override the entire register() method to change 2 lines, but probably better than making the basic config module more complicated.
16:35 kes I was going to implement same module with same functionality. But now will use your. thank you
16:38 nicomen I had a prefork server suddenly die on a fork due to lack of memory, and in turn the mother process died too, is this the intended behaviour?
16:38 sri dotan_convos: add config_override support
16:49 dotan_convos sri: thanks
16:50 sh14 joined #mojo
16:50 Grinnz nicomen: are you sure oomkiller didn't take out both?
16:56 nicomen ah could be
16:56 nicomen didn't check that :-/
16:56 nicomen thanks for the tip ;)
17:07 sri you could make sure the oomkiller takes out the children first with different priorities
17:08 sri Mojo::IOLoop->next_tick(sub { path('/proc', $$, 'oom_score_adj')->spurt('200') });
17:09 * sri recently learned that you can bump up the oom_score_adj value without special privileges
17:15 nicomen cool
17:16 nicomen not an ideal situation to be in though ;D
17:16 nicomen "kill him ,not me"
17:20 Grinnz just keep forking off workers with higher priority to keep your master alive :D
17:20 marcus sri: Know if DBD::Pg supports certificate auth?
17:21 sri not a clue
17:21 marcus it seems to be the recommended approach for cockroachdb
17:25 rshadow joined #mojo
17:25 marcus https://github.com/bucardo/dbdpg/blob/master/t/01connect.t#L130 hmm, maybe it works.
17:27 cheako joined #mojo
17:37 irqq joined #mojo
17:59 disputin joined #mojo
18:16 howitdo joined #mojo
18:46 kaare_ joined #mojo
20:28 punter joined #mojo
20:31 cheako joined #mojo
20:38 Grinnz http://grep.cpan.me/?q=Mojo%3A%3AUtil.*%28slurp%7Cspurt%29
20:39 Grinnz in case anyone feels like checking for bugs that need to be filed
20:40 sri Grinnz: you're on the first page ;p
20:40 Grinnz for my changelog, yes :P
20:41 sri there's a real one too though ;p
20:41 sri https://metacpan.org/source/DBOOK/Perl-Critic-Freenode-0.019/lib/Perl/Critic/Policy/Freenode/DiscouragedModules.pm#L150
20:41 Grinnz yep gotta update that
20:41 Grinnz luckily just a doc suggestion
20:42 sri at least half of those authors are here
21:05 castaway joined #mojo
22:48 sri CHYC: another weekend without a pull request!
23:30 tchaves joined #mojo

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