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

IRC log for #mojo, 2014-12-26

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

All times shown according to UTC.

Time Nick Message
00:01 woz joined #mojo
01:03 punter joined #mojo
01:27 KCL_ joined #mojo
01:50 woz joined #mojo
02:08 asarch joined #mojo
02:30 good_news_everyon joined #mojo
02:30 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/ox0ZOg
02:30 good_news_everyon mojo/master e2b7f1c Sebastian Riedel: another validation check example
02:30 good_news_everyon left #mojo
02:56 klapperl_ joined #mojo
03:39 woz joined #mojo
03:50 noganex joined #mojo
04:02 inokenty-w joined #mojo
04:30 alnewkirk joined #mojo
05:28 woz joined #mojo
05:50 rem_lex joined #mojo
05:57 hshong joined #mojo
06:11 dotandimet joined #mojo
06:58 Eddy joined #mojo
07:17 woz joined #mojo
07:36 sugar joined #mojo
07:47 sugar_ joined #mojo
08:13 irq joined #mojo
08:19 sugar__ joined #mojo
08:21 Vandal joined #mojo
09:04 basiliscos joined #mojo
09:06 woz joined #mojo
09:21 amon joined #mojo
09:29 dod joined #mojo
09:45 denis_boyun joined #mojo
09:49 neyasov__ joined #mojo
09:50 neyasov___ joined #mojo
09:51 neyasov____ joined #mojo
09:56 basiliscos joined #mojo
10:09 sugar_ joined #mojo
10:36 Nemix__ I posted a question "Getting data out via Websocket message handler" to mailing list...if anyone can assist here I will summarize later to the list
10:41 dotandimet joined #mojo
10:54 sugar__ joined #mojo
10:54 woz joined #mojo
11:08 onur joined #mojo
11:08 onur Hi guys. How can I escape <% and %> in my template?
11:09 onur errm ok <%% %%> worked :-)
11:24 dod joined #mojo
11:25 dod joined #mojo
12:08 punter joined #mojo
12:25 neyasov_____ joined #mojo
12:43 woz joined #mojo
12:45 sugar joined #mojo
12:58 d4rkie joined #mojo
13:01 sugar_ joined #mojo
13:17 rem_lex|pivo joined #mojo
13:50 dotandimet joined #mojo
14:25 jberger Nemix__: you might find some inspiration in this chat example: https://gist.github.com/jberger/78d7c1649d7acbab6a94
14:25 jberger it uses redis as a message broker
14:27 jberger it is tiny intentionally, I was trying to see how small I could get it without REALLY golfing it
14:27 ryozi joined #mojo
14:28 Nemix__ I can see that :)
14:28 Nemix__ thanks...
14:29 Nemix__ I am working with Async::Selector and so far so good:
14:29 Nemix__ http://search.cpan.org/~toshioito/Async-Selector-1.02/lib/Async/Selector/Example/Mojo.pod
14:31 jberger hmmmmm, interesting
14:32 woz joined #mojo
14:34 jberger I have no immediate problem with you using all these different async libraries together, I'm just kinda curious why you are
14:36 Nemix__ I have no idea what I am doing now...I was hoping to get somthing working and improve on it...any pointers would be appreciated because right now it feels very messy
14:36 Nemix__ this is my first time with this mojolicious and I re-learn perl every time I it down with it :)
14:37 jberger you've picked a rather challenging first task :-)
14:37 jberger not that it is hard I suppose, but there are a lot of parts to it
14:38 Nemix__ this is going to replace a pretty complex POE based application as it is currently Tk based and looking for something I can use mobile
14:38 Nemix__ I mean...phone/tablet mobile
14:39 neyasov_____ joined #mojo
14:39 jberger I would probably start with: https://metacpan.org/pod/Mojo::IOLoop::ReadWriteFork
14:40 jberger from there you need to decide if you need a message broker
14:40 Nemix__ oh wow...somehow missed that before I came across the Async suff
14:40 Nemix__ stuff
14:40 jberger if you only will EVER have a few clients connected to the server
14:41 jberger then you can just cross your controllers and have them all watch the result
14:41 Nemix__ I will at most have 2 or 3 clients
14:41 jberger other wise, a message broker will probably actually be easier in the long run
14:42 Nemix__ thanks...I will refactor what I have based on that and see how it goes..very early stages here!
15:10 Nemix__ I used the standalone example for ReadWriteFork and it gives no output.  I add some use references for modules and execute with "use Mojolicious::Lite;
15:10 Nemix__ use Mojo::IOLoop;
15:11 Nemix__ oops
15:11 Nemix__ I execute with perl
15:13 dotandimet joined #mojo
15:18 Nemix__ oh...ignore that for now...apparently I didn't realize I needed to add a print statement
15:18 Nemix__ need more coffee
15:32 sh4 joined #mojo
15:34 howitdo joined #mojo
15:35 whatitdo joined #mojo
15:53 s1037989 joined #mojo
16:04 neyasov_____ joined #mojo
16:21 woz joined #mojo
16:34 dotandimet joined #mojo
16:52 Nemix__ I want to start a command via Mojo::IOLoop::ReadWriteFork outside my Mojolicious::Lite message handlers.  After I create an instance with new and set the event handlers how do I start it so that it is part of the loop?  If I call start from outside handlers it does not run.  Only if I put it in one of the message handlers does it work
16:53 Nemix__ I can put start outside the handlers and call Mojo::IOLoop->start but then handlers don't work
16:53 Nemix__ clearly I am missing something really basic in how mojolicious works
16:55 jberger should be a part of the same loop automagically
16:55 jberger how are you running your app?
16:57 Nemix__ with morbo
16:57 jberger morbo already has a running loop
16:57 Nemix__ ok...hmmm
17:07 neyasov_____ joined #mojo
17:09 Nemix__ If I replace Mojo::IOLoop->start with app->start in my test program it does not work.
17:14 rwp joined #mojo
17:20 aghbas joined #mojo
17:26 jberger Nemix__: a lite app should always end in app->start;
17:28 jberger which is very different than Mojo::IOLoop->start
17:28 jberger an app is not an instance Mojo::IOLoop
17:30 Nemix__ ok...I will work with this more until I can get a handle how it is behaving...mildly lost right now
17:31 jberger Nemix__: can you post your code
17:31 jberger via a pastebin of some variety
17:43 Nemix__ http://pastebin.com/3PAn2cA9
17:44 Nemix__ as pasted I get no output when executed with morbo.  If I comment out app->start and put in place the loop start and execute with perl it works
17:47 Nemix__ I made the spawned command pretty benign but be aware it is there
17:53 jberger ok, so the problem is that that doesn't define any routes
17:54 jberger it should still do the command I would guess, but its not very useful
17:56 Nemix__ maybe I don't get routes...I want the command executed from the moment the application starts and not initiated by user activity.  In the real-world application it will be a long running process that occasionally generates output
18:10 woz joined #mojo
18:17 jberger argh! batman: this doesn't work on osx!
18:17 jberger https://metacpan.org/source/JHTHORSEN/Mojo-IOLoop-ReadWriteFork-0.09/lib/Mojo/IOLoop/ReadWriteFork.pm#L275
18:18 jberger I kept getting exactly two messages before the child would close on me
18:19 jberger Nemix__: ok, I'm going to give you something that I wasn't going to just give away, I wanted you to learn as you went.
18:19 jberger then again, I'm having too hard a time with the modules I showed you
18:19 jberger https://gist.github.com/jberger/93b3a192fc68a0d7ca14
18:20 jberger with a trivial modification, that should do exactly what you want
18:24 dod joined #mojo
18:27 Nemix__ thanks
18:55 dod joined #mojo
19:29 jamesw joined #mojo
19:59 woz joined #mojo
20:00 batman jberger: it would be awesome if you could figure out what's wrong with the way I start telnet
20:01 batman I tried changing from "localhost" to "127.0.0.1" on both the IOLoop server and telnet argument
20:01 batman Didn't seem to fix CPAN testers result :(
20:02 batman But I think it's something like that which makes it fail
20:10 jberger batman: o/
20:10 batman Something like that = ipv6 VS ipv4
20:10 jberger according to some searches I made, it seems that there isn't a telnet server running
20:11 jberger I'm not sure how that works
20:11 jberger let me see if I can find it in my history
20:11 batman I'll buy you an Norwegian beer if you figure it out, hehe
20:11 jberger mmmmmm
20:11 batman Did you read my comment?
20:11 batman I'm not connecting to the telnet server. That would be crazy.
20:12 * jberger looks
20:12 batman I'm connecting to a server I'm starting.
20:12 batman Telnet doesn't care what's at the other end
20:12 batman Ever used telnet to connect to a web server..?
20:12 jberger oh, ok
20:12 jberger so long ago as to not be useful
20:13 batman hehe
20:13 batman Well... Look at the test file. It's super short.
20:14 jberger I'm cloning the repo now
20:14 batman https://github.com/jhthorsen/mojo-ioloop-readwritefork/blob/master/t/telnet.t
20:15 jberger right, I see that, I just want to be able to run it
20:16 jb360 joined #mojo
20:16 batman It's probably very easy to figure out.
20:16 batman But I can't, since I'm not able to try/fail on a Mac
20:17 jberger there is another problem, I haven't opened a bug report yet
20:17 jberger https://metacpan.org/source/JHTHORSEN/Mojo-IOLoop-ReadWriteFork-0.09/lib/Mojo/IOLoop/ReadWriteFork.pm#L275
20:17 jberger I don't think that works on mac
20:17 jberger perhaps they are related?
20:18 batman It's not related at all.
20:18 jberger ok
20:18 jberger back to the first thing
20:19 batman That line doesn't have to work. It's just...extra.
20:20 jberger we'll come back to that in a minute
20:23 jberger tried adding a -4 to the args list
20:23 woz joined #mojo
20:23 jberger now I see it trying to connect via ipv4, but it still failed
20:28 batman Did you change the listen statement to the IOLoop server?
20:33 * sri is quite disappointed to see rakudo star ship with a web framework
20:34 batman Which one is that sri?
20:34 jberger so it will be CGI.pm all over again eh?
20:34 sri but some interesting points brought about about it by timtoady
20:35 sri his only requirement for "production ready" is that something passes all the spec tests
20:35 sri and rakudo star is just one distribution of perl6... and there is nothing "official" about it
20:36 sri sooooo... there is no official perl6 you can install yet
20:36 jberger sri: where is all this?
20:36 sri so much for being optimistic about playing with a mojo port ;p
20:36 sri not in 2015 i guess
20:38 sri this was in #perl6
20:38 sri this is the one btw. https://github.com/tadzik/Bailador/
20:39 sri yea, no docs at all
20:39 sri nothing really
20:39 jberger batman: this prove -lv with the debug flag set: http://pastie.org/9799867
20:40 jberger hey, if #perl6 isn't interested in your enthusiasm for it
20:40 * jberger gets sad again
20:41 batman dancer..? That's awful :/
20:41 sri i don't think anyone has put any thought into this
20:41 sri they just bundle *everything*
20:41 jberger I think timtoady suddenly discovered that 15 years is too long
20:42 jberger and after all that, now they are going to f*** it up
20:42 jberger and just when I was getting interested in p6 for its async stuff
20:42 jberger which is ALSO totally (and frustratingly) undocumented
20:42 purl okay, jberger.
20:42 jberger purl forget which
20:42 purl jberger: I forgot which
20:43 batman jberger: I think this doesn't work: "telnet> open localhost 50627"
20:43 * jberger pushes purl down the stairs
20:43 * purl attaches herself to jberger using suction and a ham straw
20:43 batman No idea why not
20:43 jberger batman: I did 'mojo daemon &'
20:43 jberger then
20:43 jberger telnet -4
20:44 jberger open localhost 3000
20:44 batman The way I would debug it would be to start the server from the unit test, and then try to connect to it from telnet in another window
20:44 jberger <<hit enter>>
20:44 jberger and it works
20:44 jberger sure, I can do that
20:44 batman Ok... Super weird.
20:44 sri jberger: well, they can just abandon rakudo star and start fresh with a different "distribution" ;p
20:45 sri not sure how that's supposed to jumpstart an eco system... but i'm not exactly an expert
20:45 batman jberger: could it be some firewall settings?
20:46 sri node.js got that very right, minimal core with just enough stuff for npm to work
20:47 batman sri: that's awesome, since npm is good
20:47 batman I could live with minimal Perl if it shipped with cpanm that works with 100% of CPAN
20:47 sri npm is also a company... making things... interesting
20:47 purl okay, sri.
20:48 sri to work with 100% of cpan you need most of the modules shipping with perl
20:49 jberger batman: I moved the top half of the script to another file (minor changes etc) and started it
20:49 jberger and now when I do that I'm getting connection refused
20:50 sri re 2015 plans... we have no volunteers for this yet!!! https://github.com/kraih/mojo/issues/423#issuecomment-65975427
20:53 jberger hunh, but telnet localhost 3000 works
20:53 jberger telnet
20:53 jberger open localhost 3000
20:53 jberger ^^ refused
20:54 sri what are you using telnet for in 2014?
20:54 jberger sri: https://github.com/jhthorsen/mojo-ioloop-readwritefork/blob/master/t/telnet.t
20:54 sri OMG WHY?
20:54 purl OMG WHY is create table taking so long?!
20:55 sri if you need a test program, make a reliable one and ship it with the dist!
20:56 neyasov_____ joined #mojo
20:57 sri fyi. mojo tests only bind to 127.0.0.1, localhost has been very unreliable historically
20:57 jberger take that up with batman
20:58 sri purl: forget OMG WHY
20:58 purl sri: I forgot omg why
20:59 jberger sri: that was kinda funny actually
21:00 sugar__ joined #mojo
21:00 sri http://makeameme.org/media/created/WHY-OMG-WHY.jpg
21:01 dotandimet joined #mojo
21:01 jberger OMG WHY is <reply> http://makeameme.org/media/created/WHY-OMG-WHY.jpg
21:01 jberger purl
21:01 purl yes, jberger?
21:01 jberger purl: OMG WHY is <reply> http://makeameme.org/media/created/WHY-OMG-WHY.jpg
21:01 purl i already had it that way, jberger.
21:01 * sri pats purl
21:01 * purl pats sri back, harder
21:05 jberger batman, binding the server to 127.0.0.1 explicitly does make my sample server work as expected
21:05 jberger however the tests still fail, and I think its the /proc thing
21:09 jberger batman: yep, tests pass with this diff
21:09 jberger http://pastie.org/9799895
21:17 batman sri: I tries 127.0.0.1 earlier, but tries localhost after that didn't work. Just haven't changed it back
21:17 batman *tried
21:18 batman sri: I'm not testing telnet really, I'm testing something that require IO::Pty. Haven't managed to make a Perl app that behaves the same way
21:21 batman jberger: I don't get how that's related. Do you know what that function do? (Where the pid test is)
21:21 jberger its checking to see that the child is alive
21:21 jberger it keeps thinking the child is dead, and so kills it
21:22 jberger so earlier today I force installed RWF, and then used it to monitor the output of 'ping 8.8.8.8'
21:22 batman Ah! Crap. I read my own code wrong :(
21:22 batman batman - -
21:22 jberger but I would only ever get two lines before the child would die
21:23 batman I will not accept the patch you posted to pastebin
21:24 batman I need something better.
21:24 jberger batman: no of course not
21:24 batman :)
21:24 jberger that was to demonstrate that that was the problem
21:24 batman Thanks. Sorry for being ignorant :(
21:25 jberger no worries
21:25 batman Thanks for being persistent :)
21:25 jberger https://www.youtube.com/watch?v=BHqgHFcmAOc
21:26 batman Btw: I would like to replace the whole recurring sub if possible
21:26 batman No idea how to do that though. Spent quite some time to make it work.
21:28 Eke- joined #mojo
21:35 jberger batman: actually, I don't hate the bare next
21:35 denis_boyun joined #mojo
21:36 batman I might not, but my applications @work won't work :(
21:36 batman *you might not
21:37 jberger why is that?
21:37 jberger (btw, I would then rewrite as http://pastie.org/9799934)
21:37 batman Can't remember. I'm on vacation :/
21:37 sri hahaha https://blog.engineyard.com/2014/ruby-isnt-dead
21:38 jberger batman: ah, well enjoy then
21:38 jberger go anywhere fun?
21:38 jberger sri: nice
21:39 jberger I really do think that the measure of a language is whether or not people continue to use it after the popularity wave passes by
21:40 jberger I imagine two possible popularity graphs, both look rather bell-curve, but one has a tail that stays above zero on the right and one that goes to zero on the right
21:40 jberger a successful language looks like the first
21:40 jberger I think we are about to find out if ruby is or not
21:41 sri "being uncool is the first step towards being retro"
21:41 batman jberger: had vacation since the 18th. Been sick until the 24th :(
21:41 jberger ungh, that sucks
21:42 jberger sri: I like that they compare themselves to the "not dead perl"
21:42 jberger hahahhahahah
21:42 batman Big time. Was hoping to hack on convos. Been quite frustrating :(
21:42 genio cobol and Perl lumped in together, huh?
21:42 jberger so NOW we aren't dead to them, because they want to claim us as a survival story!
21:42 jberger batman: got myself a bit of a cold now too
21:43 jberger I hope I didn't infect my family at the parties the last couple days (it only just started to rear its ugly head last night)
21:44 jberger re: ruby, the thing is, I don't disagree with him, its just irksome that they have to see this side of the bell curve before they stop lobbing grenades our way
21:46 batman jberger: be well. Be happy :)
21:46 jberger batman: you too
21:46 sri http://jokideo.com/wp-content/uploads/2012/06/532678_345139402226775_1287420084_n.jpg
21:46 batman sri:)
21:46 denis_boyun joined #mojo
21:46 batman How's your holiday?
21:46 genio heh
21:46 jberger sri: wish it was, I didn't drink last night cause I could feel this coming on
21:47 * batman is avoiding party tonight.
21:47 batman Getting old and cranky :P
21:47 jberger batman: yeah, we all are :-)
21:47 * jberger likes a good night in
21:48 * jberger is into season 3 of TNG
21:51 genio it was a sad day when I finished all episodes of Star Trek * on Netflix
21:51 jberger I did Voyager a year or so ago
21:51 jberger doing TNG now, probably do DS9 in a year
21:52 * sri spent the whole week with family... 5 months old nephew makes *a lot* of noise... but at least no flu for me o/
21:52 jberger sri: robots have family?
21:52 * jberger is the oldest of 5 kids
21:52 * jberger remembers 5 month olds
21:52 * jberger notes he has no kids of his own yet
21:56 Nemix__ is it correct to say that when using Mojolicuous::Lite (not experience with general) that defining event handlers outside of routes has no functional purpose?
21:56 batman jberger: I think we can do LINUX ? -d "/proc/$pid" : kill 0, $pid
21:57 jberger waitpid $pid, WNOHANG is not sufficient?
21:57 sri Nemix__: http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Built-in-web-server
21:57 jberger batman: that assumes all linuxes use procfs, which is close but not guarenteed
21:57 batman You are right. And then the extra test if on Linux :)
21:58 batman jberger: but _i_ need to test processes not owned by me.
21:58 jberger you have the pid, that doesn't work?
21:59 * jberger is confused
21:59 batman You can't signal a process you don't own
21:59 jberger does waitpid signal?
22:00 batman Anyhow... I need to get some sleep. Will think about it on Sunday
22:00 jberger sure
22:00 batman Can't remember all the issues :(
22:00 jberger gotcha
22:00 batman IPC sucks. And even worse: I suck at IPC :P
22:01 jberger I could probably meet at the middle and say -d /proc ? -d "/proc/$pid" : whatever
22:01 jberger but I still think its not necessary
22:01 jberger IPC does suck
22:01 * jberger goes shopping
22:01 batman I want to go shopping!!
22:02 batman :D
22:02 jberger I'm not really going shopping!
22:02 jberger memes are hard
22:02 * jberger sends batman shopping
22:03 jberger batman: get some sleep, then enjoy the rest of your break
22:03 sri get me one of these while you're out shopping! http://www.theverge.com/2014/11/12/7210621/dji-inspire-one
22:08 bobkare joined #mojo
22:19 bobkare joined #mojo
22:28 sri nobody ever buys me drones :(
22:31 dotandimet joined #mojo
22:36 neyasov_____ joined #mojo
22:44 bobkare joined #mojo
23:01 bobkare joined #mojo
23:08 good_news_everyon joined #mojo
23:08 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vYTHqA
23:08 good_news_everyon mojo/master 089b312 Sebastian Riedel: be a little more specific in the cookbook
23:08 good_news_everyon left #mojo
23:12 bobkare joined #mojo
23:33 sugar joined #mojo

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