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

IRC log for #mojo, 2013-11-25

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

All times shown according to UTC.

Time Nick Message
00:02 denisboyun joined #mojo
00:06 jberger_ sri: the fact that the pipe closed, and thus the close handler was invoked, means that the process exited right? so do I need this line? tba: I don't know about your exact problem, but the catchall solution might be https://metacpan.org/pod/Mango::Database#command
00:06 jberger_ bah, wrong link
00:06 jberger_ sri: do I need THIS line? https://github.com/jberger/Mojo-IOLoop-ForkCall/blob/master/lib/Mojo/IOLoop/ForkCall.pm#L49
00:07 jberger_ the real question is, would there ever be a case where exit would close the pipe, but the process would still need to be killed?
00:07 sri jberger: you're better qualified to answer that
00:07 jberger_ hehe
00:07 jberger_ I'm tempted to simply trust that idea
00:08 jberger_ bolstered by this SO answer: http://stackoverflow.com/a/8976461/468327
00:08 jberger_ it suggests essentially this mechanism as a "nonblocking waitpid"
01:12 laouji joined #mojo
01:54 Kulag joined #mojo
01:56 KindTwo joined #mojo
02:00 d4rkie joined #mojo
02:05 tba_ joined #mojo
02:22 Adurah jberger_, hm?
02:22 jberger_ o/
02:23 jberger_ I was just going to see if you could do some more windows testing
02:23 jberger_ and since then I think I've even gotten it a little better
02:24 Adurah Progress.
02:24 purl rumour has it progress is progress
02:24 jberger_ purl botsnack
02:24 purl thanks jberger_ :)
02:28 Adurah Well then, link whenever.
02:28 jberger_ oh sorry
02:28 jberger_ https://github.com/jberger/Mojo-IOLoop-ForkCall
02:31 Adurah Pass on Straberry.
02:31 jberger_ \o/
02:31 duncanthrax joined #mojo
02:32 d4rkie_ joined #mojo
02:42 Adurah Pass on cygwin.
02:45 jberger_ Adurah, thanks!
02:45 jberger_ and woo-hoo!
02:45 * jberger_ wipes brow
02:50 Kovensky joined #mojo
02:59 btyler joined #mojo
03:02 marty joined #mojo
03:10 marty joined #mojo
03:15 tholen42 joined #mojo
03:31 rem_lex joined #mojo
04:03 ryozi joined #mojo
04:04 preflex_ joined #mojo
04:06 jberger_ https://gist.github.com/jberger/7636217
04:09 abra_ joined #mojo
04:10 jberger_ also I happened to find a delightful conversion target :-D
04:14 sri DANGER ZONE
04:16 jberger_ oh no what have I done now
04:16 ronsavage joined #mojo
04:19 * jberger_ thinks that sri is stuck on Archer/Top Gun mode
04:19 sri i just like saying that while humming the top gun theme
04:20 jberger_ I'm going to imagine that you also say it with a Stewie voice
04:20 sri doesn't mean you didn't do anything wrong though... just that i didn't pay attention ;p
04:20 jberger_ haha, noted
04:21 jberger_ well in making this example it turned out that I has some very suspect argument handling
04:21 * jberger_ needs to write a few more tests before this sees CPAN
04:40 rem_lex|pivo joined #mojo
05:00 preflex_ joined #mojo
05:17 marty joined #mojo
05:19 marty_ joined #mojo
05:23 laouji joined #mojo
05:26 marty joined #mojo
05:27 beyondcreed joined #mojo
05:39 laouji joined #mojo
06:05 Vandal joined #mojo
06:09 Lucas1 joined #mojo
06:26 tba joined #mojo
06:27 marty joined #mojo
06:41 batman jberger_: your module got so simple it's funny :)
06:41 batman jberger_: still would very much like if i could get the pid and kill EventEmitter.
06:59 Lee joined #mojo
07:05 batman jberger_: https://gist.github.com/jhthorsen/7637407 # what do you think?
07:08 hummeleBop joined #mojo
07:08 dpetrov_ joined #mojo
07:19 KindTwo joined #mojo
07:28 marty joined #mojo
07:36 SuperOSX joined #mojo
07:46 KindTwo joined #mojo
07:56 dod joined #mojo
08:03 highflying joined #mojo
08:07 themage joined #mojo
08:16 fhelmber_ joined #mojo
08:18 dod joined #mojo
08:19 basiliscos joined #mojo
08:21 fhelmber_ joined #mojo
08:29 marty joined #mojo
08:39 trone joined #mojo
08:40 nicolaas joined #mojo
08:48 basiliscos joined #mojo
08:57 maxhq joined #mojo
09:29 ver joined #mojo
09:29 marty joined #mojo
09:55 zivester joined #mojo
09:55 denisboyun joined #mojo
10:00 dotan joined #mojo
10:30 marty joined #mojo
10:46 arthas joined #mojo
10:51 callumgare joined #mojo
10:53 maxhq joined #mojo
11:01 tba_ joined #mojo
11:03 callumgare Hello IRC dwellers.
11:03 callumgare I was wondering if you guys could help me. Even a push in the right direction would be much appreciated.
11:03 callumgare Essentially I want to show the progress of an rsync copy on a website. I've got the the stdout of rsync being read with a while loop using \r as the line break so as I can get updated progress as it comes (since rsync separates each update with a \r so as to write it on the same line).
11:03 callumgare I want to send it to the browser via web sockets however the problem I've been having is that mojo won't send the text till after the while loop is complete (thus defeating the perps of getting updates on the progress).
11:03 callumgare The closet solution I can find online is this: https://groups.google.com/forum/#!msg/mojolicious/m6OHryCL3Hg/lib8qR5iThsJ
11:05 callumgare This is what I've got so far:
11:05 callumgare websocket '/rsync' => sub {
11:05 callumgare my $self = shift;
11:05 callumgare # Incoming message
11:05 callumgare $self->on(message => sub {
11:05 callumgare $self->send($_);
11:05 callumgare }
11:05 callumgare }
11:05 callumgare };
11:06 moritz callumgare: don't post more than a single line of code here please
11:06 moritz callumgare: use a nopaste service instead
11:06 moritz the while loop that reads stuff might be interesting.
11:07 callumgare Right oh, sorry about that.
11:08 callumgare I've added it here: http://nopaste.info/3b60c9fef8.html
11:11 callumgare Mmm, for some reason nopaste seems to convert \r to just r
11:11 callumgare But you get the picture.
11:12 D4RK-PH0ENiX joined #mojo
11:27 d4rkie joined #mojo
11:50 athenot joined #mojo
11:51 batman no that i have the solution, he's gone. typical :)
11:51 batman *now
12:09 mire_ joined #mojo
12:32 marty joined #mojo
12:55 denisboyun joined #mojo
13:32 marty joined #mojo
13:44 Dandre joined #mojo
13:46 tba_ joined #mojo
13:46 asarch joined #mojo
13:48 marty joined #mojo
13:49 athenot joined #mojo
13:50 marty joined #mojo
14:10 sh4 joined #mojo
14:17 Dandre joined #mojo
14:24 gtodd if using Mojolicious with an existing application (that may not be strictly a web app  cf. Rubic) how do I know if it should be packaged as a Mojo plugin or ...
14:26 denis_boyun_ joined #mojo
14:26 gtodd using "Mojo as front end" iit seems like it might even be possible to add "remote web UI" features to a whole pile of perl scripts :)
14:31 denisboyun joined #mojo
14:35 batman gtodd: are you using Rubic?
14:36 batman i've written Rubic. I named it Mojolicious-Plugin-Ubic in the beginning, but I think we need more apps on cpan, so i renamed it.
14:37 batman hardcore devs will still find the plugin, but "the rest" will hopefully find the webapp - and use it.
14:37 batman like mojopaste
14:37 gtodd ah ok
14:41 batman was that answer good enough...?
14:42 gtodd I use Ubic for a bunch of silly little "services" and was also interested in making GUIs for a few little tools ... since "HTML5 is the new Tk"  ;-) Rubic caught my eye
14:42 gtodd yup I understand ... I like that errm variant of a "dual life" :-) approach
14:43 gtodd naming things that function as discrete apps is a good idea
14:44 gtodd batman: I am finding Ubic to be very nice
14:44 gtodd and Rubic lets me check my Ubic with a phone :)
14:57 gryphon joined #mojo
15:06 mire_ joined #mojo
15:07 batman hehe. cool :)
15:07 batman any feature request for rubic is more than welcome.
15:08 batman it's just a quick hack for now really. i want to make it better, just not my primary target atm
15:12 gtodd If I can think of something more specific than "continue to wrap Ubic with cool add ons" ;) I will do that
15:13 batman hehe
15:17 athenot joined #mojo
15:17 gtodd I like the idea of building something as a mojo plugin and then calling it "some cool app name" ... ++
15:17 batman gtodd: the reason is to make it easier to embed in other apps.
15:18 batman i'm using the plugin at work, but not rubic daemon
15:19 gtodd so make it easy to be part of a framework and be "stand alone"
15:20 denis_boyun__ joined #mojo
15:24 batman yes. that's how i roll ;)
15:28 gtodd heh roll on ;-)  I started off trying something simple - making mojo "be the GUI" for a script  that watches a set of resources for changes/updates  ... and now I'm thinking scheduled monitoring (with a Ubic service?) and coloured diffs, and, and, and
15:30 batman cool, cool.
15:31 btyler joined #mojo
15:32 * batman wonder when jberger is awake.
15:33 beyondcreed joined #mojo
15:49 denisboyun joined #mojo
15:55 batman gtodd: i was considering adding auto refresh to the process list
15:55 batman And maybe some super simple user auth. Not quite sure how though.
15:56 batman Knowing where to store the users are the worst.
15:57 suy joined #mojo
16:40 hrupp joined #mojo
16:43 marty joined #mojo
17:03 delias joined #mojo
17:06 mire_ joined #mojo
17:28 * sri wonders if anyone actually notices the changes he made to the mojolicious site
17:28 Mikey the balloon moves!
17:29 Mikey and the background :)
17:29 batman i've noticed. i know why you giggle sri :)
17:29 * sri giggles
17:31 batman :)
17:43 punter joined #mojo
17:48 basiliscos joined #mojo
18:39 dod joined #mojo
18:49 dvinciguerra joined #mojo
19:10 batman jberger: you here?
19:10 purl SPEAK UP, SONNY!
19:10 * batman should probably tweet instead
19:11 Mike-PerlRecruiter_ joined #mojo
19:23 cfedde joined #mojo
19:42 mire_ joined #mojo
19:46 kej joined #mojo
20:18 callumgare joined #mojo
20:21 meshl joined #mojo
20:23 btyler joined #mojo
20:28 jberger_ joined #mojo
20:28 jberger_ batman: o/
20:28 jberger_ At work
20:28 meshl joined #mojo
20:28 jberger_ Sorry just read the log
20:29 meshl joined #mojo
20:30 rem_lex| joined #mojo
20:30 jberger_ Btw I was thinking of adding a "weaken" attribute
20:30 jberger_ If true it would weaken the invocant
20:31 batman no need to be sorry :)
20:31 batman you wouldn't need weaken if you got rid of EventEmitter...
20:32 jberger_ I wouldn't need to weaken if I want to force $delay->begin(0)
20:33 jberger_ but I would rather not
20:33 lukep joined #mojo
20:34 batman that's a valid point...
20:34 batman what about the $pid?
20:34 jberger_ Also your plugin does my clean up zombies
20:34 jberger_ I could return the pid
20:35 jberger_ I can't really think of anything else I would return (maybe the Child object)
20:35 batman i'm not talking about zombies, i'm talking about tasks that just takes too long
20:36 jberger_ so I add the weaken attribute, then it's up to you to keep the fc instance alive
20:36 batman not sure if i want the Child object or the pid... i can't decide :)
20:36 batman weaken: right. i'm not going to argue too much about that, since i hope/think it's not a big deal
20:38 jberger_ K when I get a moment I will add that, and return something
20:38 batman child vs pid: i think just the $pid actually
20:38 jberger_ Probably the Child object, since you can get the pid from it
20:39 batman hahahaa
20:39 jberger_ ha
20:40 jberger_ I think the object, then you can also use the handy is_complete method
20:40 jberger_ and get the exit status etc
20:41 batman good point.
20:41 purl nice and sharp
20:41 jberger_ and kill method etc etc
20:41 batman jberger_++
20:41 jberger_ purl agrees
20:41 purl yes i do
20:42 batman what do you think about my plugin?
20:42 batman care to bundle something similar with the package?
20:43 batman $self->fork_call(_slow_method => $delay->begin); # i like this.
20:43 jberger_ I have been thinking about what functionality a plugin could provide
20:44 batman i woke up 3am with that plugin idea. probably not the best in the history of man kind ;)
20:44 jberger_ in your paste, the job is called against the controller
20:44 jberger_ I'm not sure that should be the default
20:45 batman i think that makes perfect sense. what else do you call against in your mojo app?
20:45 jberger_ Then again, when used as a helper Perhaps it makes sense
20:45 * jberger_ got there
20:45 batman :)
20:46 batman it's not really a bad thing either. you can just throw the first argument away if you don't need it.
20:47 jberger_ I see now why schmorp warns against doing anything event based in the forked job
20:47 jberger_ I would have to think about forking the controller in that context
20:47 batman "think about forking the controller" ?
20:47 jzawodn that sounds dirty
20:48 batman you should add =head1 WARNING or something to the module and inform about that events are prohibited
20:49 batman but the controller has a lot of data not related to the ioloop, so i think that's useful.
20:50 jberger_ I will warn strongly
20:51 batman :)
20:53 batman lenovo has crappy resolution on their screens :/
21:08 batman wonder what kind of laptop i should get if not lenovo (or mac)
21:09 sri mac
21:10 batman haha
21:10 * sri hugs his macbook air
21:11 batman i'm kind of addicted to the trackpoint
21:11 sri Oo
21:12 batman http://xkcd.com/243/
21:12 sri not even lenovo makes those anymore i think
21:13 batman they do
21:13 sri look at that... they do
21:13 batman :D
21:13 batman http://shop.lenovo.com/us/en/laptops/thinkpad/x-series/x240/#techspecs
21:14 batman ^ that's the laptop in the lead
21:14 batman they've changed the keyboard though.
21:14 * sri thinks the only laptops worth getting atm are lenovo x and macbook air
21:14 batman more awesome to...hopefully-not-too-crappy
21:14 batman i was afraid of that
21:15 batman http://en.wikipedia.org/wiki/Pointing_stick <-- a lot used to have it :)
21:16 sri you don't want a tiny laptop with retina display
21:16 sri intel gpu is not strong enough yet
21:16 batman but it could have 1600x900
21:17 batman rumors had it that the x240 should have full hd.
21:17 batman they also said it would have 14H battery.
21:17 batman rumors :/
21:19 sri x1 carbon looks lice
21:20 batman too big
21:24 * batman gets some sleep
22:07 callumgare joined #mojo
22:09 callumgare Hi again, sorry for disapearing. If you missed me before I was enquirening about sending a websocket message for each line of rsync output using mojolicious.
22:09 KindOne joined #mojo
22:10 callumgare Essentially I want to show the progress of an rsync copy on a website. I've got the the stdout of rsync being read with a while loop using \r as the line break so as I can get updated progress as it comes (since rsync separates each update with a \r so as to write it on the same line).
22:10 callumgare I want to send it to the browser via web sockets however the problem I've been having is that mojo won't send the text till after the while loop is complete (thus defeating the perps of getting updates on the progress).
22:10 callumgare Recap ^
22:10 callumgare http://nopaste.info/61c986d3e4.html (for some reason nopaste seems to convert \r to just r)
22:14 meshl isn't your problem coming from the fact you are using a single route for two non-async operations? (not sure, just attempting to help)
22:15 batman The problem is that you're inside a while() loop
22:15 batman You need to escape to the IOLoop to render stuff
22:15 batman You're not. You're stuck inside the while loop
22:16 batman Use my Mojo::IOLoop::ReadWriteFork module
22:17 batman Nice to see you online meshl :)
22:17 callumgare Cool, thanks for that. I'll read up on: Mojo::IOLoop::ReadWriteFork
22:18 batman Take care. I'm getting some sleep for real now :P
22:18 callumgare Good plan, :D
22:20 meshl sleep well, batman ;)
22:23 callumgare @meshl: Quite possibly but unfortunately I'm a bit of a derp and I'm not sure what you mean. Is it non-asynchronous because it's watching to receive an websocket connect as well as write messages?
22:27 sri herp derp
22:27 purl herp derp is, like, at http://derper.com/images/derp/Herp_Derp_Horse.jpg
22:29 sri please stop helping callumgare, he's cross posting like crazy now
22:32 callumgare I'm sorry, I didn't realise that was bad edicate;
22:33 sri it's common sense, making three separate groups of people help you indepenently without interlinking the topics means a lot of wasted time
22:35 callumgare Well my appoliges then. I'll look into Mojo::IOLoop::ReadWriteFork and wait to see if Stack overflow has any solutions and if that fails I'll come back here, is that okay?
22:36 sri yes, but only one channel at a time, and reference previous discussions
22:36 sri i'm closing the list thread too
22:37 callumgare Fair enough.
23:02 tba joined #mojo
23:09 sri css animations really rock, can't wait for full support in all browsers
23:12 sri almost makes up for the loss of <marquee>!
23:14 k0xa joined #mojo
23:37 btyler joined #mojo
23:48 meshl css animations soon will be "universal": http://codepen.io/juliangarnier/pen/idhuG

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