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

IRC log for #mojo, 2017-04-05

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

All times shown according to UTC.

Time Nick Message
00:22 jberger marcus++ on the morbo backends
00:22 jberger I wonder when someone will implement https://metacpan.org/pod/Win32::ChangeNotify ?
00:23 jberger implement **one with** that
00:23 SwellJoe joined #mojo
01:26 dhg joined #mojo
01:27 jberger ok, I got curious: https://gist.github.com/1badbc7b8b6eb0daea4aa5d63743a6c8
01:27 jberger maybe someone wants to try that?
01:28 jberger I can't, I don't have windows ;-P
01:32 Yysachinyy joined #mojo
01:33 marty joined #mojo
01:40 tchaves joined #mojo
01:53 marty joined #mojo
02:15 marty joined #mojo
02:31 zivester joined #mojo
02:32 noganex_ joined #mojo
02:37 Janos joined #mojo
03:29 arcanez what's a windows
03:29 purl a windows is one hell of an event! or crashing on someone or very pretty when the computer is powered off or rebooting or lacking that tool you want or withering intravenous necrotic deteriorative ostensive weakening syndrome
03:29 arcanez purl: botsnack
03:29 purl thanks arcanez :)
03:38 SwellJoe joined #mojo
03:47 stryx` joined #mojo
04:01 stryx` joined #mojo
04:04 dboehmer joined #mojo
04:20 jberger arcanez: heh, while I know what you mean, some people do use it, and for them morbo has always been a pain point
05:06 SwellJoe joined #mojo
05:08 arcanez what do other servers use?
05:08 arcanez and/or do
05:14 disputin joined #mojo
05:21 inokenty-w joined #mojo
05:34 dhg joined #mojo
05:45 dod joined #mojo
05:48 dod1 joined #mojo
06:16 dod joined #mojo
06:37 dod joined #mojo
06:48 SwellJoe joined #mojo
07:03 AndrewIsh joined #mojo
07:30 VVelox joined #mojo
07:37 trone joined #mojo
08:07 Vandal joined #mojo
08:29 osfabibisi joined #mojo
08:36 hahainternet joined #mojo
09:13 tardisx joined #mojo
09:15 rshadow joined #mojo
09:31 irqq joined #mojo
09:32 rshadow joined #mojo
09:46 rshadow joined #mojo
10:33 elik joined #mojo
10:38 HtbaaPi I'm running into some problems with Hypnotoad behind Apache/mod_proxy. My app has an action where it can upload several files to its own API and from time to time I'm getting a Proxy Error
10:39 HtbaaPi when uploading to itself I make sure to call $self->ua->inactivity_timeout(0) before doing the post and in my Apache config I've set timeout=600 keepalive=On retry=1 acquire=3000 on the ProxyPass directive
10:40 HtbaaPi but Apache sometimes reports: Error reading from remote server. The Proxy server received and invalid response from an upstream server
10:41 HtbaaPi Apache error log reports AH01102: error reading status line from remote server 127.0.0.1:5000
10:42 HtbaaPi Hypnotoad has been configured with 8 workers, proxy = 1 and heartbeat_timeout set to 60
10:44 HtbaaPi never run into these issues when using nginx, but can't use nginx anymore in this case
10:44 * HtbaaPi out for lunch
10:44 foursixnine joined #mojo
11:12 coolo what is the quickest way to write simple procedures that are too long for eval (or have too complex quoting in my case when used from bash), but are only one time scriptlets?
11:13 coolo right now I'm always patching the app, run eval app->mything and then repatch the app
11:13 coolo but it feels like there is a better way
11:20 tchaves joined #mojo
12:04 jberger But writing a command is too much?
12:07 jberger You can instantiate the app in a script
12:07 jberger http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Application-embedding
12:41 dotan_convos joined #mojo
12:46 coolo jberger: that's it - thanks
13:10 marty joined #mojo
13:11 dod joined #mojo
13:12 HtbaaPi hmm I think I've narrowed it down a bit. Inside the action of a controller I'm uploading a file which can  be big.
13:12 HtbaaPi So I've set inactivity_timeout to 0, but even so I'm getting a 'Premature connection close' error
13:26 marty joined #mojo
13:31 HtbaaPi ah, fixed it! The action that was actually responsible for receiving the upload needed to have an increased inactivity_timeout
13:32 dhg joined #mojo
13:39 purl joined #mojo
13:45 gryphon joined #mojo
14:13 jberger HtbaaPi: you are uploading a file from the app to itself?
14:22 Pyritic joined #mojo
14:23 zivester joined #mojo
14:35 arcanez any idea if, with Mojo::Pg, it'd be better to SELECT foo AS bar, foo AS baz, foo AS quux FROM this and then ->hashes->to_array, or SELECT foo FROM this and ->hashes->map(sub { bar => $_->{foo}, baz => $_->{foo}, quux => $_->{foo} }) or am I micro-optimizing
14:41 jberger you are probably micro-optimizing, but I'm generally of the belief that pushing things into the database is going to be fastest
15:02 gizmomathboy joined #mojo
15:06 bc547 joined #mojo
15:26 stryx` joined #mojo
15:31 disputin joined #mojo
15:36 stephan48 arcanez: you are micro-optimizing. aliasing in the db is faster than the map. its wasting negletable time in the db vs wasting non negletable time on mojo side. actually i think the latter might perform worse as you end up with a second loop over the data.
15:36 stephan48 you could run the two queries with "explain analyze ... " to see if theres any impact at all on the database side
15:37 stephan48 saves you the time of even getting a predictable Benchmarking setup on the perl side just to see that you wasted more time than its worth
15:41 PryMar56 joined #mojo
15:52 Grinnz https://metacpan.org/release/TURNSTEP/DBD-Pg-3.5.9_1 quite a dev release
16:04 arcanez Switched canonical repo to git://github.com/bucardo/dbdpg.git
16:05 arcanez Support for number of rows greater than an "int".
16:05 arcanez that's a lot of results.
16:06 arcanez stephan48: that's what I figured (more the micro-optimization) but wanted to make sure I wasn't overlooking anything
16:07 sh14 joined #mojo
16:08 greg joined #mojo
16:10 greg I am having some trouble understanding Mojo's content negotiation. Why does $types->detect('application/json, text/plain, */*') return an empty array? In particular, I am trying to understand why this accept header (from Angular) does not match json
16:16 howitdo joined #mojo
16:53 rshadow joined #mojo
16:58 cfedde joined #mojo
17:21 jberger greg: as documented, if you want to do that, you need to pass a true value as the second argument
17:21 jberger http://mojolicious.org/perldoc/Mojolicious/Types#detect
17:23 greg jberger: ah, sorry, I should have caught that. I am not using ->detect directly, but through `->respond_to` and was digging through the code trying to figure out why it wasn't working
17:24 greg is it possible to do something similar with `->respond_to`?
17:24 jberger no idea
17:25 jberger tbh I didn't know that was a thing
17:27 jberger it seems like it should do that if the request was XHR
17:27 jberger how is the request being made?
17:28 dod joined #mojo
17:28 greg Angular, but it is possible something is interfering with the xhr detection. Trying to find that code
17:29 jberger https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Renderer.pm#L30
17:29 jberger https://github.com/kraih/mojo/blob/master/lib/Mojo/Message/Request.pm#L96-L98
17:33 greg Thanks. That gives me something to dig into a bit further. It'd be nice if there was a way to enable that for non-XHR requests as well. I am not sure there is even a way to enable it when using the "advanced"  negotiation using `->accepts`
17:45 jberger I'm guessing that that code exists in that way for a reason
17:46 jberger like perhaps XHR does that strange Accepts header according to a spec
17:46 jberger greg: did you figure out what method was used to generate the request
17:46 jberger ?
17:46 jberger I'm curious is perhaps Fetch behaves like XHR but has a different header
17:49 irqq joined #mojo
17:50 greg oh, I am sure it does. :-) It was surprising to me as I usually expect content negotiation to look at the different parts of the Accept header, not ignore it when there is more than one entry. I think something is preventing the header from being added in this case, but I haven't found the culprit yet
17:50 jberger I'm out of my depth
17:53 greg yeah, the exact issue of the missing X- header is likely a JS/browser issue at this point. The limitations of the content negotiation could be documented a bit more clearly in Mojo, but perhaps I was just not looking in the right places.
17:58 jberger note that you can force it by using a "file extension"
17:58 jberger ie, /some/path.json
17:58 greg Thanks. I did see that, as well as the format param
17:59 jberger yeah
17:59 rshadow joined #mojo
18:21 irqq_ joined #mojo
18:36 sri hmm, guess i shouldn't have voted on https://github.com/kraih/mojo/pull/1080
18:37 sri most folks prolly assume it's already over if i voted against it
19:01 dantti_laptop joined #mojo
19:11 stryx` joined #mojo
19:31 sri this is actually pretty cool https://explainshell.com
19:31 pink_mist wow, nice
19:37 Grinnz neat
19:39 Grinnz it seems confused by this one
19:39 Grinnz if [[ $# -eq 0 ]]; then set $@ 'production'; fi
19:39 Grinnz maybe doesn't understand [[
19:45 dantti_laptop joined #mojo
20:40 irqq joined #mojo
21:57 ashimema joined #mojo
22:23 marty_ joined #mojo
22:24 marty joined #mojo
22:53 marty joined #mojo
22:55 dhg joined #mojo
23:07 jlaffaye joined #mojo
23:13 zivester joined #mojo
23:13 nicomen joined #mojo
23:19 marty joined #mojo
23:23 marty joined #mojo
23:34 Lee joined #mojo
23:37 Peppaq joined #mojo
23:47 irqq_ joined #mojo

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