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

IRC log for #mojo, 2016-11-16

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

All times shown according to UTC.

Time Nick Message
00:28 stryx` joined #mojo
00:48 asarch joined #mojo
01:00 jontaylor joined #mojo
01:54 Paddi joined #mojo
02:30 lluad joined #mojo
02:52 khfeng joined #mojo
02:54 khfeng joined #mojo
02:59 aborazmeh joined #mojo
03:03 khfeng joined #mojo
03:26 Paddi joined #mojo
03:39 noganex_ joined #mojo
03:58 stryx` joined #mojo
05:04 dboehmer joined #mojo
06:34 inokenty-w joined #mojo
06:44 dod joined #mojo
06:48 dod joined #mojo
06:50 dod joined #mojo
06:52 dod joined #mojo
07:19 Vandal15263 joined #mojo
07:23 mbudde joined #mojo
08:03 simbabque joined #mojo
08:28 trone joined #mojo
08:32 rshadow joined #mojo
08:45 parv joined #mojo
09:16 inokenty-w joined #mojo
09:24 rshadow joined #mojo
09:33 jontaylor joined #mojo
09:59 rshadow joined #mojo
10:00 mtths joined #mojo
10:08 gregf_ joined #mojo
10:34 tempire Whoa
10:34 tempire Look at all this fancy stuff in Mojo::Util
10:36 mishanti1 Mojo::Util is indeed pretty sweet.
10:49 sri anyone here got experience with fedmsg?
10:49 sri i need more arguments against it ;p
11:04 tchaves joined #mojo
11:09 eseyman the only real arguement against it is that it hasn't really taken off outside of Fedora
11:10 eseyman Debian used it for a while then dropped it
11:14 Paddi joined #mojo
11:17 mgrimes Am I doing something wrong, of can you not use Mojo::UserAgent->new->post() for non-blocking requests in a controller? $self->ua->post() works just fine.
11:19 Jonis you're probably having the useragent object going out of scope if I were to guess, why not use $self->ua->post?
11:19 Jonis I'm trying to figure out non-blocking bridges, and in the process trying to figure out how to do a proper non-blocking helper
11:20 Jonis so say I have a helper that does a Mojo::Pg query, is it ok to pass $delay->begin to the helper and return values with that as callback?
11:21 mgrimes I want to subclass Mojo::UserAgent to return promises
11:24 jontaylor joined #mojo
11:24 mgrimes Jonis: I think the scope was the problem. Thanks!
11:24 Jonis :)
11:24 Jonis glad to help
11:25 mgrimes Is there a Mojo-approved way to keep it in scope? Sticking it in the stash works, but feels wrong.
11:29 Jonis $app->helper(foo => sub { state $bar = Mojo::UserAgent::Subclass->new }) ?
11:29 Jonis maybe?
11:29 purl Maybe not.
11:35 mgrimes That should work. Thx
11:43 henq joined #mojo
12:43 sri eseyman: you know why debian dropped it?
12:43 sri honestly, fedmsg looks pretty shitty to me ;p
12:45 sri custom protocol layered on top of zmq, with only clients for python, requires lots and lots of components to route messages around, and you need a central config file to keep all the addresses of message producers (yay, distributed zmq)
12:47 dod joined #mojo
12:59 eseyman sri: the guy who was advocating for it got lonely
13:00 eseyman the python issue is the only real big problem
13:00 eseyman the fedmsg guys have asked me if it was feasible to do a fedmsg extension for bugzilla but that really requires perl code
13:01 sri i heard they have to use an amqp to fedmsg gateway for bugzilla
13:07 marcus joined #mojo
13:10 marcus joined #mojo
13:35 gizmomathboy joined #mojo
13:39 gizmomathboy joined #mojo
13:40 rshadow joined #mojo
13:59 Pyritic joined #mojo
14:00 ivi joined #mojo
14:12 zivester joined #mojo
14:14 ramortegui joined #mojo
14:22 Paddi joined #mojo
14:22 dod joined #mojo
14:27 dod joined #mojo
14:41 alexbyk joined #mojo
14:46 sri OMG
14:46 sri the speaker grills on the new 13" macbook pro are fake :o
14:50 batman does it matter?
14:52 Paddi joined #mojo
14:55 Janos joined #mojo
15:11 dod joined #mojo
15:11 asarch joined #mojo
15:17 dod joined #mojo
15:40 stryx` joined #mojo
15:42 marty I'm about ready to order a 13" & 15" macbook.  I'll report back on how they look.
15:43 genio I'm pretty well convinced my next machine will be a MS net book
15:49 marty I would consider going back to Linux on generic hardware if it was just me.  But supporting employees is still much easier on OSX
15:55 genio we're in a very AD-centric environment. managing OS X machines here is annoying
15:56 genio Apple doesn't exactly make it easy with the App store requiring an account to do normal updates. we can't easily push updates, we can't restrict with GPOs etc.
15:56 genio the only easy thing is joining the machine to the domain for auth.
16:02 marty Agreed.  The app store requiring an account for updates is one of my biggest gripes.   I have no idea how large companies manage their macs efficiently.
16:03 zivester joined #mojo
16:03 marty But I'd still rather deal with that rather than the alternatives.
16:05 marty crap.  I can't order airpods or a 5k screen until December?   Dang!  Was hoping to get it done in one shot.
16:08 VVelox joined #mojo
16:08 disputin joined #mojo
16:09 marcus I quite enjoy linux on the mbp
16:10 sri marty: hahaha, first world problems
16:10 sri marcus: i just can't enjoy linux desktops
16:11 marcus sri: i3 ftw
16:11 mcsnolte joined #mojo
16:13 sri marcus: it's not just the desktop environment, but also peripherals not working
16:13 sri like, try to use a 4k external display on a linux laptop with an fhd built-in display
16:14 marcus sri: Well, I am using my retina mbp display without trouble now.
16:14 sri or plug in a headset for video conferencing every day and have it randomly mess up sound settings
16:15 sri marcus: gtk for example can only have one scaling factor for all displays
16:16 marcus yeah, it's certainly not perfect. but working with external displays on osx sucks a lot too. apart from getting dpi right, it's pretty good with i3
16:17 sri my 4k display just worked with the rMBP
16:17 marcus I kinda wish the peripheal handling in linux was desktop agnostic tho, instead of inside each desktop environment
16:18 marcus sri: I'm more thinking of how multiple screens are handled in general, with switching between windows/spaces and all that
16:18 marcus it's a bit wonky in osx imo
16:19 sri ok, i'm using the rMBP in clamshell mode when connected to the external display
16:19 sri little screen next to the big one annoys me ;p
16:20 marty I do the same.  I close my MBP when hooked up to my thunderbolt display and it works fine.
16:21 sri marty: hope you're not getting the lg 5k display, that forehead is soooo ugly
16:22 marty Ya, I'm going to get the LG 5k.  :(  I agree, it's ugly as sin.  But what are the alternatives?
16:23 marty I was really hoping Apple would release a new 27 inch 5k thunderbolt 3 monitor.
16:23 sri doesn't dell have a reasonably good one?
16:23 marty not sure, I'll check
16:24 sri Dell UP2715K looks just like my 4k monitor
16:33 dod joined #mojo
16:44 coolo sri: oh! girlmore girls are back!
17:14 dod joined #mojo
17:19 stryx` joined #mojo
17:29 sri yay \o/
17:33 tempire I tried ubuntu recently. It still feels unfinished.
17:46 coolo sri: round 13 results are in and cutelyst beats ya!
18:00 henq joined #mojo
18:07 Lee_ joined #mojo
18:23 genio I never did watch Gilmore Girls. Was it a good show?
18:26 * tyldis is scared
18:26 tyldis Microsoft joined The Linux Foundation?!
18:27 tyldis And a big chunk of Broadcom chips got their docs released?
18:29 jberger and google joined the .net steering group
18:31 tyldis Must be a reaction to the election
18:39 batman make linux great again...?
18:39 * batman hides
18:39 CandyAngel Going to build a firewall. Make the malware pay for it.
18:39 rshadow joined #mojo
18:40 batman haha
18:41 jberger CandyAngel++
18:42 spicyjack It will be such a beautiful firewall
18:42 spicyjack You've never seen such a beautiful firewall
19:17 PryMar56 joined #mojo
19:19 orev joined #mojo
19:21 Pyritic joined #mojo
19:22 orev how can I use a variable in a mojo template as argument to a tag helper, such as: <%= form_for $target %>.  There's so much magic in mojo I get confused
19:22 pink_mist what's wrong with that?
19:23 preaction orev: just like that
19:23 preaction mojo templates are less magic than it might seem: they basically get translated into Perl code and evaluated
19:23 orev preaction: how do I set the variable then?  stash?
19:23 jberger orev: what preaction said, there's really very little magic
19:23 pink_mist orev: yes, stash
19:23 preaction orev: % my $foo = "Bar";
19:23 pink_mist or that
19:23 preaction oh, yes, stash
19:24 preaction <%= form_for stash 'target' %> is likely better though
19:24 orev I mainly get confused about how to get data into the templates, but ok, that helps
19:24 preaction leave the local lexical namespace for the template itself
19:24 orev can I pass that as part of the render call, or stash it first, then call render?
19:25 jberger <%= form_for stash('target') || 'default_target' %> even
19:25 preaction i tried reimplementing the EPRenderer and got into trouble by using scalars more than i should, which makes for a very, very poor API
19:25 preaction part of the render call
19:25 jberger orev: either works
19:25 pink_mist the render call can take stash parameters
19:25 orev ok.
19:25 orev see, too much magic :)
19:25 preaction it all just _seems_ like magic ;)
19:25 preaction because it DTRT and DWIM a lot
19:40 dod joined #mojo
19:41 rshadow joined #mojo
19:46 jontaylor joined #mojo
19:57 henq joined #mojo
20:12 Pyritic joined #mojo
20:16 Lee joined #mojo
20:34 gbhat joined #mojo
20:36 gbhat Hi! I need some help with Mojo's event loop - Here is what I want to do and where it fails. Would really appreciate advice:
20:37 gbhat I make a request to a Mojolicious end point. The action there first forks. In the child I reset the ioloop singleton in the child like this - Mojo::IOLoop->singleton->reset
20:38 gbhat After that start a series of non-blocking http requests with call-backs
20:39 gbhat However, each of these requests fail with "Premature Connection Closed" much before the standard 20 second timeout.
20:39 gbhat But let me see if I can paste some code
20:40 rshadow joined #mojo
20:41 mishanti1 gbhat: Might it be that your $ua is going out of scope?
20:45 gbhat http://pastebin.com/EJEQgJFa
20:45 gbhat mishanti1: Yes - I think so too. But how do I prevent that
20:46 gbhat I have pasted a summary of the code without the $self->render_later which gets called before the code hists this fragment.
20:59 rshadow joined #mojo
21:07 Lee joined #mojo
21:08 jontaylor joined #mojo
21:09 vicash Hello. I am having some utf8 problems. I am using Mojo::Pg to store utf8 encoded strings in the database, which has an encoding of UTF-8.  However, the characters don't seem to be stored as expected. I get an A with an accent for all the utf8 characters. is there something I need to do ? I have already run encode('UTF-8', $str) on the string before storing it in the database.
21:12 Grinnz gbhat: you need to store the Mojo::UserAgent somewhere outside of that request. once it sets up that delay it exits that scope and lets the event loop run
21:12 Grinnz gbhat: also, you should really put that followup in a step in the delay, rather than using the finish event
21:13 Grinnz see for example https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Concurrent-blocking-requests
21:13 Grinnz you can just pass the step as a subroutine to $ioloop->delay()
21:14 gbhat Grinnz: Appreciate your response. Let me read your response slowly…. :)
21:14 Grinnz vicash: don't run that. DBD::Pg should encode your strings as needed
21:15 Grinnz vicash: you should be passing unencoded characters, and receiving unencoded characters
21:15 vicash Grinnz: ok, i will try that.
21:15 Grinnz vicash: what you're doing works as well, as long as you don't mind it being double encoded in the database and decoding it manually when you retrieve it :)
21:18 vicash Grinnz: is there a perl module that converts UTF8 punctuation like '-' to ASCII variants?
21:19 Grinnz yes, let me see if i can remember
21:19 Grinnz also to be precise, that's Unicode, not UTF8
21:19 Grinnz https://metacpan.org/pod/Text::Unidecode
21:19 vicash Grinnz: yes I meant Unicode. thanks.
21:20 marty_ joined #mojo
21:36 gbhat Grinnz: I now get the fact that $ua goes out of scope - Two questions for my own understanding - Why is the step pattern is better than ->on(finish ….) and cant I salvage my fragment if I call $delay->wait ? Thanks!!
21:37 Grinnz gbhat: $delay->wait won't do anything when the event loop is alraedy running (you don't want to re-enter an event loop)
21:37 gbhat Not that I want to salvage it - But it would help me understand this a bit better
21:37 Grinnz as for finish, it's just not commonly used, the steps are there for this purpose
21:37 gbhat Got it. Thanks a ton
21:38 gbhat And where exactly does the event loop start in the cookbook example?
21:38 gbhat The wait call starts it?
21:38 Grinnz in the coookbook example, the event loop isn't running at all until $delay->wait is called, which blocks until the event loop stops when it's done
21:39 gbhat OK.
21:39 jontaylor joined #mojo
21:40 rshadow joined #mojo
21:42 marty joined #mojo
22:00 marty joined #mojo
22:03 Lee joined #mojo
22:19 Lee joined #mojo
22:25 batman joined #mojo
22:31 polettix joined #mojo
22:53 lluad joined #mojo
23:03 marty_ joined #mojo
23:04 jontaylor joined #mojo
23:04 marty joined #mojo
23:11 jnbek joined #mojo
23:13 gbhat1 joined #mojo
23:28 gbhat1 Grinnz: Hi - I did as advised - but $ua still goes out of scope in the child - Here is my method. http://pastebin.com/LZUCAgH7 I must add that the cookbok example does work and the only thing I do here is to reset the event loop in the child. Can you see anything else that might be required after a fork? Thanks as always,.
23:29 gbhat1 pardon the typo on line 11. Issue with my copy-pasta
23:30 Grinnz gbhat1: your useragent is still only in scope until it returns. your delay has not run yet when you return
23:31 gbhat1 Oh!! $delay->wait wont block?
23:31 Grinnz not if the event loop is currently running
23:33 gbhat1 How can I block then? add the two ua's to $delay->steps() ?
23:33 Grinnz you can use a separate inner event loop if you want it to block: my $loop = Mojo::IOLoop->new; my $delay = $loop->delay(....
23:34 pink_mist Grinnz: 0_o isn't that a singleton?
23:34 Grinnz Mojo::IOLoop->singleton gives you the singleton
23:35 Grinnz you can have as many poll-based event loops as you want (EV will fallback to giving you a poll reactor for subsequent loops)
23:35 Grinnz Mojo::IOLoop->new is akin to IO::Async::Loop->really_new
23:36 pink_mist oh, huh
23:36 pink_mist learned something new =)
23:36 pink_mist Grinnz++
23:42 marty joined #mojo
23:42 gbhat1 Grinnz:  Sorry - feeling a bit daft :) - "inner" would mean inside which?
23:47 Grinnz gbhat1: as opposed to the outer event loop, which is the singleton
23:47 Grinnz and currently running at the time when you fork
23:48 gbhat1 Doesn't the reset stop that one?
23:48 Grinnz you're still in a "callback" of something
23:50 marty_ joined #mojo
23:51 Grinnz batman: would you be interested in PRs to support more commands in Mojo::Redis2? particularly dump/restore, touch, migrate, pttl/pexpire/pexpireat, the scripting commands, and if i find any others i need :)
23:51 Grinnz no idea when i would find the time to actually do so
23:52 Grinnz oh yes, and geo

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