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

IRC log for #mojo, 2017-03-15

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

All times shown according to UTC.

Time Nick Message
00:02 VVelox joined #mojo
00:05 mmp /b 32
00:24 batman joined #mojo
00:27 castaway joined #mojo
00:39 kaare_ joined #mojo
01:02 polettix joined #mojo
01:15 veryrusty joined #mojo
01:45 polettix joined #mojo
01:47 aborazmeh joined #mojo
02:02 veryrusty joined #mojo
02:06 VVelox joined #mojo
02:38 veryrusty joined #mojo
02:46 stryx` joined #mojo
03:38 noganex_ joined #mojo
03:56 orev1 joined #mojo
03:56 hernan605 joined #mojo
03:56 irqq_ joined #mojo
03:58 karjala_ joined #mojo
03:58 da5id_ joined #mojo
03:58 Peppaq joined #mojo
03:59 firnsy_ joined #mojo
03:59 gabriel_ joined #mojo
03:59 cosimo_ joined #mojo
04:00 kamyl joined #mojo
04:00 tinita_ joined #mojo
04:00 Andreas2 joined #mojo
04:00 pink_mis1 joined #mojo
04:02 Xyem- joined #mojo
04:03 mtths joined #mojo
04:03 abracadaniel joined #mojo
04:03 HtbaaPi joined #mojo
04:03 nicomen joined #mojo
04:03 oalders joined #mojo
04:03 ksmadsen joined #mojo
04:03 nic joined #mojo
04:03 Gedge joined #mojo
04:03 px80 joined #mojo
04:03 zach joined #mojo
04:03 a6502 joined #mojo
04:03 wardenm joined #mojo
04:03 crab joined #mojo
04:03 haarg joined #mojo
04:03 stephan48 joined #mojo
04:03 tudorconstantin joined #mojo
04:03 bobkare joined #mojo
04:03 augensalat joined #mojo
04:03 Jonis joined #mojo
04:03 matt_ joined #mojo
04:03 hahainternet joined #mojo
04:03 simcop2387 joined #mojo
04:03 tyldis joined #mojo
04:03 Lee joined #mojo
04:03 Sebbe joined #mojo
04:03 elik_ joined #mojo
04:03 litwol joined #mojo
04:03 kgoess joined #mojo
04:03 perlpilot joined #mojo
04:03 iamb joined #mojo
04:03 PryMar56 joined #mojo
04:03 ashimema joined #mojo
04:03 castaway joined #mojo
04:03 VVelox joined #mojo
04:03 noganex_ joined #mojo
04:03 tianon joined #mojo
04:03 cstamas joined #mojo
04:03 ranguard joined #mojo
04:04 mbudde joined #mojo
04:04 TBSliver joined #mojo
04:05 jnbek joined #mojo
04:05 jlaffaye joined #mojo
04:05 tempire joined #mojo
04:05 itaipu joined #mojo
04:05 veryrusty joined #mojo
04:05 aborazmeh joined #mojo
04:05 zivester joined #mojo
04:05 coolo joined #mojo
04:05 dotan_convos joined #mojo
04:05 vicash joined #mojo
04:05 jacobydave joined #mojo
04:05 saki joined #mojo
04:05 mmp joined #mojo
04:05 diegok joined #mojo
04:05 bc547 joined #mojo
04:05 lari joined #mojo
04:05 go|dfish joined #mojo
04:05 charsbar joined #mojo
04:05 vytas joined #mojo
04:05 vinnix joined #mojo
04:05 Kundun joined #mojo
04:05 Bender joined #mojo
04:05 alilles joined #mojo
04:05 eseyman joined #mojo
04:05 foursixnine joined #mojo
04:06 geheimnis` joined #mojo
04:06 ribasushi joined #mojo
04:06 mtj joined #mojo
04:06 jberger joined #mojo
04:06 gabiruh_ joined #mojo
04:06 suede_ joined #mojo
04:06 khfeng_ joined #mojo
04:06 omega_ joined #mojo
04:06 ralesk_ joined #mojo
04:06 phillipadsmith joined #mojo
04:06 robert joined #mojo
04:06 esh_ joined #mojo
04:06 odc joined #mojo
04:06 sri joined #mojo
04:06 SmokeMachine joined #mojo
04:06 mrallen1 joined #mojo
04:06 stryx` joined #mojo
04:06 cfedde joined #mojo
04:06 gregf_ joined #mojo
04:06 Phil21 joined #mojo
04:06 howitdo joined #mojo
04:06 michael joined #mojo
04:06 jabberwok joined #mojo
04:06 Zx3 joined #mojo
04:06 prg joined #mojo
04:06 chansen joined #mojo
04:06 dustinm joined #mojo
04:06 jnap joined #mojo
04:06 bjakubski joined #mojo
04:06 Grinnz joined #mojo
04:06 Snelius joined #mojo
04:06 preaction joined #mojo
04:06 bwf joined #mojo
04:06 msestak_ joined #mojo
04:06 kwa joined #mojo
04:06 genio joined #mojo
04:06 mishanti1 joined #mojo
04:06 mat joined #mojo
04:06 Obbi joined #mojo
04:06 mpapec joined #mojo
04:06 Eke joined #mojo
04:06 jesk joined #mojo
04:06 plicease joined #mojo
04:06 xdg joined #mojo
04:06 purl joined #mojo
04:06 yuni joined #mojo
04:07 caeles joined #mojo
04:07 Caldrin joined #mojo
04:08 rwh21 joined #mojo
04:09 simbabque joined #mojo
04:10 garu joined #mojo
04:15 BinGOs joined #mojo
04:20 garu joined #mojo
04:22 faraco joined #mojo
04:25 garu_ joined #mojo
04:27 faraco Hi guys, how do you actually use plugin in Mojolicious app (no lite)? I already declared '$self->plugin('Mojolicious::Plugin::OAuth2);' in lib/MyApp.pm, but when I'm using it from a controller class 'MyApp::Controller::User' login, I got the syntax error in using the plugin.
04:28 faraco The plugin usage code in MyApp::Controller::User, I use it from here - https://metacpan.org/pod/Mojolicious::Plugin::OAuth2#SYNOPSIS
04:28 faraco I'm not sure if you can use plugin "the_plugin" => {blah}; in a full featured Mojolicious app.
04:29 tyldis Usually the plugin will register some helers for you if you need to call stuff on it
04:29 tyldis And that should be documented
04:30 faraco hmm, the synopsis only show usage with Mojolicious::Lite, hmm.
04:31 tyldis That part should be identical
04:31 tyldis Looking at the source, it sets a number of helpers. All accessible through the controller
04:32 tyldis So I think you need to show some code
04:32 veryrusty joined #mojo
04:34 faraco http://paste.scsys.co.uk/557494?tidy=on&hl=on&submit=Format+it%21
04:34 faraco tyldis:
04:37 faraco I may have to use the alternative - https://metacpan.org/pod/Net::Facebook::Oauth2, but not sure how well it will integrate with Mojo.
04:38 tyldis faraco: I'm no expert, but try installing the plugin inside the main startup sub instead. And there you need to initialize it with the non-lite syntax ($self->plugin(OAuth2))
04:38 faraco will try
04:46 inokenty-w joined #mojo
04:55 itaipu_ joined #mojo
05:04 dboehmer_ joined #mojo
05:39 veryrusty joined #mojo
05:48 kaare joined #mojo
05:54 faraco hmm..this is weird, I try to facebook authenticate, but I always get
05:54 faraco [error] [auth_url] 'key' for facebook is missing at /home/faraco/perl5
06:15 dod joined #mojo
06:49 VVelox joined #mojo
06:58 dod joined #mojo
07:34 Vandal joined #mojo
07:41 polettix joined #mojo
07:47 janl joined #mojo
07:49 Janos joined #mojo
07:52 AndrewIsh joined #mojo
08:29 trone joined #mojo
08:31 sri faraco: http://mojolicious.org/perldoc/Mojolicious/Lite#Plugins
08:59 rshadow joined #mojo
09:12 dod joined #mojo
09:35 wardenm joined #mojo
09:36 aborazmeh joined #mojo
09:45 kwa_ joined #mojo
09:48 kwa joined #mojo
09:50 kwa joined #mojo
09:53 sri cool to see minion just humming along with 500k jobs and a huge dependency graph
09:55 kwa sri: Just noticed the update to minion. Can't work out the subtle different between the @> contains and ANY.
09:56 coolo kwa: don't worry, took sri 3 hours :)
09:57 kwa coolo: heh. Contains checks element by element, any uses some funky algorithm?
09:57 prg short of setting $minion->remove_after to a non-numeric value, there's simply no way of retaining all jobs, is there?
09:58 sri kwa: it's about index use
09:58 sri one can use the primary key index, the other can't use an index
09:59 kwa ahh
10:00 sri took me way too long to grok :S
10:03 sri prg: no
10:03 sri i might accept a pull request for making 0 disable it though
10:03 sri or undef
10:04 prg sri: ok, thanks
10:04 sri you're the first to ask
10:04 prg strange
10:06 sri maybe i would not accept a pull request
10:06 prg :(
10:06 prg i just forked it
10:06 prg what's the problem?
10:06 purl somebody said the problem was semantics
10:06 sri an ever growing queue table will have performance implications that we don't optimize for
10:07 kwa sri: Yeah, thinks like that are easy to miss in development. While looking into your commit, I noticed a random article suggesting IN SELECT UNNEST > ANY - https://coderwall.com/p/jmtskw/use-in-instead-of-any-in-postgresql - but have no opinion on it.
10:07 prg purl, the problem is you
10:07 purl ...but problem is semantics...
10:07 sri optimizations might even conflict with how it's commonly used
10:07 prg purl: no, the problem is you
10:07 purl okay, prg.
10:07 prg sri: hm, ok. and a disclaimer in docs won't do?
10:08 sri i just don't see us optimizing for queues with a billion old jobs for example
10:08 prg yeah, i get that
10:09 kwa prg: You could always add a trigger to "archive" jobs when they're completed (if they're needed for auditing/statistical purposes).
10:10 prg in my use case i'll have <10.000 jobs per year, so i think i would be fine
10:10 prg kwa: yeah, i guess i'll have to do something like that :/
10:13 sri btw. i just used Test::Mojo config overrides to clean up some very very ugly code, and it's so nice
10:14 sri prg: i guess it would depend on if others want the feature too... (even with the problems)
10:18 prg sri: how about using a trigger to disable DELETE on minion_jobs?
10:18 sri i liked the archiving idea
10:20 prg this kinda clashes with my existing frontend :/
10:20 sri which reminds me that i could have really used a minion web ui for this app
10:21 prg it's fun watching jobs being processed :D
10:22 sri yea, would be nice to watcha  dashboard with live stats and click through jobs to see their results
10:23 sri https://raw.githubusercontent.com/mperham/sidekiq/master/examples/web-ui.png
10:23 sri this is basically the ui i want http://hangfire.io
10:24 sri maybe next suse hackweek
10:25 rshadow joined #mojo
10:26 prg expiring jobs is a Pro feature in sidekiq ;)
10:27 stryx` joined #mojo
10:35 irqq joined #mojo
10:57 stryx` joined #mojo
11:10 prg btw, only successful jobs are cleaned up, right? so there's a scenario where the queue table could fill up with failed jobs...
11:31 janl left #mojo
12:00 salv0 joined #mojo
12:26 rshadow joined #mojo
12:35 dod joined #mojo
12:41 batman joined #mojo
12:41 dod joined #mojo
12:57 aborazmeh joined #mojo
13:07 pink_mist joined #mojo
13:15 asarch joined #mojo
13:15 gryphon joined #mojo
13:33 kaare joined #mojo
13:38 Pyritic joined #mojo
14:07 gizmomathboy joined #mojo
14:32 zivester joined #mojo
14:49 jberger my Minion::Monitor code is still ready for someone to help build a front-end
14:49 jberger it is probably missing a few of the newer options but they shouldn't be hard to add
14:50 jberger (I don't think it knows about parents for example)
15:30 jabberwok jberger: looks like a fun project.
15:33 jabberwok Mucking with paths is such a bother. So I can make Mojo::File->new($self->app->home) which is e.g., "/home/luser/Stuff/myapp/script/.."
15:33 jabberwok but then I have a config parameter that could either be relative like "uploads/" or absolute like "/var/run/myapp/uploads/"
15:33 jabberwok Mojo::File doesn't seem to have anything useful to combine those, or what's the best practice?
15:35 lluad joined #mojo
15:38 haarg my $p = path($path); $p = $home->child($p) if !$p->is_abs;
15:38 itaipu joined #mojo
15:39 haarg does seem like something missing
15:43 jberger that's basically what I do in my stuff
15:43 jberger (although I use unless rather than if !)
15:43 mat mmm, is there a way to know if a helper is used in a template or in a controller ?
15:44 jberger ?
15:44 jberger search :-P
15:45 jberger I know that's probably not what you mean, no there is no introspection of templates or controllers in that way
15:46 jabberwok thanks haarg, jberger
15:47 haarg File::Spec->rel2abs($path, $self->app->home)
15:48 mat yeah, it's what I am getting too, I could do awful dark magic to see if I'm in the process of something being rendered, but it feels like a bad idea, I'll just use two helpers :-)
15:51 sri there's also ->realpath
15:51 sri if you want it resolved on the file system
15:57 jabberwok oooo realpath is quite nice indeed
15:58 sh14 joined #mojo
16:07 PryMar56 joined #mojo
16:15 CHYC_ joined #mojo
16:17 kes joined #mojo
16:26 rshadow joined #mojo
16:40 kaare joined #mojo
17:27 dod joined #mojo
17:31 kes Hi. I want to pass content of Mojo::Asset::Memory while POST file, but it seems this feature not implemented, because I get:
17:31 kes content => "Mojo::Asset::Memory=HASH(0x8054c88)" instead of real content
17:31 kes is there a way to pass Mojo::Asset::Memory as content?
17:32 kes I want to skip step to write content into temporary file
17:42 itaipu joined #mojo
18:05 rshadow joined #mojo
18:06 jberger kes: if you already have the data in memory, why do you need to wrap it in a Mojo::Asset?
18:08 kes So I should do: content => $asset->slurp
18:08 kes ?
18:08 kes ***Should I do:
18:09 haarg kes: how was the asset created?
18:09 kes somewhere in code. I got asset as argument
18:12 kes Here ->slurp may produce very big chunk of data, I just try to postpone that. And suppose it will be send directly to net from buffer
18:13 kes I was wrong at first post. It also may be Mojo::Asset::File
18:14 kes only at that case it were ::Memory
18:15 jberger and reply->asset isn't working? http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Custom-responses
18:15 jberger what is "content => "?
18:18 kes jberger: http://paste.scsys.co.uk/557501
18:18 kes this is request, not response
18:19 haarg the docs show using an asset as a file, not as content
18:21 disputin joined #mojo
18:21 jberger a few lines up, there is an example of a content generator http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Content-generators
18:21 jberger it shows how you use an asset in the request
18:22 jberger my $tx = $ua->build_tx(...); $tx->req->content->asset($asset); $ua->start($tx);
18:22 jberger should work I'd think
18:22 kes that is I was looking for. Thank you
18:23 jberger cool
18:23 jberger np
18:23 kes $c->render( json => ... ). Does json is content generator?
18:23 jberger I had to look for that one, its been a while since I've uploaded anything :-P
18:23 jberger yes
18:23 jberger errr no
18:23 jberger $c->render is in a server context
18:24 jberger $ua->post(..., json => ...) is a content generator
18:24 jberger the render stuff serves a similar purpose but is implemented differently
18:25 kes it seems will be useful if content generator will we able to use at this place: $c->render( content_generator => ... )
18:25 kes but never mind. Thank you for the link
18:26 jberger kes: as I said, its different in a server context, you are necessarily going to have to implement different behaviors (think headers etc)
18:26 jberger http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Adding-a-handler-to-generate-binary-data
18:27 rshadow joined #mojo
18:29 kes cool +1
18:44 dod joined #mojo
18:50 dantti_laptop joined #mojo
20:00 kes err
20:02 kes may you please clarify DOC?
20:02 kes http://paste.scsys.co.uk/paste
20:02 kes The request is: /users/me/avatar
20:08 kes ops, sorry. Right link:
20:08 kes http://paste.scsys.co.uk/557504
20:12 kes I got this unexpected behavior: http://paste.scsys.co.uk/557505
20:13 kes now I will left channel but please respond I will read LOG later
20:13 kes thank you
20:37 itaipu joined #mojo
20:41 miller joined #mojo
20:43 spicyjack something tells me (s)he's not going to read his/her log later after all
20:44 dod joined #mojo
20:50 irqq joined #mojo
21:15 bananajoe joined #mojo
21:16 pink_mist spicyjack: he/she knows the channel is publically logged (see topic)
21:16 bananajoe Hello guys, how can I set with morbo the reload time of modificated files?
21:16 pink_mist you can't afaik
21:16 bananajoe A fast, talented, and genious coder like me can write significant more code than average developers, thus more and faster reloads are required.
21:17 spicyjack ahh
21:17 spicyjack pink_mist: or, ahh, rather
21:18 pink_mist bananajoe: you don't need faster reload than 1 second
21:18 bananajoe On windows for example the reload is, if we are in of luck around 30-60 seconds.
21:19 bananajoe You can write a decent amount of code in this time which you would like to try, but if no reload was done you'll have to restart the app
21:20 bananajoe While on unix the reload with morbo is much faster
21:21 pink_mist https://metacpan.org/source/Mojo::Server::Morbo#L68 <-- it checks every second.
21:21 bananajoe It doesn't on windows
21:21 pink_mist if it takes longer for you then maybe it's a filesystem issue - perhaps the timestamps in the filesystem isn't accurate enough
21:22 pink_mist bananajoe: there's no code in morbo to make it differen on windows. it checks every second.
21:24 bananajoe in unix i can confirm it might be a second, but on windows it roughly 30 seconds
21:24 pink_mist and there is no code in morbo to cause that.
21:24 jberger it is known that morbo on windows is slow
21:25 bananajoe I understand this, but why'd this delay happen
21:25 jberger I think its a "because windows doesn't like it when you poke it like that" problem
21:25 Grinnz unfortunately checking more often won't speed up the check on windows
21:26 Grinnz perhaps an evaluation of why windows is your workstation OS is in order?
21:28 bananajoe maybe i should buy a new computer ??
21:28 Grinnz linux will generally run on any computer windows will
21:33 jberger even from a VM
21:33 jberger or WSL
21:37 bananajoe thanks for your help, i guess my os is faulty then or the perl installation
21:37 bananajoe cpan modules do also install extremely slow
21:39 Grinnz slow filesystem I/O can cause a lot of issues. this seems to be a general problem with windows
21:39 Grinnz could also be your disk, or something
21:39 Grinnz but i've definitely heard of cpan installs taking much longer there
21:40 pink_mist I heard some reports that running tests under cpanm was much much slower than running tests under regular cpan
21:40 pink_mist on windows
21:41 pink_mist are you using cpanm perhaps? if so, try cpan?
21:41 bananajoe i'm using cpan, but my filesystem is indeed slow
21:41 bananajoe and sometimes my computer shuts down bcoz of overheating, then i have to wait 10 minutes until it allows me to turn it on again.
21:41 nic using strawberry perl on windows+ssd I still get long wait times
21:42 haarg creating processes is much more expensive on windows.  file also generally seems slower, although i'm not sure how much of that is windows and how much is win32 perl.
21:45 kgoess is there a post-startup hook? so I could e.g.
21:45 kgoess tie *STDERR, 'cl::Tie::Log4perl', logger => $self->log;
21:46 kgoess *after* all the ports are bound and the code is loaded?
22:04 jberger kgoess: just do it at the end of your startup method
22:05 jberger oh, I see what you mean, because of hypnotoad
22:05 jberger you can do it in a Mojo::IOLoop->next_tick(sub{ ... }); perhaps
22:06 kgoess interesting idea, will ponder, thanks!
22:08 preaction why are you doing this instead of other possibilities though?
22:13 Grinnz yes, next_tick is the "correctest" way to run something as soon as the daemon starts, which will occur in each forked process
22:13 pink_mist preaction: what are the other possibilites? =)
22:13 Grinnz https://metacpan.org/source/DBOOK/Mojolicious-Plugin-SetUserGroup-0.005/lib/Mojolicious/Plugin/SetUserGroup.pm#L31
22:14 preaction getting Log::Log4perl hooked up through Mojo::Log? i'm not even sure what that code's supposed to do
22:16 howitdo joined #mojo
22:28 jberger is there any sane way to make sure that useragent relative requests are handled by a fixed external host?
22:28 jberger it seem that $ua->on(start => ...) happens too late to absolutize urls
22:29 jberger they have already been shunted off to the ua's built-in server
22:29 jberger I suppose I could just write a little function that wraps build_tx
22:29 jberger :s
22:29 jberger I don't love that
22:32 kgoess next_tick works like a charm, thanks!
23:08 lluad joined #mojo
23:13 jberger I think I'm being trolled: https://www.reddit.com/r/perl/comments/5z80r9/using_perl_and_mojolicious_on_google_app_engine/
23:16 Grinnz i can't even figure out what they're arguing tbh
23:33 veryrusty joined #mojo
23:36 stryx` joined #mojo
23:43 jberger the latest post deescalates things
23:43 jberger so all's well that ends well
23:52 Xyem- So, I believe this is interesting behaviour. I get broken "Location" headers from Mojolicious, but everything works correctly if I add a call to $app->log in "redirect_to".

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