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

IRC log for #mojo, 2015-10-30

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

All times shown according to UTC.

Time Nick Message
00:05 cpan_mojo Minion-3.0 by SRI https://metacpan.org/release/SRI/Minion-3.0
00:05 good_news_everyon joined #mojo
00:05 good_news_everyon [mojo] kraih tagged v6.27 at 121b517: http://git.io/vleoi
00:05 good_news_everyon left #mojo
00:07 good_news_everyon joined #mojo
00:07 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vleK8
00:07 good_news_everyon mojo/master ba8044a Sebastian Riedel: bump version
00:07 good_news_everyon left #mojo
00:09 bpmedley_ circ-user-Sar4c : https://bitbucket.org/snippets/bpmedley/j8ebK <-- How is something like this?
00:10 bpmedley_ sri++
00:15 jberger circ-user-Sar4c: http://pastie.org/10517138
00:15 jberger bpmedley_: I don't see how a recurring is useful here
00:15 bpmedley_ jberger : Doesn't the original script have a sleep 5?
00:16 bpmedley_ https://gist.github.com/anonymous/353770490825ebb132ff#file-websocket_client_mojo-pl-L57
00:16 jberger original script was tl;dr :-P
00:16 bpmedley_ Must rewrite all the things
00:16 jberger ok well that's silly
00:17 jberger no reason to hold open a websocket just to impose a 5 sec delay
00:17 jberger the overhead of an HTTP request is much less than 5 sec
00:17 diegok joined #mojo
00:19 Mikey joined #mojo
00:22 lb joined #mojo
00:24 mudler joined #mojo
00:29 jberger more delay-y http://pastie.org/10517152
00:35 circ-user-Sar4c Will check the examples out. Thanks jberger and bpmedley.
00:41 absolut_todd joined #mojo
01:07 Janos joined #mojo
01:13 jberger this might be the best so far: http://pastie.org/10517212
01:14 jberger has one inefficiency because I don't want to have to handle the first job differently
01:24 tempire #ohsnap https://twitter.com/bill_nottingham/status/659600988681216000
01:24 Zoffix joined #mojo
01:26 jberger :o
01:27 Zoffix :o
01:28 Zoffix It's funny to see so much hostility from the Python community....
01:29 Zoffix Perl folks be like "oh, you're learning a new language? You should also check out Python; lots of people find it easy".... Python folks are all "ZOMFG! SPREAD MISINFORMATION ABOUT PEARL!!!!"
01:29 jberger write python quickly and just watch as you accidentally assign a value to a method
01:29 jberger enjoy
01:29 * Zoffix can't stand Pythons "whitespace declares blocks" stuff.
01:29 jberger I've given up on being nice about python
01:29 jberger it claims to be pretty
01:29 Zoffix Never evaluated it much further than that, so I don't even have any dirt on it
01:30 jberger write a pretty two-level list comprehension, I dare you
01:30 jberger in fact, just try to remember where/how to use the second "in"
01:34 preaction once you get past the "whitespace-delimited blocks" thing, you see that the rest of it has got some pretty terrible ideas too :p
01:34 Zoffix :P
01:35 jberger http://pastie.org/10517229
01:36 jberger yes, that's the order you need to put the list comprehension keywords
01:37 jberger and yes I realize that's an example that doesn't map well to perl, but it doesn't matter, that's ugly and they claim pretty
01:37 preaction my brain it pains
01:38 preaction print grep { $_ == int $_ } map { @$_ } @mylist;
01:38 preaction or looks_like_number perhaps?
01:39 jberger I was thinking looks_like_number
01:39 jberger but yeah
01:40 preaction one could also posit that's a strawman argument, and make a bunch of similar arguments against perl. indeed they're the same damn thing with different community philosophies
01:40 preaction sorry about the language
01:50 zivester joined #mojo
02:11 mattastrophe joined #mojo
02:27 cheesekun joined #mojo
02:29 jberger language is allowed again, when not directed at someone
02:29 jberger within reasonable limits
02:30 dvinciguerra joined #mojo
02:33 mattastrophe joined #mojo
02:46 aborazmeh joined #mojo
02:59 lsm joined #mojo
03:06 mattastrophe1 joined #mojo
03:08 kaare_ joined #mojo
03:47 * sri decides to dictate that this is going to happen https://github.com/kraih/minion/commit/8e2f520d5bd5b8e4e8647e63d0fce2b777ca1332
03:56 inokenty-w joined #mojo
04:15 cpan_mojo Minion-3.01 by SRI https://metacpan.org/release/SRI/Minion-3.01
04:15 sri http://www.drodd.com/images13/deal-with-it-gif26.gif
04:24 good_news_everyon joined #mojo
04:24 good_news_everyon [mojo] kraih pushed 2 new commits to master: http://git.io/vlvhb
04:24 good_news_everyon mojo/master a915440 jamadam: fixed multi-line attribute behavior
04:24 good_news_everyon mojo/master 2ebe067 Sebastian Riedel: Merge pull request #865 from jamadam/dom-attr-multi-line...
04:24 good_news_everyon left #mojo
04:25 irqq joined #mojo
04:28 good_news_everyon joined #mojo
04:28 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vlfeJ
04:28 good_news_everyon mojo/master db359fc Sebastian Riedel: fix a few typos
04:28 good_news_everyon left #mojo
04:40 cpan_mojo WWW-Crawler-Mojo-0.14 by JAMADAM https://metacpan.org/release/JAMADAM/WWW-Crawler-Mojo-0.14
05:58 madalynn joined #mojo
05:59 madalynn Re
06:00 mattastrophe joined #mojo
06:03 mattastrophe1 joined #mojo
06:08 theo joined #mojo
07:30 Vandal joined #mojo
07:42 kes joined #mojo
07:44 kes Hi. can not start application with relative path: hypnotoad path/to/app.pl, The log says that application is started, but there is no process with logged PID
07:45 kes How to check what is coming wrong?
07:56 Snelius pstree
08:09 berov joined #mojo
08:11 kes there are no any processed related to hypnotoad and myapp.pl
08:12 eseyman joined #mojo
08:23 Snelius then your process is not running
08:38 meshl joined #mojo
08:56 trone joined #mojo
09:08 irqq joined #mojo
09:34 nic kes: Did you look in your log dir?
09:45 dvinciguerra joined #mojo
10:27 AndrewIsh joined #mojo
10:52 Samysam joined #mojo
10:53 crab argh, why is hypnotoad ./myapp not picking up the {hypnotoad=>{listen=>["http://127.0.0.1:3903"]}} i put in my ./hypnotoad.conf?
10:54 crab i must be doing something stupid, but of course it has to be when i have to get $thing working quickly
10:58 nic crab: what does "myapp eval 'say Mojo::Util::dumper app->config->{hypnotoad}'" say?
10:59 nic I mean, does it include the 'listen' entry?
11:00 nic Attack B: to check if the port is available, can you (as the same user) kick off morbo to listen on that port?
11:01 nic (or deamon ofc)
11:03 punter joined #mojo
11:05 crab no, i was just being stupid. i have to app->plugin(config => {file => thingy})
11:05 nic cool
11:18 trone the headers allow method (http://mojolicio.us/perldoc/Mojo/Headers#allow) is useful with preflight request for CORS or I need to write the header Access-Control-Allow-Methods by hand?
11:19 trone I have a client doing a PUT request and the browser make a preflight OPTIONS call (that my server doesn't manage at the moment).
11:55 jberger trone: there is a very basic CORS plugin on cpan
11:56 trone jberger: atm I solved creating an OPTIONS route that return 200 and the list of allowed method with the specific header.
11:56 jberger Yeah, it's not hard
11:56 trone However I'll check the plugin to see another implementation. :)
11:56 trone (thx)
11:56 jberger That's all the plugin does iirc
11:58 jberger Oh, it does it in a hook
11:58 jberger So you'd still have to setup an empty OPTIONS handler
11:58 jberger meh
11:58 neilhwatson joined #mojo
12:09 * Lee just sets the headers in the ->under cb
12:15 jontaylor joined #mojo
12:25 ajr_ joined #mojo
12:44 asarch joined #mojo
12:50 dvinciguerra joined #mojo
12:58 meshl joined #mojo
13:07 dvinciguerra joined #mojo
13:10 hernan605 joined #mojo
13:14 jberger hard for a plugin to do that
13:19 Lee yes
13:31 meshl joined #mojo
13:44 kes crab: no, you are not stupid. I have same problem yesterday. The DOC says nothing about that ;-)
13:46 ZoffixW joined #mojo
13:46 gryphon joined #mojo
13:46 ZoffixW kes, it's documented in the ::Config plugin: https://metacpan.org/pod/Mojolicious::Plugin::Config#file
13:48 hernan605 joined #mojo
13:48 kes I do not know that it were documented there when I read documentation for hypnotoad
13:52 ZoffixW kes, how did you come to the realization that Hypnotoad's config can be placed in the file? If I follow the trail of docs from Mojo::Server::Hypnotoad, I end at "... add hypnotoad section to your Mojolicious::Plugin::Config file..." at https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Cookbook.pod#Hypnotoad
13:54 Samysam joined #mojo
14:08 Samysam joined #mojo
14:09 jberger I love patches that are one character (plus multiple lines of tests) https://github.com/kraih/mojo/pull/865/files
14:10 Grinnz hehe
14:10 ZoffixW :)
14:10 ZoffixW I'm surprised it took that long to notice that bug. In my experience, pages common spread class="" on multiple lines
14:11 ZoffixW s/common\K/ly/;
14:11 Grinnz i've never seen pages do that tbh
14:12 ZoffixW Must be just me then :(
14:25 kes ZoffixW: it is too implicit
14:25 ZoffixW kes, what is "it" in that sentence?
14:26 ZoffixW kes, that you can use a file? Well, what should the file be named? What format does it use?
14:26 ZoffixW Where should it be placed?
14:26 ZoffixW How do you load it or does that happen automatically?
14:26 kes expect automatically
14:26 ZoffixW kes, why?
14:30 ZoffixW The answer to the above questions are in the docs for Mojolicious::Plugin::Config, which is referenced in the Cookbook, which in turn is referenced by the Hypnotoad module, even if you start your reading there. I feel it's a bit unfair to dive into this with a set assumtions (i.e. that the file should be loaded automatically) and then criticize the documentation for not explicitly stating your specific assumptions are incorrect at all
14:30 ZoffixW the possible places you might look. Wouldn't you agree?
14:30 kes if application has config files it is loaded automatically. I have never hack applications to force the to load config files. Just create .configuration files
14:30 kes apache, nginx, uwsgi... etc
14:31 ZoffixW kes, I wrote plenty of apps without configuration files.
14:31 kes Yes, that is speccial apps with harcoded confs
14:31 ZoffixW You're comparing a software development library to finished products. An unfair comparison.
14:31 ZoffixW No, nothing special. Those apps do not have confs.
14:32 kes Or just add a hypnotoad section to your Mojolicious::Plugin::Config or Mojolicious::Plugin::JSONConfig configuration file.
14:32 kes So people just add section and do not load 'Config' plugin to apply config
14:33 ZoffixW kes, from what I'm understanding, you're suggesting Mojolicious loads a plugin without loading a plugin. Is that correct?
14:34 Grinnz_ kes: what if you wanted to use JSONConfig and not Config, but it automatically loaded Config?
14:34 nic kes: It's possible the bit you're missing is that Mojolicious does not prescribe how you set your params
14:35 ZoffixW What if someone writes ::YAMLConfig? Should core Mojolicious check for that too and then decide whether to load Mojolicious::Plugin::YAMLConfig? And that leads to another problem: if my config is there, should core Mojolicious also do the guesswork to figure out what format it's in?
14:35 Grinnz_ kes: or what if you don't want it to load a config file for security reasons?
14:35 nic _you_ might expect it can only be done via a file, whereas _I_ may need it to come from a db
14:35 Samysam_ joined #mojo
14:36 ZoffixW kes, as you can see, there are many reasons to not load anything automatically. The documentation of each of the Config plugins clearly states how those plugins operate. Thus, I do not see any area where the current documentation needs to be improved in this regard. Would you agree with that last statement?
14:39 kes Why some default configuration is applied while 'Config' plugin is not loaded???
14:39 Grinnz_ because application configuration is not only provided by the Config plugins
14:39 Grinnz_ it is an attribute of the application
14:40 Grinnz_ you can set config yourself in startup
14:40 Grinnz_ https://metacpan.org/pod/Mojo#config
14:40 Grinnz_ all the Config and JSONConfig etc plugins do, is read a file and apply that to the config attribute of your application
14:41 kes that is implicit that configuration for application is applied to server
14:41 lluad joined #mojo
14:41 kes which run this application
14:41 good_news_everyon joined #mojo
14:41 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vlLWg
14:41 good_news_everyon mojo/master dcf6fde Sebastian Riedel: a few more multi-line attribute tests
14:41 good_news_everyon left #mojo
14:41 Grinnz_ sorry, don't know what you're trying to say
14:41 nic überapp: an app where 70 routes is less than 10% of the whole
14:42 kes $app->config( hypnotoad => { ... } );
14:42 ZoffixW kes, sure. And that's the case. Add 'hypnotoad' to config and hypnotoad will know what to do. I believe the topic of our discussion is automatic loading of configuration from an arbitrary file in an arbitrary format, which is not practical to do automatically.
14:42 jberger kes, we have been over this plenty yesterday
14:43 jberger I'm sorry that you feel that it is an application's duty to load a configuration file
14:43 jberger but this is just not the case
14:43 kes and other people ask same question today
14:43 ZoffixW kes, not at all. The question was why hypnotoad doesn't look for a file named "hypnotoad.conf" when launching.
14:44 jberger crab did not ask that question
14:44 jberger crab wasn't getting the correct file loaded when he was loading a configuration file
14:45 jberger that was because he wasn't using the default file name expected by the plugin and thus had to use the {file => $name} argument to the config plugin
14:45 jberger http://irclog.perlgeek.de/mojo/2015-10-30#i_11455973
14:45 jberger crab was USING the config plugin already
14:45 sri hahahaha, this is me! http://xkcd.com/1597/
14:45 ZoffixW kes, but even if we accept your argumentation for why automatic loading should happen. How do you resolve the practical considerations of figuring out what format the config file is in?
14:45 ZoffixW sri, yeah, it's me too :)
14:45 kes sorry, please do not waste your time for me for this question
14:46 jberger sri: I've had to learn quite a bit about it because at $work I'm the guy that cleans it up :-P
14:46 kes config file is in default format ;-)
14:46 ZoffixW kes, but what's "default format"?
14:46 nic hang on, argumentation?
14:46 kes perl hash
14:47 ZoffixW kes, but it's not perl hash. It's Perl code that is run and returns a hash.
14:47 kes I mean same
14:48 Grinnz_ sri: lol
14:48 ZoffixW kes, and I don't feel I'm wasting my time on this. I just wanted to clarify your position, because I see you seemed to be a bit bitter about yesterday's friction with GitHub issues...
14:48 Grinnz_ kes: JSONConfig files are in json format
14:48 Grinnz_ there are more config plugins on cpan
14:49 Grinnz_ and as i said before, some people might explicitly not want a config file to load
14:49 ZoffixW kes, but how will our mechanism know to load that "default format"?
14:49 jberger I expect I'm going to end up using dotan's https://metacpan.org/pod/Mojolicious::Plugin::ConfigHashMerge at $work eventually
14:49 kes When I try to load it explicitly - it does not work. Have you run my example at github issue?
14:50 ZoffixW kes, no, I haven't. And I've seen many Issues; which one specifically are you referring to?
14:50 Grinnz_ huh? you never said anything didn't work
14:50 Grinnz_ your github issue was about documentation
14:50 kes wait for a link
14:51 kes https://github.com/kraih/mojo/issues/864
14:51 kes shart link
14:51 kes https://github.com/kraih/mojo/issues/864#issuecomment-152289484
14:51 jberger kes you shouldn't be using the hypnotoad server module directly
14:51 Grinnz_ kes: what doesn't work in that example?
14:51 kes *sharp
14:51 jberger that's like ... way advanced stuff
14:52 jberger writing your own server stuff
14:52 kes $hypnotoad->configure('hi');
14:52 ZoffixW kes, I see an issue in that code. You're asking Hypnotoad to use Application's config and you have the config file, but you've not told your Application to load the configuration file.
14:52 kes the 'hi' section is not applied
14:52 jberger please learn to do things the easy way first
14:53 * jberger is out
14:53 kes plugin 'Config';         #<<<<< NOTICE !!!!!!!!!!!!!!!
14:53 ZoffixW kes, ah, I was looking at the first code. Let me try to run the second example.
14:53 Grinnz_ kes: the configure method is not meant to be called manually
14:54 Grinnz_ kes: configuration for hypnotoad should always be in a section "hypnotoad"
14:54 kes really?
14:54 kes http://mojolicio.us/perldoc/Mojo/Server/Hypnotoad#configure
14:54 kes DOC says nothing about that...
14:54 Grinnz_ the docs also do not say that you should call run and then configure anywhere
14:55 Grinnz_ why did you decide to do that?
14:55 Grinnz_ "run" starts the server, so doing anything afterward is pointless
14:55 kes I have two methods. ONe to run server, second  to configure it from given section
14:56 kes of application config file
14:56 Grinnz_ why?
14:56 jberger kes: you should not have a server instance in the first place
14:56 jberger this is how configure is called inside the run method: https://github.com/kraih/mojo/blob/master/lib/Mojo/Server/Hypnotoad.pm#L56
14:56 kes $hypnotoad->run('hello_world.pl');
14:56 kes $hypnotoad->configure('hi');
14:56 jberger does that look like something you should be reimplementing?
14:56 kes $hypnotoad->configure('hi');
14:56 kes $hypnotoad->run('hello_world.pl');
14:56 kes are same
14:57 Grinnz_ wrong
14:57 * jberger forgot that he already said "is out" and therefore goes back to being out
14:57 Grinnz_ why are you making an instance of hypnotoad?
14:57 Grinnz_ there is nothing in the docs that would suggest you to do that
14:59 kes to allow the nginx to redirect to
14:59 Grinnz_ kes: perhaps you should review https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Hypnotoad
14:59 kes I have saw that 100 times )
14:59 Grinnz_ that does not tell you to write a script with a hypnotoad instance
15:00 kes I want to write it
15:00 Grinnz_ why?
15:01 ZoffixW kes, I'm trying your example, but I have no indication that any apps even start. Are you sure it's working at all?
15:01 kes TIWIDJ or how it right...
15:01 kes there more ways to complete task
15:01 kes you say about that in the doc too
15:02 Grinnz_ kes: if you want to use modules in a way that the docs don't mention, you should read their entire source code first, and then take responsibility when it breaks
15:03 Grinnz_ web servers are complicated, you can't just call whatever you want and hope it works
15:03 kes make NOTE in the doc that: if application does not load configuration it is not possible to configure hypnotoad
15:03 Grinnz_ that's incorrect
15:03 Grinnz_ i configure hypnotoad in my startup routine
15:03 Grinnz_ not from a config file
15:03 jberger configuration is just a hash bucket available to the app as a whole
15:04 jberger how things make it into that bucket is entirely up to the application
15:04 kes the tutorial examples does not configure it
15:04 kes at all
15:04 jberger you MIGHT want to use the config plugin
15:04 Grinnz_ kes: that section i linked configures it
15:04 jberger but you might want to load it from a database
15:04 Grinnz_ app->config(hypnotoad => {listen => ['http://*:80']});
15:04 kes the tutorial examples does not mention about that
15:05 Grinnz_ the tutorial does not mention hypnotoad at all
15:05 ZoffixW kes, I've ran your example and it works fine. The configuration loads from the "hi" section. What seems to be the issue?
15:06 kes please do: ps ax|grep hello
15:06 kes and copy here
15:06 kes and
15:06 kes netstat -na | grep 8080
15:07 kes where is hypnotoad.pid is appeared?
15:08 Grinnz_ https://metacpan.org/pod/Mojo::Server::Hypnotoad#pid_file
15:08 kes *after running app
15:09 Grinnz_ ?
15:10 ZoffixW kes, oh, sorry, nevermind. Seems the server got left over from when I used ->config( hypnotoad .. ) and when it told me "Starting hot deployment" I assumed I got a refreshed version.
15:11 ZoffixW kes, hm. Well, I see it's not starting anything.
15:11 * ZoffixW looks deeper
15:11 Grinnz_ the example is useless, there is no reason to do that
15:12 jberger ->configure is called inside ->run, unless you are going to reimplement ->run there is no reason to do it, as Grinnz_ says
15:13 ZoffixW jberger, then I guess the question circles back to the original: should the docs be improved?
15:14 jberger which docs?
15:14 Grinnz_ where?
15:14 ZoffixW https://metacpan.org/pod/Mojo::Server::Hypnotoad#configure
15:14 sri the configure method is only public for tests
15:14 jberger Mojo::Server::Hypnotoad is module reference documentation
15:14 jberger as are all module level documentation
15:14 Grinnz_ there are no examples which tell you to use that configure method, or how
15:15 Grinnz_ so placing it randomly in a hypnotoad script is not expected to work
15:15 ZoffixW Sure, but I can see where kes's confusion comes in. If we look at SYNOPSIS https://metacpan.org/pod/Mojo::Server::Hypnotoad#SYNOPSIS and then notice the public configure method, there is some assumption it should work.
15:15 Grinnz_ the synopsis does not include the configure method
15:16 kes the synosys never include all methods
15:16 kes described in DOC
15:16 ZoffixW Grinnz_, I know that. But the documented public 'configure' method does not include information that it's essentially a private method.
15:16 jberger only if you are implementing a Hypnotoad-based server
15:16 jberger only if you are implementing a Hypnotoad-based server
15:16 jberger which no casual user should be doing
15:16 sri ZoffixW: what could it even say that would make kes not want to use it?
15:16 jberger (argh, sorry for double post)
15:17 kes I am not casual user. I try to dig, but doc miss some info (((
15:17 Grinnz_ if you're not a casual user, then you should read the source code instead of randomly using methods
15:17 sri you know, there are other "pseudo-private" methods that have a note like ", only used to implement HTTP servers.", but that's still what kes actually wants here
15:18 Grinnz_ that could work
15:18 kes THere are DOC exists for not to dig source code
15:18 zivester joined #mojo
15:18 Grinnz_ the docs didn't tell you to use that method
15:18 Grinnz_ you are doing undocumented things
15:18 kes if it is private make it _configure
15:18 kes and remove DOC
15:19 sri then we have bad encapsulation
15:19 sri it needs to be called from the outside for testing
15:19 jberger kes: http://irclog.perlgeek.de/mojo/2015-10-29#i_11452230
15:19 nic I enjoy reading the source, but I don't like the idea that all non-casual readers need to read the source of every method before using it
15:20 Grinnz_ nic: *if you are doing undocumented things*
15:20 jberger perhaps the problem is that the documentation of the attributes that hypnotoad accepts is in the server documentation, and thus users look there for it
15:20 kes I newbie to Mojo but I am not casual ;-)
15:21 Grinnz_ jberger: perhaps
15:21 sri jberger: this is the first time that every happened
15:21 jberger in the matter of reimplementing a preforking webserver, I would consider myself a casual user
15:21 sri s/y//
15:21 ZoffixW sri, on second thought, the doc is fine as is. I went into it with kes's assumption that the string given to ->configure() is the key from configuration, but the doc itself does not actually suggest it. So the doc itself is incomplete (which is perfectly fine for a pseudo-public method) and it's fine to read the source to see how it's used. And when that happens, you'll see the proper way to use the method.
15:21 jberger sri: yeah I know
15:22 sri argh, i really did not want to join this discussion again
15:22 ZoffixW :)
15:22 sri nothing burns me out quicker
15:22 * jberger ends the discussion
15:22 ZoffixW Let's talk about kittens! :)
15:22 ZoffixW Did you hear Uber was delivering kittens on NationalCatDay?
15:22 sri every time something like this happens i need a month long break from the project
15:22 Grinnz_ kitten encapsulation: http://terriblycute.com/files/2012/05/Kittens-in-Boxes-632x473.jpg
15:22 ZoffixW heh
15:23 sri emergency kittens \o/
15:23 jberger https://www.youtube.com/watch?v=eWM2joNb9NE
15:24 sri kes: honestly, i think the language barrier makes having this argument almost impossible
15:26 jberger I don't think that after a thorough reading of the Guides (which I'm sure kes has done) anyone would get the impression that making an instance of Mojo::Server::Hypnotoad on their own is a commonplace thing
15:27 sri and evidence supports that conclusion, this is the first time it happened
15:27 Grinnz_ i dont remember it being in any examples, I only did it by reading the bundled hypnotoad script which does not use configure at all
15:28 kes Lets me write DOC in understandable way (as I understand from my point of view) and you accept commit or not
15:28 sri kes will have to accept that we disagree, trust and that we will keep an eye on this in the future, so it can be addressed if others stumble over it again
15:28 sri s/trust and/and trust/
15:29 kes Maybe you reopen issue? O:-)
15:29 ZoffixW kes, it'd be closed. You have 3 members of the core team downvoting the change.
15:30 ZoffixW And I add my vote to that as well.
15:30 kes ok
15:30 ZoffixW If more people stumble on that issue in the future, we'll be sure to reexamine it.
15:30 kes keep an eye or I will take it ;-)
15:30 ZoffixW heh
15:32 nic Did the kittens save it?
15:32 kes Can I ask one more question? O:-)
15:33 Grinnz_ does it have to do with hypnotoad or configuration? :P
15:34 kes Mojo::Server::PSGI->new->build_app( 'MyApp' )->to_psgi_app seems has useless ->app; call in it
15:34 kes *to_psgi_app
15:35 Grinnz_ Mojo::Server::PSGI is automatically used when your app is used by plack
15:35 kes *I have escape from hypnotoad to uwsgi.
15:35 kes mount '/test' => builder {
15:35 kes my $server = Mojo::Server::PSGI->new;
15:35 kes $server->build_app( 'MyApp' );
15:35 kes # $server->to_psgi_app;
15:35 kes sub{ $server->run( @_ ) };
15:35 Grinnz_ please don't paste into the channel
15:35 jberger joined #mojo
15:36 genio ssshh.  don't talk about jberger anymore
15:36 kes I have not see where to code-past in header of channel
15:36 Grinnz_ anywhere except pastebin.com is fine
15:36 nic http://paste.scsys.co.uk/mojo
15:37 Grinnz_ kes: https://metacpan.org/source/SRI/Mojolicious-6.27/lib/Mojo/Server/PSGI.pm#L35
15:37 Grinnz_ to_psgi_app does mostly what you did there
15:37 Grinnz_ it's very simple
15:37 kes SO I can just mount '/test' => MyApp->new ?
15:38 Grinnz_ no
15:38 punter joined #mojo
15:39 Grinnz_ well maybe, i haven't used mojo apps in PSGI much
15:39 jberger genio: this whole conversation has been made more frustrating for me because my new home router seems to hate internal traffic
15:39 punter https://www.facebook.com/groups/perlprogrammers/permalink/1060147174018070/
15:39 punter Maybe a good idea for showing off Mojo development?
15:39 jberger or else perhaps it hates the server that is hosting my irc
15:39 Grinnz_ punter: requires login...
15:39 punter Grinnz_: it says "got a marketing idea to popularize Perl even more: people working on open source projects, make a streaming to Twitch while they code.
15:40 punter What do you think?"
15:40 Grinnz_ heh
15:40 Grinnz_ I think some people have done that, i think it depends on the person wehther it would be popular
15:40 ajr_ joined #mojo
15:46 good_news_everyon joined #mojo
15:46 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vltlW
15:46 good_news_everyon mojo/master 642ff15 Sebastian Riedel: no need to set the port so late
15:46 good_news_everyon left #mojo
15:47 FatalNIX joined #mojo
15:47 FatalNIX So this may seem sorry of whack
15:48 shadowpaste "kes" at 217.168.150.38 pasted "useless code" (13 lines) at http://paste.scsys.co.uk/500650
15:48 FatalNIX But how many people do you think use mojo for non web related things? If your idea supports mvc and you wanted web integration for your non web related project it almost makes sense
15:49 Grinnz_ kes: just return ->to_psgi_app, instead of reimplementing it (and not initializing the application)
15:49 FatalNIX Rather than building your own entire bottom of the pyramid for your larger project, just sit your project in mojo
15:49 kes where I must point class to use my MyApp?
15:50 Grinnz_ FatalNIX: depends, is Mojo::IRC web related? :P
15:50 FatalNIX I have no idea!
15:50 sri there is some non-web stuff in there https://metacpan.org/requires/distribution/Mojolicious?sort=[[2,1]]
15:51 nic The majority of my Mojolicious/Mojo projects don't serve any pages
15:51 jberger kes: ...
15:51 Grinnz_ usually Mojolicious is for serving web apps, and Mojo is just framework
15:52 sri FatalNIX: what's your definition of "non web related things"?
15:52 Grinnz_ Mojo::IOLoop for example can be used for any I/O loop purpose
15:52 FatalNIX Sri I sort of wonder that
15:52 jberger if you write an app, just a normal old app, called myapp.pl, and you run plackup myapp.pl, it just works
15:52 nic I have a fairly large ETL implementation written on Mojo, where the web app is almost incidental
15:53 jberger FatalNIX: I have plugins on CPAN that are barely web
15:53 jberger for some definition
15:53 jberger certainly not for "hosting a website"
15:53 kes jberger: no, I mount Mojo application into existing PSGI
15:54 kes and follow this doc: http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Plack-middleware
15:55 jberger ok well I really am going to stay out of this one since I never use psgi in that way
15:55 kes But I do not want to run myapp.pl I have no it. Just pass execution to MyApp::startup
15:56 FatalNIX Well I'm not doing anything.. But sometimes i use mojo for building some web apps, and everyone I do is for me thinking, why didn't I write my mouse mud codebase using mojo instead if they are both mvc and the way I'm using them isn't much different.
15:56 FatalNIX It's just a whacky thing that comes across my mind sometimes
15:56 FatalNIX Moose*
15:56 sri Moose is a tool, if you need its features you use it
15:57 Grinnz_ Moose isn't MVC o_0
15:57 sri yea, the mvc reference is odd
15:57 FatalNIX No but my mud lib is
15:57 Grinnz_ ah
15:58 FatalNIX Controllers are routers bound to channels that demultiplex to entities
15:58 FatalNIX Yada yada
15:58 FatalNIX Models do all the cool work
15:59 sri oh, are we talking about non-web UIs?
16:00 FatalNIX Yeah but one of the features in the past I had was a web management application for the mud codebase..
16:00 FatalNIX And I was thinking if I can create ways to built routers in mojo it would make integration easy.. And mojo can do just about anything. It was a shower thought I had a couple months ago
16:01 FatalNIX Plus mojo has a better plugin system than I do
16:02 FatalNIX Not routers, r
16:02 kivilahtio_ joined #mojo
16:02 FatalNIX Gah y phone is a duck
16:03 FatalNIX ...
16:03 good_news_everyon joined #mojo
16:03 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vlton
16:03 good_news_everyon mojo/master 0d4934b Sebastian Riedel: link to signals
16:03 good_news_everyon left #mojo
16:08 * tempire grumbles
16:13 PryMar56 joined #mojo
16:27 kes catch new issue O:-)
16:30 ZoffixW joined #mojo
16:31 ZoffixW kes, it would be more helpful if you'd discuss these issues on IRC first, before creating GitHub Issues. As was stated above, you're burning out the devs, because much of what you submit on GitHub is simply incorrect usage of the code.
16:32 kes ok
16:32 Grinnz_ there is also the mailing list
16:32 ZoffixW kes, what is the actual problem in #866? Just the different Welcome text? I believe Mojo is a tool to build frameworks, of which Mojolicious is one. I'm assuming you're using Mojo in this case, hence the different welcome text.
16:32 kes I think it is better to create issues and then discuss it here
16:33 Grinnz_ kes: issues are for issues, not discussion or assistance.
16:33 ZoffixW kes, discussing here gives you a large number of users and developers at the disposal. On GitHub, you're alerting mostly core devs to possible issues in the software, where often there aren't any.
16:33 kes I create app from the class and it is not created
16:34 kes ok, I leave github
16:34 ZoffixW Thanks.
16:34 ZoffixW kes, do you have a full example that I could run and see what the problem is? (use a pastebin to show code)
16:34 kes I have already dig the problem
16:35 sh4 joined #mojo
16:35 kes the load_app init $self->app, but build_app has no
16:35 kes my $app =  $server->build_app( 'MyApp' );
16:35 kes $server->app( $app );
16:35 nic no pasting!
16:35 kes ops.. sorry
16:36 ZoffixW kes, are you saying you found the problem and that GitHub issue can be closed now? Is that correct?
16:36 kes the two methods has same job, but works differently
16:36 kes ZoffixW: no, I problem still lives at Mojo sources...
16:37 ZoffixW kes, and what is that problem?
16:37 kes the two methods has same job, but works differently
16:38 ZoffixW kes, which methods are those?
16:38 kes build_app/load_app
16:38 ZoffixW kes, what do you mean by "have same job"?
16:38 nic what makes you think they have the same job?
16:38 kes load_app - put loaded app into $server, but build_app - does not put builded app into $server
16:39 ZoffixW kes, because its job is to build the app? :)
16:39 kes nic: I mean the result must be same
16:39 nic kes: please stop imagining what the code should be doing and then complaining that the behaviour does not match your imaginings
16:39 kes the differences only at the source where they start
16:40 kes the both method have same descriptions
16:40 kes May I suppose that build_app will put result into $server as load_app do?
16:40 jberger kes: "Build application from class." vs "Load application from script."
16:40 nic no, stop supposing
16:41 jberger those are not the same thing
16:41 kes what is difference?
16:41 jberger My::Class vs /path/to/file?!
16:41 jberger they are different words because they are different things
16:42 jberger sorry, that was overly snarky
16:42 kes what are the results?
16:42 jberger but I'm out again
16:42 sri kes: ok, those issues are getting a little frustrating for me
16:42 ZoffixW kes, one loads the application class, the other loads the application *script*
16:42 nic kes: As sri said, these 'issues' are down to your understanding of English
16:42 sri kes: please do not open any more issues unless you've confirmed they are actual problems on irc or the mailing-list first
16:43 kes nic: you are right
16:44 kes ZoffiexW: you are right (not nic)
16:44 ZoffixW kes, Mojolicious has existed for a long time with thousands of eyes pouring over the source code and documentation. It's unlikely you'll just stumble upon such glaring issues as two methods that supposed to give the same result actually fail to do so. I would suggest you reframe how you view this project and don't assume it's broken each time something doesn't match your expectations.
16:44 kes and both return the loaded app? yes?
16:44 ZoffixW kes, no
16:45 kes what they return?
16:46 jberger hmmm, it might be a little asymmettric that load_app sets the app attribute and build_app doesn't?
16:46 nic lol
16:46 ZoffixW kes, the app.
16:46 nic who's got kittens?
16:46 ZoffixW kes, but not necessarily "loaded"
16:46 shadowpaste "kes" at 217.168.150.38 pasted "return result are same" (2 lines) at http://paste.scsys.co.uk/500652
16:47 kes jberger: YES!!!
16:47 kes =)
16:47 jberger yes it is expected that the return values of those two calls are the same, however the side effect of setting app seems to be different
16:48 kes and this is a bug, I think
16:48 kes at lease the side effect is not described at DOC
16:48 kes *at least
16:51 crab wow
16:51 crab i have Mojolicious 1.17 installed on one of my servers
16:51 nic :)
16:52 ZoffixW lol :D
16:53 kes Are you agree that side effect must be described?
16:53 sri kes: i'm afraid i have to remove your github issue privileges, since you're not listening to me
16:54 sri this time it will be temporary for a week
16:55 kes sri: the issues were closed. I do not open new one, and will not. Just send message with clue how to resolve problem
16:55 kes soryy, need to go. You can mail me: kes-kes@yandex.ru
16:56 sri github issues are not a paste site
16:56 sri you're actually sending notifications to the entire team
16:57 nic he's gone
16:57 sri :S
16:58 sri was about to say that a note in the docs would actually be reasonable here
17:01 ajr_ joined #mojo
17:02 sri build_app is odd in many ways
17:10 Kogurr joined #mojo
17:11 * jberger wishes there was a way to keep new users out of the Mojo::Server::* docs :-P
17:15 good_news_everyon joined #mojo
17:15 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vlqwW
17:15 good_news_everyon mojo/master ec5f089 Sebastian Riedel: improve build_app method in Mojo::Server to work more like the load_app method
17:15 good_news_everyon left #mojo
17:22 sri jberger: the worst of all is that i think all he really wanted was the mount plugin and a wrapper app loading the config plugin
17:23 sri (after seeing how he's totally fine with mounting stuff in psgi)
17:24 irqq joined #mojo
17:28 cpan_mojo Minion-3.02 by SRI https://metacpan.org/release/SRI/Minion-3.02
17:28 sri although, that is in the cookbook too http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Application-embedding
17:31 good_news_everyon joined #mojo
17:31 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vlqDq
17:31 good_news_everyon mojo/master ce570fa Sebastian Riedel: show a shared configuration too
17:31 good_news_everyon left #mojo
17:31 sri just in case
18:12 asarch joined #mojo
18:23 jberger sri++ # good changes
18:47 jontaylor joined #mojo
18:59 sri is this issue dead? https://github.com/kraih/mojo/issues/859
19:06 Grinnz_ i would prefer it stringified instead of converting to float, but i don't know how to properly detect if that will happen
19:07 Grinnz_ i'm not sure what bug he's talking about though, seems unrelated
19:08 sri so, no matter what we do, it would never roundtrip correclty, right?
19:09 Grinnz_ correct
19:09 Grinnz_ perl cannot represent integers that large
19:09 sri ok, then it's a bit meh
19:09 Grinnz_ without bignum anyway, but that can be very slow
19:10 sri if there's a solution that roundtrips then it would be clearly better, but like this... i think the simples solution wins
19:10 Grinnz_ i don't mind either way, i would consider it a source data problem that it's not a string
19:10 Grinnz_ i just prefer the stringify approach to be consistent with other parsers
19:23 disputin joined #mojo
19:39 jberger sri: is this a failed migration or something?
19:39 jberger # perl /rd/script/rd_mojo minion job  DBD::Pg::st execute failed: ERROR:  column "queue" of relation "minion_jobs" already exists at /usr/local/lib/perl5/site_perl/Mojo/Pg/Database.pm line 82, <DATA> line 260.
19:41 berov joined #mojo
19:43 sri jberger: maybe, it's odd
19:46 sri did your mojo_migrations table get lost?
19:47 sri it's really hard to mess up, you'd have to manually modify the mojo_migrations table
19:50 sri wait, are you maybe mixing versions?
19:51 sri yea, that would make sense
19:52 sri your older minion could accidentally downgrade the version
19:52 jberger :o
19:52 sri maybe
19:52 jberger (I don't trust any of our deployment process here btw)
19:52 jberger (working on it)
19:53 jberger yeah, I checked the database and clearly we have the column, so I just put the version back up to 4
19:53 jberger (which is where it would be given the current schema)
19:55 sri hmm, this might need to be a special case in Mojo::Pg::Migrations
19:55 sri if you don't have the "-- up" for the current version, no migrations should happen
19:56 sri but you'd still get in trouble if you run older versions against a new schema i guess
19:58 sri the minion migrations could have "-- down" sections for removing the columns, but then your minions would migrate up and down until you upgrade them all ;p
19:58 sri and crash in funny ways i imagine
19:59 sri anyway, lesson here is that you can't partially upgrade minions when the schema changes
19:59 sri so, i guess schema changes will be limited to major releases in the future
20:00 sri and maybe mentioned in Changes
20:07 jberger I wonder if there could be a behavior in ::Migrations (that could be requested, not maybe default)
20:07 jberger that would be something like migrate up or die if the version is higher already
20:07 sri i think it should die if the version is higher
20:08 Grinnz_ that would make sense IMO
20:08 sri the goal here is to make it as hard as possible to screw up
20:08 jberger right
20:08 sri already have a patch :)
20:08 jberger sri++
20:24 sri https://github.com/kraih/mojo-pg/commit/92bc312e725042b748950b9c61319d0256d0004a
20:24 sri that should do the trick
20:25 sri that way old minions will refuse to restart
20:26 * sri likes it
20:29 jberger nice
20:35 sri confirmed https://gist.github.com/anonymous/355f252955b35a60d4f5
20:36 sri if i run a 2.0 checkout against a 3.01 schema
20:37 jberger excellent
20:38 sri wait, what? https://github.com/kraih/mojo-pg/commit/92bc312e725042b748950b9c61319d0256d0004a#diff-6e14f0738d9420d65b33a14434de88d0L28
20:38 sri perltidy is having a bad day it seems
20:38 Grinnz_ lol
20:38 jberger when perltidy attacks
20:39 Grinnz_ *cue badly compressed dinosaur roar audio file*
21:14 sri lol http://arstechnica.co.uk/information-technology/2015/10/twitchs-latest-idiotic-adventure-installing-linux/
21:22 Zoffix Bah!
21:28 buu sri: Next we can have them start programming C programs
21:28 buu A whole new meaning to the term 'crowdsourced'
21:29 cpan_mojo Mojo-Pg-2.15 by SRI https://metacpan.org/release/SRI/Mojo-Pg-2.15
21:37 cpan_mojo Minion-Backend-SQLite-0.002 by DBOOK https://metacpan.org/release/DBOOK/Minion-Backend-SQLite-0.002
21:37 sri Grinnz++
21:43 sri synopsis is still weak though
21:48 Grinnz_ hmm
21:56 Grinnz_ https://github.com/Grinnz/Minion-Backend-SQLite#synopsis
21:57 Grinnz_ usage synopsis should probably be left to Minion
21:57 mattp_ joined #mojo
21:57 sri i liked what bpmedley did https://metacpan.org/pod/Minion::Backend::mysql#SYNOPSIS
21:59 sri your new one does make sense too though
22:10 mattp_ joined #mojo
23:05 ajr_ joined #mojo
23:07 asm35 joined #mojo
23:15 nicomen Does anyone know if there exists anything that converts between a HTTP::Message and a Mojo::Message?
23:20 meshl joined #mojo
23:30 jberger perl -e 'fork while fork' ought to help them out
23:56 Grinnz nicomen, Mojo::Message::Request->new->parse($message->content) ?

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