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

IRC log for #mojo, 2016-11-12

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

All times shown according to UTC.

Time Nick Message
00:41 disputin joined #mojo
00:50 marty_ joined #mojo
00:53 dave Is there a way to influence Mojo::UserAgent's DNS resolution similar to the curl --resolve switch?
00:54 dave I ask because TLS SNI doesn't use the Host header ;)
01:09 aborazmeh joined #mojo
01:16 dustinm joined #mojo
02:25 ivi joined #mojo
02:56 jberger cromedome: haha no worries
02:56 jberger Mostly i saw your join and wanted to say hi
03:19 Grinnz dave: i think all you can do is set the ca, cert, and key attributes
03:20 Grinnz not sure what the curl --resolve switch does
03:22 Grinnz DNS resolution is either done directly by IO::Socket::IP, or by Net::DNS::Native if that's installed
03:23 Grinnz both of those use the system's getaddrinfo as far as i know
03:24 Grinnz which doesn't really take any options
03:45 noganex_ joined #mojo
04:29 Adurah joined #mojo
04:43 disputin1 joined #mojo
04:43 dotan_convos joined #mojo
04:44 disputin joined #mojo
06:59 buu joined #mojo
07:00 buu Why does this code
07:00 buu my $proxy = $ARGV[0];
07:00 buu if( $proxy ) {
07:00 buu $ua->proxy->http($proxy);
07:00 buu }
07:00 buu Cause a long running process to develop a memory leak?
07:21 Vandal15263 joined #mojo
07:23 polettix joined #mojo
08:03 bpmedley joined #mojo
08:10 polettix joined #mojo
08:20 mtths joined #mojo
09:09 rshadow joined #mojo
10:08 henq joined #mojo
10:18 parv joined #mojo
10:31 VVelox joined #mojo
10:51 henq joined #mojo
11:22 henq joined #mojo
11:39 rshadow joined #mojo
11:50 bpmedley Zen : Did you get the REST calls working?
12:08 henq joined #mojo
12:17 henq joined #mojo
12:18 parv joined #mojo
12:35 stryx` joined #mojo
13:22 rshadow joined #mojo
13:26 aborazmeh joined #mojo
13:28 tyldisc buu:  How much memory are we talking?
13:30 henq joined #mojo
13:35 alexbyk joined #mojo
13:37 alexbyk joined #mojo
13:40 alexbyk joined #mojo
13:41 tl joined #mojo
13:43 alexbyk joined #mojo
13:46 rshadow joined #mojo
13:46 alexbyk what means @ near sri, crab nicks?
14:01 mattp_ is it possible to glob/slurp routes?
14:02 mattp_ ie, say I want to take http://$app/action/a/b/c/d/e/f...
14:03 mattp_ pass a/b/c/d/e/f... to action?
14:05 alexbyk @mattp_ get '*foo' => sub {};
14:06 mattp_ alexbyk: can you point me to where that is in the docs? i couldnt find it
14:07 alexbyk @mattp_ http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Wildcard-placeholders
14:09 mattp_ alexbyk: thanks :)
14:12 bpmedley alexbyk : They are channel ops
14:17 alexbyk @bpmedley thanks
14:19 pink_mist alexbyk: use "bpmedley:", not "@bpmedley"
14:20 pink_mist alexbyk: as you just found out, the @ means something else on IRC.
14:21 suede pink_mist: abolish discord and slack!! :P
14:21 pink_mist no, I use slackware daily
14:21 pink_mist :P
14:23 henq joined #mojo
14:26 sri coolo: ah, that's convenient
14:26 * sri just bought a new keyboard :)
14:27 sri http://www.razerzone.com/gaming-keyboards-keypads/razer-blackwidow-x-tournament-edition-chroma
14:27 sri it's really good, like the new razer switches
14:28 rshadow joined #mojo
14:31 henq joined #mojo
14:33 gryphon joined #mojo
14:43 gizmomathboy joined #mojo
14:46 rshadow joined #mojo
14:53 AndrewIsh joined #mojo
15:26 henq joined #mojo
15:37 sri can anyone recommend a kvm switch for usb 3.0 and maybe displayport?
15:38 rshadow joined #mojo
15:41 Janos joined #mojo
15:48 suede no way, how is microsoft becoming so awesome
15:49 suede they are now including code of security patches
15:49 suede for people to audit and make sure things are fixed
15:49 suede https://github.com/Microsoft/ChakraCore/pull/1982
15:50 jberger and right as mac can't seem to stop shooting itself in the foot
15:51 jberger that said, I've quite recently been wrong about predicting outcomes where one choice appears to repeatedly shoot itself in the foot
15:51 jberger so probably you should ignore me
15:53 polettix joined #mojo
16:00 lluad joined #mojo
16:19 disputin1 joined #mojo
16:28 coolo sri: and which colour effect you use? :)
16:28 * coolo has the razor mouse with the stupid colour effects and there it at least has a use case
16:29 sri coolo: still the default for now, which is it slowly fading from one color to the next ;)
16:30 sri it's pretty nice
16:30 sri will prolly just make it stick to one color i like in the end
16:32 sri hard to imagine this was meant to be a gaming keyboard with those switches that feel like cherry blues
16:34 alexbyk alexbyk: test
16:34 batman joined #mojo
16:35 alexbyk Hi people. Let me share a cool way to deal with async stuff (instead of delay) https://gist.github.com/alexbyk/c49a7f6639be744f244327ca9d58c43e Much cleaner code and everyone know how Promises works
16:37 jberger I still can't get myself excited about Promises/Futures
16:38 jberger seems like I'm on the losing side of history though
16:38 jberger delays are a bit verbose but very simple to understand and extend once you grok them
16:38 jberger Futures seem to have all kinds of oddities when you want to make complex behavior
16:39 alexbyk I tried to fetch information from social network and it was a painfull experience. I even switched to blocking code. With promises I'm getting the result much more simple.
16:40 jberger I'll certainly admit that some (most?) people seem to like Futures better, and that's fine, I'm not going to argue it
16:41 sri alexbyk: please don't use the Mojo::Promise namespace
16:41 alexbyk Maybe. But promises have one big + - js is so popular that every second developer will be familiar with promises. To understand Futures you need invest a time
16:41 sri you're taking away a generic namespace from the core project
16:41 alexbyk sri: sorry, that is temporary. I'll change it
16:42 sri oh, you've already got first-come on it :(
16:43 sri would be really nice if you passed that on to me, for future use by the project
16:44 alexbyk I'll do it
16:46 alexbyk I've deleted old releases containing this module a few hours ago. In 7 days (I don't remember how Cpan deletes modules) this namespace will be free
16:47 sri the namespace is never freed, you have to pass first-come manually to someone else
16:48 alexbyk There is no Mojo::Promise module on cpan. It's a file from another repository. Or I still need to do something after deleting this file from main module?
16:49 jberger alexbyk: transfer first-come permissions
16:54 alexbyk Pass maintainership status : select user id. -?
16:54 jberger SRI
16:54 alexbyk ok. done
16:55 jberger alexbyk++
16:56 jberger use the MojoX namespace or some less generic name for your own use
16:57 jberger MojoX::Promise or Mojo::AwesomePromise or the like
16:59 sri alexbyk++
16:59 alexbyk Mojo::Pua - can I continue using it?
17:00 sri thing about promises is that they are only nice if all the non-blocking apis you use are based on promises
17:00 jberger I think Mojo::Pua is pretty safe, sri?
17:00 sri and of course are based on the same or compatible version of promises
17:01 sri yea, Pua is perfectly fine
17:01 sri it's just generic terms we like to keep for core use
17:03 alexbyk Yes. But if some api is based on callback, it's quite easy to convert it to promises. Also spec/a+ was designed so different implementations work together. In the modern world almost every framework provide promises implementation.
17:04 sri not in the perl world
17:04 sri and no, callback apis are not easy to convert at all
17:04 coolo he said the modern world :)
17:05 alexbyk Yeah, but that's because perl is too conservative (or let's face the truth, perl is unpopular nowadays)
17:05 sri coolo: you're lucky i'm so far away now ;p
17:05 alexbyk sri: they can be converted with one function like cb2promise
17:06 sri alexbyk: heh, now you're arguing against promises in perl yourself
17:07 sri alexbyk: there are no callback argument conventions for perl, like ($self, $err, $result), so it's not that easy
17:08 alexbyk What I mean that, for example, your abandoned project Mango could be converted without problems (because it uses a nodejs convention, if I'm not wrong).
17:09 alexbyk I don't use Pg, but I thing it's quite simple to convert all api to promises with either subclassing or with a pg2promise function
17:10 jberger IIRC doesn't Grinnz already have something like that?
17:11 alexbyk but in other languages promises is old news, nowadays Rx patterns is in thend
17:19 buu tyldisc: dunno, it leaks, I killed it at like 3gb
17:20 buu I assume there's no upper limit
17:21 buu Also promises are the devil.
17:23 tl joined #mojo
17:27 buu There is something seriously wrong with the proxy code
17:29 buu Something about running requests through the proxy causes it to develop an internal reference cycle
17:29 buu So you can't free the memory
17:30 sri if there's a leak it will be easy to fix
17:34 buu Ok?
17:34 buu I think it might be new in 7.10ish
17:35 sri you add some weaken call somewhere and it will be fine
17:36 buu Ok?
17:36 buu How do I find it?
17:38 alexbyk Feature request: it would be nice to have an ability to build controller somehow else, for example $builder->build($c). The code is here:
17:38 alexbyk https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Routes.pm#L126
17:38 alexbyk Right now I see the only way to monkey-patch the whole _class function :(
17:40 alexbyk buu: you can monkey-patch Mojo::Base temporary to track invocations of new/DESTROY - it's the easiest way to start with and may help in case there are circ. refs in Mojo::Base subclasses
17:42 alexbyk I not, there are Modules in cpan like LeakTrace (didn't check), but reading its output is hard
17:47 sri if you know it's new you could just bisect it
17:47 sri then Deve::Cycle until you find it
17:47 sri *+l
18:45 polettix_ joined #mojo
18:51 rshadow joined #mojo
18:54 dave Grinz: thanks ... the curl --resolve switch allows curl to use a different IP address for a hostname than the one coming from DNS. It's used for testing (e.g. SNI)
18:54 dave Grinnz: I'll consider making a patch for mojolicious that does that if there's any interest
18:57 jberger dave: I have no idea what that would look like, but maybe come up with an api and show us an example before spending too much time hacking up an inplementation for it
18:57 jberger what I'm saying is ... I don't see that being a likely inclusion (unless it makes testing easier somehow)
18:58 dave it actually looks really easy, since the Net::DNS::Native code was added I know where to do it
18:58 dave the code is in Mojo::IOLoop::Client
18:58 jberger well, by all means, you are welcome to submit something
18:59 jberger but inclusion into core almost always requires two use-cases or being useful to the core itself (I think we have that written down somewhere)
18:59 dave you never use curl --resolve to test SNI? :D
18:59 jberger no?
18:59 jberger I use nginx for ssl termination
19:00 jberger and my apps usually have no idea what their own hostname is
19:01 dave one of my clients runs multiple ssl sites on several servers...they are moving to TLS SNI and we've used this tool several times to determine which cert nginx is using for a particular hostname
19:01 dave you can't just insert a Host: header ;)
19:02 dave so one use case would be using Test::Mojo to make sure the certificate coming back from an unconfigured hostname matches the one you configured nginx to use
19:02 Grinnz jberger: I wrote a function for it in my irc bot framework, mst made a bit more abstract one in a module, not sure if he released it yet
19:02 Grinnz (converting callbacks to Futures)
19:08 tholen_ joined #mojo
19:12 kes joined #mojo
19:14 Grinnz dave: so basically an /etc/hosts style override
19:14 dave yes
19:15 dave you could provide a hash that functions as a host table for example
19:15 dave if the hostname is found as a key in the hash, use that value for the IP address
19:16 dave if the hostname is not found in the hash, do resolution "normally"
19:17 Grinnz sounds easy, but as jberger said things have to actually be useful for mojo core to get accepted
19:17 dave not sure what "useful to mojo core" means :) it'
19:17 dave s no big deal if it doesn't
19:17 dave I maintain a fair number of patches for open source projects already
19:18 jberger dave: if you need new hooks someplace, those may be easier to add
19:18 dave ok, a DNS resolve hook? :D
19:18 jberger but lets see what you come up with (if you are interested)
19:19 jberger I have no idea what is possible
19:19 dave well I kind of have to do this patch (or use /etc/host.conf on FreeBSD) so ... I'll come up with something. I assume there's an approved coding style document somewhere?
19:19 buu jberger: can you try running devel cycle on the new ua proxy object? im away from my pc =[
19:20 jberger buu: ?
19:21 jberger dave: there is a perltidyrc in the dist
19:21 dave before I forget...sri: watch those razer cords. I've stopped using razer gear after several years because the cords always fray after a while
19:21 dave jberger: thanks
19:21 buu jberger: what question?
19:21 purl question is still how I'd parse that
19:22 buu dave: razerblades or the mice?
19:22 jberger buu: I'm knee deep in something else, do you have a test script or something that I missed?
19:22 dave the mice...I also have a keyboard
19:22 dave but it's not used anymore
19:24 buu jberger: not really, its just a basic make ua, call get a bunch of times in a row, ejd up with 3gb ua object
19:24 jberger but you'd need a proxy right?
19:24 Grinnz dave: i like logitech's braided cords
19:24 dave ugh
19:24 buu yes, sorry
19:24 buu its fine witouht one
19:24 Grinnz only had one fray on me and that was after like 8 years
19:24 dave now that would surprise me
19:24 buu when i add a proxy it starys
19:25 dave braided cords are notorious in my life for fraying
19:25 buu starts leaking
19:25 jberger I don't have a proxy handy
19:25 Grinnz i suppose it depends on the environment :P
19:25 jberger and at the moment I'm on a few too many quests as it is
19:25 Grinnz the main reason that cord frayed on me is it was at a certain angle against my subwoofer
19:25 dave Grinnz: I'm hard on equipment, comes from how jury rigged my desk is atm
19:25 buu the new razerblade, which is amazingz, has a braided cord, and im noylt sure i could fray it witha  knife
19:25 Grinnz kept getting caught on it
19:26 dave yeah issues like that is why I went to Apex
19:26 Grinnz however i just wrapped the frayed part in electrical tape :P
19:26 dave especially during a Tribes match
19:27 dave that would work if you catch it early enough
19:27 sri dave: cord looks solid so far, not using a razer mouse with it, but an apple magic trackpad
19:27 dave I'm moving across town in a few days...I'm hoping my new setup will cure these and other issues
19:29 dave sri: you can game with a trackpad? O.o
19:29 sri nope ;p
19:29 dave ah so the razer is for games?
19:29 sri for gaming i have a logitech mouse
19:29 sri razer keyboard
19:30 dave oh! doh
19:30 dave yeah that had a thicker braided cable but one of the usb plugs still frayed after a year
19:30 buu my razer keyboard double typed =[
19:30 dave it was a shame because I liked the click of the razer keyboard
19:31 jberger http://tinyurl.com/jye4upu
19:31 sri razer changed to a new switch manufacturer this year, apparently the quality improved drastically
19:31 * dave facepalms
19:31 purl facepalms are certainly another important measure
19:32 sri jberger: -.-
19:32 dave I'm being pun-ished
19:32 buu i switched to this noname keyboard thats slightly stiffer
19:32 buu its oddly nice
19:33 sri we'll see how it will hold up to constant use
19:34 buu sri have you tried the blades?
19:34 sri nope
19:34 buu theyre super nice
19:37 sri my daily drivers are a 2015 macbook pro and a dell 5510
19:37 polettix joined #mojo
19:38 sri the dell keyboard is pretty bad
19:38 buu Yeah I upgraded from the mbp to the razer
19:39 rshadow joined #mojo
19:39 buu I couldn't live with the random key changes on the mbp
19:39 sri honestly, once the mbp is outdated i have no idea what to do
19:39 sri hopefully there will be new better alternatives
19:39 buu Are you stuck on osx?
19:40 sri depends on your definition, i enjoy working with macos the most
19:40 buu the dell xps 13 and the razerblades are super nice, but not apple
19:40 buu I mean, presumably someday there will be an upgraded mbp
19:41 sri i'm not ready for windows on the desktop, and linux just isn't there
19:41 buu Dunno. I really dont use the desktop for anything
19:41 buu I have literally 4 programs open-- terminal, chrome, file explorer and calibre
19:42 sri it's not just about running a few apps
19:42 buu If I had to do actual work without a network connection I might have a different opinion but so far that hasn't happened
19:42 sri peripherials not working out of the box gets old
19:42 buu Yeah that's why I switched to windows
19:42 sri (linux)
19:43 buu There's possibly some privacy issues but since I use gmail/etc for everything anyways I figure I'm probably already past the horizon point there
19:44 sri earlier i wanted to run a 4k monitor on the dell with linux, well... that's gonna take some more time
19:45 buu really?
19:45 buu I'm running a 4k tv off mine
19:45 orev joined #mojo
19:46 buu Or do you mean things actually scaling
19:46 buu Because yeah that's a thing
19:46 buu also find_cycle on $ua->proxy; doesn't detect a cycle, so
19:46 buu God knows where the memory leak is.
19:46 sri scaling will be a problem too, but i'm still stuck at the getting it to display something part
19:46 buu what output port?
19:46 sri maybe the usb-c docking station needs a firmware update ;p
19:47 buu mmm,  usb, I just used hdmi =/
19:47 sri hdmi would be only 30hz here
19:47 buu Yeah
19:48 buu I had to switch to DP for my actual computer monitor because of that
19:48 buu Which was a bit of a pain
19:48 sri the plan was to go through a usb-c docking station's displayport
19:48 buu Is there some other sane way to find a memory leak in the proxy?
19:49 sri have you bisected it to a commit yet?
19:49 buu I don't have a test case that runs programmatically
19:54 buu sri: Does $proxy end up in the $tx somehow?
19:55 sri just find_cycle($tx) if you're suspicious of an object
19:55 buu I did!
19:56 buu Nothing shows up
19:56 buu I can't reproduce it as a one liner either
19:56 sri that's good... for me ;p
19:57 buu I literally have a perl script at the top says: if( $ARGV[0] ) { $ua->proxy->http($ARGV[0]) }; and when I run it 'perl foo.pl' it hangs out at 50MB for days, if I run it with 'perl foo.pl http://proxy' it gets up to 3GB+
19:58 sri proxy code was changed is 7.09, maybe try 7.08
19:58 sri s/is/in/
19:58 buu ok
19:59 buu Do I need to mess with locallib or what not or can I just cpan it over it
20:31 alexbyk buu:cpanm --notest -L tmp https://cpan.metacpan.org/authors/id/S/SR/SRI/Mojolicious-7.08.tar.gz
20:31 alexbyk perl -I tmp/lib/perl5/ -M"Mojolicious 7.08"
20:31 alexbyk But you can show a leaking code, maybe this would help fixing problem faster
20:38 buu interesting
20:41 rshadow joined #mojo
20:52 Adura joined #mojo
20:59 rshadow joined #mojo
21:10 bpmedley_ joined #mojo
21:17 jberger buu are you actually using $ARGV[0] ?
21:18 jberger @ARGV is very magical and IO::Socket::* is C code
21:19 jberger You might see if a temporary variable breaks your leak
21:31 trwww joined #mojo
21:32 PryMar56 joined #mojo
22:02 PryMar56 joined #mojo
23:42 disputin joined #mojo
23:43 garu joined #mojo
23:43 garu joined #mojo
23:43 disputin joined #mojo
23:44 disputin joined #mojo

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