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

IRC log for #mojo, 2015-03-02

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

All times shown according to UTC.

Time Nick Message
00:01 sri dammit... and now it happened again
00:01 sri there is some race condition
00:04 Averna joined #mojo
00:06 sri and i know for certain that it was that update
00:06 sri https://gist.github.com/anonymous/4ed972b7063791a8d5ab
00:06 sri started times are identical
00:07 asarch joined #mojo
00:25 sri well, according to #postgresql minion has design problems... but no hint yet what to look at
00:26 sri liking postgresql more and more every day!
00:36 d4rkie joined #mojo
00:42 Grinnz sri, sounds like an irc channel :)
00:47 sri but more and more suggests an optimization bug in postgres
02:33 kaare joined #mojo
02:35 klapperl_ joined #mojo
02:37 jberger hmmmmm, is it bad if rather than requesting that Test::Mojo::More and Test::Mojo::Session convert to Test::Mojo::WithRoles, that I just kinda want to reimplement as Test::Mojo::Role::Cookie?
02:37 jberger they'd probably have to change dist name anyway
02:38 jberger plus I could extract the cookies and sessions etc in a more idiomatic way
03:03 cpan_mojo Crypt-MagicSignatures-Envelope 0.08 by Nils Diewald - http://metacpan.org/release/AKRON/Crypt-MagicSignatures-Envelope-0.08 (depends on Mojolicious)
03:14 asarch How many $r->get can Mojolicious actually handle?
03:14 asarch As much as the server memory?
03:16 inbioz joined #mojo
03:16 buu asarch: 532 billion.
03:17 buu Precisely.
03:17 asarch Wow!
03:17 asarch That's great! :-)
03:17 buu You only need 531 billion?
03:17 asarch 5.32x10^14
03:17 asarch I was worried about Mojolicious limits
03:18 buu If you find any let us know
03:18 asarch As Bjarne Stroustrup used to say, it's always better to know the limit
03:18 mst asarch: ok, so, you've worked with a bunch of my code befoire
03:18 mst asarch: Mojo is sri's. I've spent years working with sri
03:19 mst asarch: it is safe to assume that unless the OS is a limit, the perl code won't be
03:19 mst asarch: I don't always agree with sri but he's fucking good
03:19 mst try and avoid imagining extra problems that don't exist - programming is hard enough when you only have to deal with the real ones.
03:19 asarch And let me you tell guys, you have done such a great job. Thank you very much to all of you
03:20 asarch And, actually, I just was only quoting C++ Programming Language creator :-(
03:20 * asarch hides
03:21 mst asarch: sure, but assume Mojo's limits are UNIX's limits and work accordingly
03:21 mst asarch: sri wouldn't arbitrarily limit you any more than I would
03:22 asarch That's great :-)
03:22 asarch Another question, is there any way to wrap the content of $self->reply->static($archivo); ?
03:26 Grinnz you might need to do something more manual like: https://metacpan.org/pod/Mojolicious::Guides::Rendering#Custom-responses
03:27 asarch Thank you
03:27 asarch Thank you very much :-)
03:29 hshong joined #mojo
03:29 kaare joined #mojo
03:34 noganex_ joined #mojo
03:55 inbioz joined #mojo
04:04 cpan_mojo Mojolicious-Plugin-Web-Auth 0.12 by HAYAJO - http://metacpan.org/release/HAYAJO/Mojolicious-Plugin-Web-Auth-0.12
04:07 inbioz joined #mojo
04:13 irq joined #mojo
04:19 inokenty-w joined #mojo
04:57 cpan_mojo Test-Mojo-Session 1.04 by Andrey Khozov - http://metacpan.org/release/AVKHOZOV/Test-Mojo-Session-1.04
05:21 jberger sri: still up?
05:21 purl the sun!
05:22 * jberger throws a blanket over purl
05:24 jberger I'm just curious if it was a design decision that $c->flash doesn't return the entire flash?
05:25 jberger if so, I'm then wondering if I can rely on the flash being stored in the key named "flash" so that I can test it as a data structure (JSON pointer)
05:25 jberger if not, could we add it?
05:42 marmez joined #mojo
06:05 cpan_mojo Statocles 0.040 by Doug Bell - http://metacpan.org/release/PREACTION/Statocles-0.040 (depends on Mojolicious)
06:06 jberger oh I get it, it's to prevent people assigning to it incorrectly
06:06 jberger is it safe to rely on the key name then?
06:06 berov joined #mojo
06:11 inbioz joined #mojo
06:18 punter joined #mojo
06:25 arpadszasz joined #mojo
06:37 inokenty-w joined #mojo
06:59 dod joined #mojo
07:04 dod joined #mojo
07:33 cpan_mojo Mojolicious-Plugin-OAuth2 1.5 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-OAuth2-1.5
07:37 cpan_mojo Mojo-Redis2 0.18 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojo-Redis2-0.18
07:39 batman marcus, sri: here is the documentation for "mocked": https://metacpan.org/pod/release/JHTHORSEN/Mojolicious-Plugin-OAuth2-1.5/lib/Mojolicious/Plugin/OAuth2.pm#Testing
07:39 marcus stop mocking me, batman. :'(
07:40 batman :D
07:40 batman i added EXPERIMENTAL marcus. your gut feeling might be right :)
07:40 marcus <3
07:40 batman i'm so happy about my ($delay, $err, $token) = @_;
07:40 batman feels good
07:41 davido_ joined #mojo
07:42 batman the links are broken... wonder how to fix that: https://metacpan.org/pod/release/JHTHORSEN/Mojolicious-Plugin-OAuth2-1.5/lib/Mojolicious/Plugin/OAuth2.pm#oauth.get_token
07:43 batman not even sure how to document nested helpers :/
07:44 inokenty-w joined #mojo
07:44 batman ah! typo.
07:44 marcus batman: what links are broken?
07:45 marcus the 'references' ones seem to work.
07:45 batman i had oauth.get_token instead of oauth2.get_token
07:45 batman i've pushed to commits to master for POD fixes. not sure if i bother to make a new release right now
07:47 batman *two
07:52 dp_ joined #mojo
07:54 McA joined #mojo
08:06 eseyman joined #mojo
08:09 ribasushi joined #mojo
08:19 Lee marcus: i'm planing to give a short talk on the oauth2 server plugin i wrote at YAPC::EU, will probably cover your plugin too
08:19 Vandal joined #mojo
08:19 marcus Lee: Great
08:28 trone joined #mojo
08:36 McA2 joined #mojo
08:48 absolut_todd joined #mojo
09:03 fhelmber_ joined #mojo
09:12 odc joined #mojo
09:28 jontaylor joined #mojo
09:30 amon joined #mojo
09:50 ladnaV joined #mojo
10:06 irq joined #mojo
10:09 Vandal joined #mojo
10:20 vytas joined #mojo
10:23 meshl joined #mojo
10:34 lb 5.82 on cpan would be super useful for metacpan diff-tool...
10:36 lb oh, metacpan doesn't list backpanned versions, but you can start diff from backpanned versions
10:37 lb (and then switch source/target in the url)
10:52 lushkava joined #mojo
10:58 marmez joined #mojo
11:11 edestler joined #mojo
11:16 marcus lb: maybe something for #metacpan ?
11:17 lb yes, i just amended my complaint with a solution ;)
11:20 marcus lb: pull request? :)
11:23 lb maybe
11:30 ZadYree joined #mojo
11:30 Anon021 joined #mojo
11:39 waghso joined #mojo
11:41 lb what's the 6.0 way to do pre 6.0 $c->param() ?
11:41 csson joined #mojo
11:42 * lb might be looking at buggy code
11:42 marcus lb: http://mojolicio.us/perldoc/Mojolicious/Controller#every_param ?
11:46 lb no, more like a names() like in Mojo::Parameters etc
11:47 lb seems like the functionality just died?
11:48 * marcus is confuzzled
11:49 lb https://metacpan.org/pod/release/SRI/Mojolicious-5.82/lib/Mojolicious/Controller.pm#param
11:49 lb my @names = $c->param;
11:50 marcus lb: Can't you use $c->req->params->names ?
11:51 lb does that know about req->uploads and captures?
11:53 marcus lb: I don't think so.
12:01 hernan604 joined #mojo
12:07 lb not sure if code is even used, hooray: die "This broke in 6.0"; foreach my $name ( $c->param ) {
12:11 sri nobody could come up with a goos use case for that :)
12:25 reneeb joined #mojo
12:27 AndrewIsh joined #mojo
12:35 AndrewIsh Hi guys. I've got what I'm sure is an extremely stupid question (my excuse is that I'm pretty new to Mojo) but I'm hoping you can help. I've got an application running (largely using the example app here http://mojoexample.herokuapp.com/) and it's working fine. I've set up my database access similar to the example in MojoFull.pm, I'm able to query the database in my API paths. What I now need to do is have a package containing a number of subroutines tha
12:35 AndrewIsh t will access the database, these will be called by parts of my API routes. So in, say, my API route 'foo#update', I might have a call to DBUtils::update (where DBUtils is the package I need to create). This is my question: How can I give DBUtils access to the $self->db I have in my Mojo controller? I did consider passing $self to DBUtils, but that felt wrong and I thought would cause problems for testing. I suspect I'm going about it all wrong, so would
12:35 AndrewIsh welcome some advice :) Thanks!
12:42 bobkare I'd either make the model package a proper class with db as a attribute or just pass $self->db to the functions if you don't want to make it object oriented
12:46 AndrewIsh Ah yes, I'd not considered your first suggestion, that sounds like it might be worth a try, thanks :)
12:54 wingfold joined #mojo
12:55 jberger AndrewIsh: I suggest a model package that you then provide helpers which wrap the functionality
12:56 jberger the helpers can connect the db object to the model attribute
13:00 AndrewIsh jberger: Sorry, I'm not 100% clear on what you mean, do you mean create helpers for the db related functionality? (Think I need to read about helpers... ;-))
13:02 jberger think of it as a small wrapper function which provides a clearer interface
13:03 jberger rather than having to make an instance and pass it the db, the helper can do that for you
13:04 ZadYree joined #mojo
13:05 AndrewIsh OK, makes sense, I'll take a look at doing that :)
13:06 AndrewIsh Thanks very much!
13:06 jabberwok where would best practices suggest that helpers be defined? all the examples show them in the main program, but that doesn't seem right at all.
13:07 AndrewIsh Indeed, that's what I was about to ask, the examples I'm reading show the same
13:12 jberger see plugins (also, a reminder to please read the guides)
13:19 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Adding-a-plugin-to-your-application
13:38 cpan_mojo MojoX-Renderer-HTC 0.03 by Renee Baecker - http://metacpan.org/release/RENEEB/MojoX-Renderer-HTC-0.03
13:39 sri so the guy who yesterday said minion has serious design problems in #postgresql just went away without elaborating :(
13:42 jabberwok thanks jberger and sri ... the only missing thing in Mojo is an O'Reilly book, or something to tie all the docs together, there are so many, it's all a bit daunting.  i guess that means i'll have to write it?
13:42 sri couldn't agree more, sadly we have not yet found an author for a book
13:42 mst sri: I can't even find you talking
13:43 irq_ joined #mojo
13:44 sri "<oicu> if the id isn't unique it will update more than one row. it looks horrid though. whenever you have to use limit like that you have a design problem, ISTM"
13:45 sri the guy works for postgresql experts... so i assume he has a point
13:45 sri just doesn't want to share it
13:47 sri the query in question https://github.com/kraih/minion/blob/master/lib/Minion/Backend/Pg.pm#L186-L195
13:49 mst sri: I think I must've been on the wrong side of a netsplit
13:49 sri you didn't miss much :)
13:50 jberger my initial thought on that is that in normal usage, limit 1 means that your query isn't specific enough, but in this case that's all you want
13:50 cpan_mojo Mojolicious-Plugin-FormFieldsFromJSON 0.29 by Renee Baecker - http://metacpan.org/release/RENEEB/Mojolicious-Plugin-FormFieldsFromJSON-0.29
13:50 punter joined #mojo
13:55 sri crab: perhaps you got something?
13:56 mst sri: the trouble is, he may just have meant "I don't like using the database as a queue"
13:56 mst because the vast majority of people who do that do it without understanding the trade-offs
13:57 * sri shrugs
13:57 sri on the other hand they are adding SKIP LOCKED
13:57 sri which is a feature very specific to this use case ;p
14:00 irq_ joined #mojo
14:01 bobkare Have you seen this? http://www.depesz.com/2013/08/30/pick-a-task-to-work-on/
14:06 jkramer joined #mojo
14:06 jkramer Ahoy!
14:11 jberger sri: so this is what I was working on last night, a first use of Test::Mojo::WithRoles while I can't get Phantom out yet
14:11 jberger http://pastie.org/9993661
14:12 jberger ideas stolen from Test::Mojo::More and Test::Mojo::Session
14:12 jberger and yes, it still needs the cookie tests from Test::Mojo::More and possibly others
14:12 jkramer I'm not sure if it's a bug or wanted behavior, but whenever on query parameter contains ß (probably true for other special characters as well), no routes match
14:12 jkramer *one
14:14 Adura How about %C3%9F?
14:15 jkramer https://dpaste.de/BN5U
14:15 jkramer That works
14:15 jkramer (%c3%9f)
14:15 Adura My browser automatically URI escapes that.
14:15 jkramer Yes, try curl. For some reason, it doesn't
14:16 jkramer wget also escapes, I only see this when testing with curl
14:16 jberger I know there are unicode route tests
14:16 jberger jkramer: do other unicode routes work?
14:16 jberger oh, query param, hmmmm
14:17 jkramer Yep, that's what confuses me. You don't even have to use that specific param with the ß in it, it being there is enough for not matching any routes
14:17 jberger what about the get command?
14:17 Adura What's your LANG set to?
14:17 jberger if that doesn't work, then I suspect your terminal
14:18 jkramer LANG=C \ LC_CTYPE=de_DE.UTF-8
14:18 jkramer jberger: What get command? From the mojo app itself?
14:18 jberger yeah
14:18 asarch joined #mojo
14:19 jkramer perl foo.pl get '/foo?q=straße' works
14:19 jberger then I suspect curl
14:19 Adura LANG=de_DE.UTF-8 curl ...
14:20 jkramer Adura: LANG=de_DE.UTF-8 curl 'http://localhost:3000/?q=straße' doesn't work either
14:20 Adura Unfortunate.
14:21 jkramer Also, I could understand if the param's encoding would be garbled or something, but I don't get why it doesn't even match the route
14:22 mattastrophe joined #mojo
14:23 jberger try running your server with MOJO_DAEMON_DEBUG=1 and see what request actually comes in
14:24 jberger jkramer: ^^
14:24 jkramer ok
14:25 jkramer GET /?q=straÃ\x9fe HTTP/1.1\x0d
14:25 jkramer XD
14:26 jkramer So, just the plain UTF8 character, not url-escaped
14:26 jberger I notice that your /foo is missing
14:26 jkramer Ha, true
14:26 jkramer No wait
14:26 jkramer I didn't use /foo in this test, one sec
14:27 lb most painful mojo upgrade yet
14:27 jkramer GET /foo?q=straÃ\x9fe HTTP/1.1\x0d
14:27 jkramer Complete output: http://dpaste.com/1J3S0Z8
14:27 jkramer Oh interesting, a few lines below that it says GET "/"
14:28 jberger yeah, I see that too
14:28 jberger lb: a lot of method renames, painful now, but they should make for a much clearer api
14:28 jberger thanks for sticking with it
14:30 lb i understand the why, still doesn't make it fun :)
14:30 jberger jkramer: I still suspect curl for the most part, and yet, I'm really not sure why mojo doesn't match it
14:30 jberger lb++
14:31 jkramer jberger: Well yeah it's obvious that curl doesn't url-escape the ß, but I don't think it shouldn't be such a big problem :)
14:31 jkramer *should
14:32 jkramer IMO, in the worst case the param's value could be garbled
14:34 jberger while I tend to agree with you, testing crossed up encodings is spectacularly hard
14:35 jberger jkramer: can you add to your script a before_dispatch hook which dumps the $c->tx->req->url object?
14:36 jkramer sure
14:37 jkramer bless({ base => bless({ host => "localhost", port => 3000, scheme => "http" }, "Mojo::URL"), }, "Mojo::URL")
14:37 jkramer Looks pretty empty :)
14:37 jkramer This is for /foo?q=straße
14:37 jberger yeah
14:38 jberger can you try to make an example where constructing a Mojo::URL object in this way yields the same result?
14:39 jberger this is what you are likely defeating somehow: https://github.com/kraih/mojo/blob/master/lib/Mojo/URL.pm#L78
14:40 tencendur joined #mojo
14:42 jberger jkramer: so you are clear, the Mojo::URL object you are seeing is actually empty, the base value is added elsewhere
14:46 jberger the other possibility is this one: https://github.com/kraih/mojo/blob/master/lib/Mojo/Message/Request.pm#L13-L17
14:46 sri bobkare: nope, but i did see something similar before https://github.com/chanks/que
14:48 sri minion is based on a state machine though, so we need to update the record, and i couldn't find a solution using advisory locks that got us any performance improvements
14:49 sri it's actually really hard to use advisory locks, since you can't just add them to where clauses
14:50 sri depending on how the query planner optimizes you may just end up putting advisory locks on all records in a table... which exceeds the memory quota...
14:50 jberger jkramer: can you post the same output as http://dpaste.com/1J3S0Z8 but for one that matches
14:52 jberger https://github.com/kraih/mojo/blob/master/lib/Mojo/Message/Request.pm#L60
14:52 sri lb: 6.0 should actually be one of the least painful major updates... unless you skipped *a lot* of 5.x releases
14:53 sri i still recommend updating in 2 month steps to get all the deprecation warnings
14:54 lb sri: that's simply not true with all those renames
14:54 lb (we kept up with 5.x)
14:54 sri pretty much all of them are for very rarely used methods
14:54 sri actually, now i'm interested in your use cases for many of them :)
14:54 punter joined #mojo
14:55 lb mostly weird stuff, obviously
14:55 sri you're using any of the renamed methods that are not in Mojo::DOM?
14:55 lb yes
14:55 sri which ones?
14:55 purl which ones are good and which ones need work?
14:55 jabberwok ok so reading about plugins, the Cookbook says if I'm writing an application-specific one, it would be at, e.g., lib/MyApp/Plugin/MyHelpers.pm ... but what if I'm writing a plugin that is used across several of my programs but is not on CPAN?  If I am writing a plugin that will be package Mojolicious::Plugin::MyPlugin; -- where would I put that under my program directory tree?
14:56 lb ->error() ->param() in various
14:56 jberger jabberwok: you are going to release the plugin to CPAN then?
14:56 jabberwok some of them i might; others would be in, let's say, a private corporate repository
14:56 sri ah ok, what did you use ->param() for?
14:57 sri we tried really hard to think of use cases and failed
14:57 jberger jabberwok: you can name it anything you want actually, its just a perl package
14:57 lb match() in Routes::Match, pattern->pattern,
14:57 lb mostly it
14:57 sri wow, those are pretty unusual
14:57 lb yes
14:57 sri i would have expected ->params->pairs
14:57 jberger pairs is quite new
14:57 sri exactly ;p
14:58 sri should have said ->params->params
14:58 sri but i hate saying that -.-
14:58 jabberwok very good, but where do best practices suggest that I put it, i.e., where will the Mojo package manager look for plugins?
14:58 sri lb: what are you using match and pattern for?
14:58 muraiki joined #mojo
14:59 jberger jabberwok: it will find fully qualified names as long as they are available in @INC
14:59 jberger it will find short names if they are in $app->plugins->namespaces
14:59 lb match is used for switching between danish/english urls
14:59 jberger *if their stem is in
14:59 jabberwok Ahhhh *bow*
15:00 jberger np
15:00 jberger its a pattern you will see several places
15:00 jberger commands too
15:00 lb we use pattern for listing active routes on a debug-page, not production code
15:00 jberger if you have lots of company-wide logic you might want to look at writing some business specific commands
15:00 sri lb: that sounds very unusual, can you share some of the code?
15:01 sri lb: for the match stuff
15:01 lb sure
15:03 lb sri: http://paste.scsys.co.uk/468494
15:03 lb so if you're on /user/sri, it'll redirect to /bruger/sri if you click /lang/da
15:04 lb endpoints usually have two urls associated with them, each with a da_/en_ prefixed name
15:05 sri aah, internal redirect basically
15:06 jberger couldn't url_for build an appropriate link given enough information?
15:06 lb oh yeah, url_for is hacked to test for the lang in session
15:06 sri wait a minute... that looks wrong
15:06 jkramer jberger: I don't think it's solely Mojo::URL. Tried constructing objects with different encodings etc, and it always keeps the data (path & params, although garbled sometimes)
15:06 sri what jberger said
15:07 lb hmm
15:07 lb 15:55 < lb> mostly weird stuff, obviously
15:07 jberger that way they would just have the right link in the first place rather than needing to be redirected
15:08 jberger lb: I'm just offering another possible solution
15:08 lb no, this is another problem
15:08 lb we do that in url_for already
15:08 jkramer jberger: Using exactly the bytes that curl sends ("\x2f\x66\x6f\x6f\x3f\x71\x3d\x74\x65\xc3\x9f\x74") works for Mojo::URL->new works fine
15:08 jberger jkramer: https://github.com/kraih/mojo/blob/master/lib/Mojo/Message/Request.pm#L13-L17
15:09 jberger and this too https://github.com/kraih/mojo/blob/master/lib/Mojo/Message/Request.pm#L60
15:10 xdg FWIF, Mojoconf 2015 posted and announced via NY.pm
15:10 xdg FWIW (can't type this AM)
15:10 lb jberger: this is for the page you're already on, new pages will have language-appropriate urls
15:11 jberger and the page you are on doesn't know what language to use when it is rendered?
15:11 lb it's for language switching
15:11 jberger hmmmmm
15:11 lb 16:03 < lb> so if you're on /user/sri, it'll redirect to /bruger/sri if you click /lang/da
15:12 jberger oh, I follow
15:12 lb it's a cheap trick, of course
15:12 lb test users seem to like it ;)
15:13 jberger hey, if its working and people like it and its using public api, then I guess there isn't much else to say :-)
15:14 lb (took some route-grokking to dig out the moving parts)
15:14 HtbaaPi I can't test right now, but if Apache 2.2.8 is in front of Hypnotoad will I still be able to use WebSocket?
15:15 jkramer jberger: The first one (bufref thing) matches, the second ($START_LINE_RE) not.
15:15 jkramer It's pretty obvious now that I look at it :) ...[0-9a-zA-Z...
15:15 Grinnz HtbaaPi, no.
15:15 Grinnz HtbaaPi, apache 2.2 cannot forward websocket connections
15:16 Grinnz HtbaaPi, you can do as we plan to do, and have the websocket connect to hypnotoad's port directly
15:16 lb (i wish there was an easier way to find the route for a given url)
15:16 HtbaaPi Grinnz: I feared as much :)
15:16 Grinnz HtbaaPi, note that unless both protocol (http/https) and domain are the same you'll run into difficulties
15:17 Grinnz port being different seems to be fine
15:17 HtbaaPi using another port would be an option I guess. But what about SSL? Can I still use encryption when using WebSocket?
15:17 jberger jkramer: so the question will be, do we want to make that regex more lax, I would say we have investigated enough for you to open a detailed bug and let sri decide whether its worth fix
15:17 jberger ing
15:17 Grinnz you would need to have hypnotoad listening on https
15:17 Grinnz using a ssl cert/key
15:18 Grinnz then you use wss:// for the websocket URL
15:18 Grinnz this is required if the page the websocket is on is served via https, it will not let you use a non-secure websocket on a https page
15:18 jkramer jberger: Ok, will create that report
15:18 sri jberger, jkramer: you'll have to make a good argument for why that should work
15:19 sri jberger, jkramer: and ensure that there are no security implications
15:19 HtbaaPi Grinnz: OK, thanks for the info. Wasn't even aware they both need to run on https in such a case
15:19 Grinnz HtbaaPi, neither was i until i tried it a week or so ago :P
15:19 HtbaaPi :-)
15:19 jberger even if we choose not to fix it, having an issue (even closed) to remind us might be useful
15:20 HtbaaPi Still not sure if I'll be using WebSocket though. Want to implement something that can keep track of opened documents.
15:20 sri HtbaaPi: nginx can forward websocket conenctions
15:21 HtbaaPi sri: I read that indeed, but the production environment is limited to Apache :(
15:21 Adura wget does it right.
15:21 Grinnz it's too bad having apache on port 443 means no other webserver is able to serve https pages on that server without proxy through apache
15:21 Adura Wonder why curl doesn't feel like uri escaping.
15:21 HtbaaPi I would switch in an instant if I could support .htaccess mod rewrite in nginx
15:22 Grinnz :curl:
15:23 Grinnz i would switch in an instant if there weren't 2 other projects running on apache :)
15:24 Grinnz projects which we rely on for certain functionality
15:24 HtbaaPi in my case the servers are also being used to provide hosting to customers who manage their own sites
15:25 HtbaaPi and so many websites use rule rewriting. Would be a time consuming process converting everything
15:25 sh4 joined #mojo
15:26 * lb was about to fix https://github.com/kraih/mojo/commit/ced1c5e14c6bd49afb6db8670e18f2f0f0062eea :)
15:27 HtbaaPi guess I'm gonna play a bit with WebSocket :-). Thanks for the info Grinnz
15:41 arthas joined #mojo
15:44 zackiv31 joined #mojo
15:45 PotatoGim^Home joined #mojo
16:04 AndrewIsh Hi guys. Hopefully a straightforward question. I'm creating a plugin (see jberger earlier suggestion). I've created the plugin package, it provides a helper that connects to a database. This works fine when I call it from my main app. I want to provide another helper that performs several sequential operations on the database, but I'd like the individual functions that actually do the operations to be detached from the plugin, so I can use them elsewhere
16:04 AndrewIsh . I thought of creating a child class. So, I currently have MyApp::MyPlugin::Database (this provides the connect helper and would provide the update helper & am intending creating MyApp::MyPlugin::Database::Material, which would contain a number of functions for performing different operations on the database. The parent class MyApp::MyPlugin::Database accesses the database via $app->db which is created by the main app calling the connect helper, but I'm
16:04 AndrewIsh unclear how the child class should get access to $app->db. In the child class, I have the Mojo::Base set to the directory of the parent class. Hmmm, now I write this down it all sounds a bit of a mess. Can you tell I'm not really sure what I'm doing? ;-)
16:05 jberger helpers are called with the controller as their invocant
16:05 jberger so then you can just use $c->app->db assuming your app object has the db attribute
16:06 jberger usually there is not reason to inherit from another plugin
16:07 jberger the plugin instance is rarely what you are using (I do have a few patterns where it is handy, but for the most part those are about configuration)
16:07 jberger the register method is typically used to add helpers (register them!) in the app
16:14 AndrewIsh jberger: thanks :) I've got further questions, got to pop out for a few minutes, brb
16:17 dotan Grinnz: put apache behind a proxy?
16:17 Grinnz_ dotan: hah! hahah!
16:18 Grinnz_ a reasonable suggestion, if i had any say in apache, perhaps :)
16:19 jabberwok OK I can do:  » $self->plugin('Plugins::ContentWrapper'); « which loads the code »package Plugins::ContentWrapper« from lib/ContentWrapper.pm ... but preceding that call with »  my $plugins = Mojolicious::Plugins->new;  push @{$plugins->namespaces}, 'Plugins'; « doesn't seem to permit  » $self->plugin('ContentWrapper'); « ... shouldn't the namespace prefix happen automatically?
16:21 Grinnz_ lib/ContentWrapper.pm would be found by loading "ContentWrapper" not "Plugins::ContentWrapper"
16:21 jabberwok i moved the file into lib/Plugins/ContentWrapper.pm
16:22 jabberwok $self->plugin('Plugins::ContentWrapper');   works ...   $self->plugin('ContentWrapper');   doesn't, even after pushing the "Plugins" namespace. that is what I'm not understanding.
16:23 Ptolemarch joined #mojo
16:23 jberger make sure that the package and the path align correctly (perl thing)
16:23 Grinnz_ uhm, you need to add it to the namespaces for the app's plugins object, not just a random plugins object
16:24 jberger oh right, what Grinnz_ said
16:24 Grinnz_ https://metacpan.org/pod/Mojolicious#plugins
16:24 jabberwok that's the $self from the main program's startup routine?
16:25 Grinnz_ right
16:25 jberger $app is the convention used to denote the invocant for your startup sub yes
16:26 jabberwok hmm, that document uses $self in the Synposis but then refers to $app in the Hooks description − confusing
16:26 Grinnz_ $app is how you'd refer to your application object outside of its own startup method
16:27 Grinnz_ same thing with $c vs $self for controller objects
16:27 jberger otherwise it can get kinda confusing
16:27 jberger of course you can do whatever, it is just the invocant
16:27 jberger but it saves a lot of headache
16:27 sri hahaha... we renamed it from $self actually to avoid confusion ;p
16:27 jabberwok AHA got it!  Thanks all.
16:28 jberger sri: https://metacpan.org/pod/Mojolicious#SYNOPSIS
16:28 jberger change those to $c?
16:28 purl jberger: that doesn't look right
16:28 jabberwok "too many moving parts" -- Why my dad's boss at McDonnell Douglas Helicopter said he would never go up in one of his own aircraft
16:28 jberger shut it purl!!
16:28 sri jberger: no
16:28 Grinnz_ the synopsis shows an actual app startu proutine and controller action
16:29 Grinnz_ so thats where you'd use $self
16:29 sri then the synopsis would be incorrect
16:29 jberger sorry, $app and $c
16:29 jabberwok *nod*  change the two $self in the Synopsis to $app for consistency would clarify.
16:30 sri if you change that one example... you have to change *all*
16:30 jberger I thought we had already done that for the most part
16:30 sri *never* for actual methods
16:30 Grinnz_ none of the other examples on the page are in a context of a startup routine or controller action
16:30 jberger oh well, I don't have time for grepping atm, I've already spent too much time here this morning ;-)
16:30 Grinnz_ therefore they don't use $self
16:31 jkramer left #mojo
16:31 jabberwok at least a bridge sentence to say "In the above example... but below we use..." -- otherwise n00b's brain throws an undefined symbol exception.
16:31 Grinnz_ perhaps just # $app
16:31 sri jabberwok: you're misunderstanding
16:31 Grinnz_ or something along that line
16:32 sri jabberwok: $self is a perl convention for referring to the invocant of a method
16:32 sri jabberwok: other examples don't use it because they are not methods
16:33 sri actions in lite apps for examples get $c as first argument because they are just callbacks
16:33 sri like $callback->($c)
16:34 sri if you know javascript... $self is this
16:35 AndrewIsh jberger: OK, so in my MyApp::Plugin::MyPlugin, I am using the register method to define the 'connect' helper, that's the bit that is working. Looking at the docs, it look like the second parameter that the register method receives is the invocant, is that correct? That is what I'm calling 'helper' on: e.g. $app->helper('blahblah....  The 'connect' helper I've created provides the app object with the db attribute, so the second helper I want to create can
16:35 AndrewIsh also access the database as it is also defined within the 'register' method and therefore the invocant ($app) is within it's scope. But if I shouldn't be using the plugin instance to do the work, how should I do it? As I mentioned, I thought a sub class might do it (so MyApp::Plugin::MyPlugin::Material), then I could call methods on this class, but I don't know how I can provide it with $app. Any suggestions?
16:35 jberger jabberwok: anyway, its all convention, from context it never should be unclear
16:35 jberger "Looking at the docs, it look like the second parameter that the register method receives is the invocant, is that correct?" whaaaa
16:36 jberger guys, I'm sorry, but I really have to $work
16:36 AndrewIsh Fair enough ;-)
16:36 Grinnz_ AndrewIsh: no, helpers receive the controller (or a dummy controller if called on the app) as the invocant
16:36 Grinnz_ the rest of the args are whatever args you pass
16:36 Grinnz_ AndrewIsh: to access the app from a helper use $c->app (or $self->app)
16:37 jabberwok Much of this confusion would be alleviated with just a bit of hand-holding in the docs, like explaining why the Synopsis has $self but the Hooks shows $app. Throw us a lifeline, folks.
16:37 sri it's a basic perl convention
16:37 sri there is nothing we invented
16:37 jabberwok I've been doing Perl since '94 but I'm new to the whole object orientation thing, and still trying to wrap my brain around Exceptions
16:38 sri that's allright
16:38 sri but for the core docs it's simply out of scope
16:39 jabberwok ok, that's why we need an O'Reilly book ! =grin=
16:39 sri !!!1
16:39 Adura That's why you're not using Python or Ruby.
16:39 jberger jabberwok: http://modernperlbooks.com/books/modern_perl_2014/07-object-oriented-perl.html
16:40 jberger Mojo objects are not moose, but 90% of this is true
16:40 mst I'd prefer a book from a perl-friendly publisher
16:40 jberger hmmmm, maybe less than 90%, but it will still help
16:41 jabberwok Adura: Right. That and whitespace doesn't count (I left FORTRAN columns behind with my IBM 029) and zero is still false in Perl (unlike Ruby)
16:41 sri mst: like?
16:41 Grinnz_ ... 0 isn't false in ruby?
16:41 * sri like no starch press though
16:41 sri *+s
16:42 mst sri: I don't really mind; apress did a pro job, ORA seem to largely be focused on retreads of old books these days rather than new stuff
16:42 jabberwok http://stackoverflow.com/questions/10387515/why-treat-0-as-true-in-ruby
16:42 mst sri: no starch would also be reasonable
16:42 sri the apress books i've encountered were mostly meh
16:42 Grinnz_ jabberwok: christ...
16:42 purl somebody said christ was tchrist or our Apostrophic Savior. or "If my life is a hard drive, Christ can be my backup."
16:43 jnbek joined #mojo
16:43 Ptolemarch joined #mojo
16:43 Grinnz_ i guess i've got enough good reasons to never touch ruby, anyway
16:44 mst Grinnz_: it's sort of like an implicit 'defined' check
16:44 mst I'm not sure it's necessarily a bad thing
16:44 AndrewIsh OK, so I'm still fighting to understand this :) I have an app, I've created a plugin called ListDatabase, this has a register method that contains a connect helper. In the app, calling $self->helper (db => sub { $self->list_database->connect } ) works fine.
16:44 jabberwok did just buy paper copies, 2nd edition Effective Perl (addison-wesley, 2010) and 2014 modern perl (onyx neon press), if no other reason than support real publishers and authors.
16:45 Grinnz_ it's just different from everything else, which is another barrier to using the language... not saying perl doesn't have its share of those as well
16:45 Grinnz_ but 0 being false is pretty much the core of my interoperation with anything that's not perl
16:45 AndrewIsh I'd like to be able to create a library of functions that can manipulate the database, but this library would need access to $self->db from the controller. What would be the best way of doing this?
16:46 reneeb_ joined #mojo
16:46 Grinnz_ javascript and SQL consider 0 false so 0 and 1 are easy true/false standins
16:47 mst Grinnz_: well, it's different from everything else except lisp
16:47 jberger AndrewIsh: so you already have db logic in some class like MyApp::DoThingWithDB
16:47 Grinnz_ havnet used lisp either, heh
16:47 jberger so now your helper can just be
16:47 AndrewIsh jberger: No, I don't have anything at this point
16:47 jabberwok (((((lousy (infernal (stupid (parentheses ()))))))))))))))
16:48 jberger $app->helper(do_the_thing => sub { MyApp::DoThingWithDB->new(db => shift->app->db)->do_the_thing(@_) });
16:48 jberger shift will be a controller
16:48 jberger $c
16:48 Grinnz_ do the thing!
16:49 jberger now MyApp::DoTheThingWithDB is a pure class with no attachment to the app at all, and can be tested independently
16:49 jberger and the helper gives your controllers etc easy ability to use it
16:49 jberger $c->do_the_thing('some', 'args');
16:50 jberger that is really all the time I have, o/
16:50 AndrewIsh Ahaaaaaa *light dawns*, of course, that makes perfect sense! Thanks *very* much, it's really appreciated. Sorry to keep you from your work :-/
16:52 jberger no worries
16:52 cpan_mojo Mojolicious-Plugin-SemanticUI 0.14 by Krasimir Berov - http://metacpan.org/release/BEROV/Mojolicious-Plugin-SemanticUI-0.14
16:53 good_news_everyon joined #mojo
16:53 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/xEzX
16:53 good_news_everyon mojo/master 024f666 Sebastian Riedel: mention the first argument too
16:53 good_news_everyon left #mojo
16:55 sri i answered on the start-line issue btw. https://github.com/kraih/mojo/issues/751#issuecomment-76734892
16:59 reneeb_ joined #mojo
17:00 jabberwok Updated my content-wrapping filter template as a plugin, with today's  help from jberger et al:  http://blog.wlindley.com/2015/02/zero-to-mojolicious-part-2-content-wrapping-filter-templates/   Thx again to all
17:02 sri oh, i like thah you're writing about what you learn, that will get you extra answers in the future :)
17:02 sri s/h/t/
17:03 sri jabberwok: afraid i have to warn you about {'mojo.content'} though, that mojo. prefix means it is private
17:04 jberger sri: I was just seeing that :o
17:05 jabberwok *nod*  sri  ... i am thinking, either (a) i'm trying to do something that's already in Core somehow; or (b) it ought to be
17:05 * sri nods
17:05 jberger gods I need to stop reading this channel! too much interesting stuff going on!
17:06 jabberwok =hands round the party favors=
17:10 sri wrap_content seems like a very complicated concept
17:10 sri not sure how that would fit in
17:10 sri i would have real trouble teaching that
17:11 sri in fact, even the template inheritance features we have are tricky
17:17 jabberwok how else can you nest templates?
17:18 sri once, with a layout
17:18 sri nesting more than once is a topic that has not even come up before :)
17:19 jabberwok well, i'm coming from WordPress where you have text inside widgets wrapped in sidebars inside a theme
17:19 jabberwok you don't want to rewrite everything if you change sidebars or change from Foundation to Bootstrap, right?
17:19 reneeb_ joined #mojo
17:20 sri well, i'm not opposed to the feature, but it would need a good recipe in the rendering guide
17:22 jabberwok ok i'll continue to work on it.
17:23 jberger batman: is the expand option gone? https://metacpan.org/pod/Mojolicious::Plugin::AssetPack#Development-mode
17:24 batman jberger: what's that?
17:24 purl i think that is a much more rare case
17:25 batman ah. the method?
17:25 batman jberger: do you use assetpack?
17:25 jberger yeah, are the docs out of date or am I missing something?
17:25 jberger we are starting to
17:25 jberger and the frontend dev noticed that now he has to restart the servers to see his css changes
17:26 batman can you give me more details? "changes"...?
17:27 batman the method is gone. but it still does expand...
17:27 jberger he is changing the css and the changes are not reflected in the page until he restarts the server manually
17:27 batman right. it's probably because a) the file is not watched b) MOJO_ASSETPACK_NO_CACHE is not set
17:27 jberger perhaps his morbo isn't watching the right things then
17:27 jberger ok so we need the env var
17:27 jberger will do
17:27 batman use MOJO_ASSETPACK_NO_CACHE=1 it's much more convenient while developing
17:27 batman no, you don't. but i like it more :)
17:28 batman you can do "morbo -w public/sass" or whatever
17:28 jberger batman++ gotcha, thanks
17:28 batman the doc really need some work :(
17:28 sh4 joined #mojo
17:28 batman can you make an issue jberger, so i don't forget it?
17:29 jberger will do
17:29 batman thanks!
17:32 jberger batman: https://github.com/jhthorsen/mojolicious-plugin-assetpack/issues/38
17:32 batman cool
17:37 AndrewIsh Wow, I'm feeling really dim today... Earlier, jberger kindly helped me with setting up a helper, which I now understand :) I'm creating a class for that helper to call methods on, but being pretty new to the Perl O scene I'm struggling. I've been reading http://modernperlbooks.com/books/modern_perl_2014/07-object-oriented-perl.html and I can't see where I'm going wrong. I've got the following class: http://pastebin.com/1CqGacwu and am calling it with: My
17:37 AndrewIsh App::Plugin::ListDatabase::List->new(db => shift->app->db)->update(@_); but am getting the error: Can't locate object method "db" via package "MyApp::Plugin::ListDatabase::List" at /path/here/MyApp/Plugin/ListDatabase/List.pm. Can anyone spot what I've done wrong?!
17:37 AndrewIsh s/Perl O/Perl OO/
17:38 Grinnz_ do you mind sending separate messages for each thought? it's hard to read as paragraphs
17:38 AndrewIsh Grinnz_: Yes, sorry!
17:38 Adura My kind of IRC-er, less lines.
17:39 Grinnz_ i don't see any value in less lines when each line is 500 characters :)
17:41 Grinnz_ AndrewIsh: in your class you have an update function which calls $self->db, but $self is not your app, $self is your object instance you've created with ->new
17:41 Grinnz_ AndrewIsh: basically you need an accessor for the db object you passed into the constructor
17:42 Grinnz_ AndrewIsh: you could make it easy by subclassing Mojo::Base and then you can delete your constructor (Mojo::Base takes care of that) and add: has 'db';
17:43 Grinnz_ use Mojo::Base -base;
17:43 Grinnz_ is all you need
17:43 Grinnz_ AndrewIsh: actually... Mojo plugins are supposed to be subclasses of Mojolicious::Plugin already, which would provide this by proxy
17:44 Grinnz_ oh nevermind, this isn't a plugin, it's just used by a plugin, my bad
17:44 Grinnz_ Mojo::Base is fine then
17:45 AndrewIsh Grinnz_: OK, so I wouldn't need to pass db in the constructor? i.e. I could do MyApp::Plugin::ListDatabase::List->new()->update(@_); And db would automatically be available to my update function via $self->db ?
17:46 Grinnz_ AndrewIsh: no you would pass it in the constructor
17:46 Grinnz_ that's how it gets the db, but Mojo::Base takes care of assigning it to the db attribute and making a db accessor, when you add the line: has 'db';
17:46 AndrewIsh Oh, I seeeee!
17:46 AndrewIsh OK, I'll give that a go and see what happens, thanks very much :)
17:47 Grinnz_ https://metacpan.org/pod/Mojo::Base some basic examples there
17:47 Grinnz_ the -base form is what you're using in this case
17:48 Grinnz_ AndrewIsh: if you want more advanced functionality for object classes look into Moo and Moose (I use Moo but Moose has better tutorials)
17:48 Grinnz_ then you can use things like triggers when an attribute is set, automatically generated clearers, coercing attributes, etc...
17:49 Grinnz_ but none of that is really necessary for what you're doing here ;)
17:50 AndrewIsh Grinnz_>: OK, sounds interesting, thank you :)
17:51 AndrewIsh Grinnz_: It works, that's excellent, thank you very much!
17:51 Grinnz_ np, welcome to perl OO :)
17:51 AndrewIsh Thanks, it's an exciting new world ;-)
17:54 dod joined #mojo
18:02 frudas joined #mojo
18:02 frudas hello
18:03 frudas can anybody help me with some mojo questions?
18:04 frudas :D
18:04 hahainternet frudas: "Don't ask to ask" :)
18:04 hahainternet just say what questions you have and if someone can, they will answer
18:04 frudas ok thanks
18:07 frudas well i have to mojo mojo web service serviceA.pl and serviceB.pl , is posible to call a serviceB.pl in something like that "post '/registro_de_usuarios' => sub {   my $self = shift;   $self->render('serviceB');   };"     ?
18:08 hahainternet oh interesting, i don't know for sure
18:08 hahainternet not something i've ever dealt with
18:08 hahainternet just stick around for a bit though, someone will be able to answer, jberger always likes a challenge
18:08 frudas mmm
18:09 frudas any alternative?
18:09 purl any alternative is probably likely to be less clear than what you've got
18:09 jberger you want to serve the file itself?
18:09 frudas just the web service is to big
18:09 frudas i dont want to add more code
18:10 frudas to the serviceA
18:10 jberger I have no idea what you are asking for
18:10 frudas i can copy and paste the code
18:10 jberger and it sounds like you probably are needing to move to Full apps at this point
18:10 mst frudas: move the common code into a module.
18:10 mst frudas: call the common code
18:10 jberger please do not paste into the channel
18:10 shadowpaste joined #mojo
18:10 mst http://paste.scsys.co.uk/mojo now works
18:12 frudas how i can move the code into a module ? any link?
18:12 frudas or example
18:14 jberger frudas: this is just perl, abstract as you normally would, and please be sure to read the guides at http://mojolicio.us/perldoc
18:15 frudas well thankx any way XD
18:16 mst frudas: maybe you'd benefit from reading Ovid's Beginning Perl or chromatic's Modern Perl (or both)
18:16 mst frudas: "writing a .pm file" is a pretty basic perl skill if you're trying to build apps
18:18 frudas thankx, but any way to load a web service inside other?
18:18 frudas :)
18:18 mst frudas: yes. turn the one you want to load into a module.
18:18 frudas post '/other_webService' => sub { my $self = shift; $self->render('serviceB.pl'); };"
18:18 Grinnz_ frudas: we're not going to help if you're just going to ignore our answers
18:19 frudas im new in mojo be patients :)
18:20 Grinnz_ then stop and read what they have said
18:20 frudas be cool men
18:20 mst frudas: he is being cool. you are being rude.
18:21 frudas 9.6
18:21 Grinnz_ frudas: here is some information you could use on turning your app from Lite into a full app: https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Growing.pod
18:22 frudas thankx
18:22 Grinnz_ frudas: but you need to read up on basic perl modules
18:22 frudas :) ok
18:22 mst frudas: http://modernperlbooks.com/books/modern_perl_2014/07-object-oriented-perl.html
18:23 frudas thanx every body i will read
18:28 sri oh, brian d foy will be at mojoconf
18:30 Ptolemarch joined #mojo
18:33 frudas left #mojo
18:34 jberger ribasushi was asking around too btw
18:35 jberger it'd be cool to have a dbic talk
18:41 shadowpaste "berov" at 217.168.150.38 pasted "testing paste" (1 line) at http://paste.scsys.co.uk/468507
18:42 berov mst: yes, it works :), thanks!
18:49 punter joined #mojo
19:05 wingfold_ joined #mojo
19:08 cpan_mojo Minion 1.09 by Sebastian Riedel - http://metacpan.org/release/SRI/Minion-1.09 (depends on Mojolicious)
19:11 sri \o/
19:12 sri every now and then i wonder if minion actually promises too much consistency
19:14 sri like, do you really need to know if a job failed? or would it be ok if one got lost every now and then? or is it ok if all jobs could run twice by accident?
19:15 sri it's tough, every job queue has a different philosophy
19:15 Grinnz_ indeed
19:15 Grinnz_ you have to at least provide the ability for the user to make those choices
19:15 marcus heh
19:15 sri minion is in the same category as delayedjob, with a focus on consistency instead of performance
19:16 marcus I think consistency is preferable to performance in most cases
19:16 marcus at least as long as you can scale by adding more minions.
19:16 sri bottleneck is database locking
19:18 sri i don't think you'll get more than a few hundred jobs/s out of postgres right now without giving up some consistency
19:18 sri (in 9.5 with skip locked things get easier though)
19:18 marty joined #mojo
19:19 sri sidekiq (with redis) can do thousands of jobs/s
19:22 disputin joined #mojo
19:22 sri you can of course build a faster backend for minion with redis or postgres advisory locks, but you have to give up some of the consistency
19:32 trone joined #mojo
19:32 sri job history and results are especially expensive
19:36 disputin joined #mojo
19:39 jontaylor joined #mojo
19:40 sri when would you need 5000 jobs/s throughput?
19:40 Grinnz_ web scale!
19:40 purl web scale is mongodb or https://www.youtube.com/watch?v=b2F-DItXtZs
19:41 sri serious question :)
19:42 stephan48 a good question - maybe better asked on the ML?
19:43 mst sri: if I needed that I'd run postgres on a tmpfs
19:43 kaare joined #mojo
19:43 mst I've done it before. it scares people, but it's really quite effective.
19:44 sri interesting idea
19:44 mst also there's no reason not to blow away the history regularly if you don't care about it
19:44 sri done by default every 10 days :)
19:46 sri it's more about the cost of the process of keeping a history, the whole idea of using a state machine for each job... allowing jobs to be restarted by a user
19:47 sri celery for example is on the other end of the spectrum... just throwing jobs at a generic message queue, and delivering them to workers
19:47 sri no state kept at all
19:48 sri with an optional second database for workers to send job results to
19:49 sri (or rather only database... depending on the message queue)
19:50 sri most people don't actually seem to care about such detail
19:50 sri *+s
19:50 marcus I wonder if beanstalkd would make a good minion backend.
19:50 marcus we're using that for output.digital
19:52 sri on its own, unlikely
19:53 sri unless it allows us to store job results
19:54 Grinnz_ almost seems like a good use case for roles... track-job-progress role, track-job-history role, get-job-results role.. maybe
19:55 sri beanstalkd seems to use the traditional "enqueue -> reserve ->delete"
19:55 sri postgres could do that rather efficiently too actually
19:57 sri get session advisory lock on job id, receive job, keep connection open, process job, delete job and release advisory lock
19:57 Ptolemarch joined #mojo
19:58 sri thing is, in this model, if your worker dies, the advisory lock gets released, and the job is back in the queue as if nothing happened
19:58 sri you'll never know something happened
19:59 sri or if your database connection gets closed for some reason while you're blocking on something big
19:59 sri then the job gets released again and processed twice
20:00 sri that actually happens with https://github.com/chanks/que
20:00 sri they are really fast because they never change the job record
20:01 sri just put a lock on it, and when done processing, just remove the record
20:01 sri so many tradeoffs you can make with job queues :S
20:02 sri and that doesn't even begin to cover all the database tuning you can do... as mst mentioned
20:04 punter joined #mojo
20:05 sri anyway, i think with minion we have a very solid choice that will just work for most apps
20:05 sri now that monitoring is done properly
20:07 janus solid is good - in my experience you end up with custom queue designs anyways at certain scale, so why bother with speed
20:08 sri funny thing, the commercial version of sidekiq increases reliability with a custom lua job scheduler that runs inside redis :)
20:25 riche joined #mojo
20:36 sri for the mojoconf organizers https://groups.google.com/forum/#!topic/mojolicious/Zmk3P0YL1jU
20:37 riche i'll respond
20:37 sri riche++
20:38 hernan604 humm shutterstock using mojo? :P
20:40 Adura Says who?
20:40 purl rumour has it Says is not reliable, in that errors are reported but no automatic retry
20:42 hernan604 Adura: the comment in the page sri linked has a name... which has a linkedin profile and currently works for shutterstock
20:42 hernan604 and shutterstock used catalyst before iirc
20:42 Adura Misleading headers!
20:42 hernan604 which headers ?
20:43 Adura x-powered-by header.
20:43 hernan604 wherE?
20:43 Adura On the site you mentioned...
20:43 Grinnz_ no the sender's email address is @shutterstock.com
20:44 hernan604 Adura: great!!
20:44 hernan604 i think they changed defaults for security ?
20:44 Adura Great? I mean, it is Perl.
20:45 Grinnz_ what are we even talking about anymore?
20:45 mst Has anyone really been far even as decided to use even go want to do look more like?
20:46 hernan604 i dont understand mst question
20:46 hernan604 \o/
20:47 Adura The answer is another meme.
20:47 hernan604 hahaha :D
20:47 irq joined #mojo
20:51 Adura But yeah, shutterstock.com uses that Santa's Reindeer-related Perl web framework.
20:52 sri they may very well be using all frameworks
20:52 Grinnz_ santa's what?
20:52 Grinnz_ oh
20:53 Grinnz_ i was like "blitzen... donner... ?"
20:53 Adura Certainly, but I was just looking at/talking about headers.
20:53 sri framework version in the x-powered-by header is hilarious though
20:54 Adura Make Mojo's Electricity.
21:00 ZadYree joined #mojo
21:12 marcus oh, jnap works at shutterstock?
21:12 jontaylor joined #mojo
21:16 jontaylor joined #mojo
21:18 kaare joined #mojo
21:19 sri re #751, HTTP::Daemon doesn't care what's in the request-line https://metacpan.org/source/GAAS/HTTP-Daemon-6.01/lib/HTTP/Daemon.pm#L140
21:19 sri just a (\S+)
21:24 sri i've looked around a bit, and security implications seem minimal
21:26 Grinnz_ i agree; it is just the query string
21:26 Grinnz_ the only security implication that usually comes up in the request string is / in the path
21:26 jontaylor joined #mojo
21:29 Adura The HFS+ silliness that git encountered may be an issue.
21:30 sri or \0 with C based parsers
21:30 mst haet ci fses
21:31 sri the path gets percent and utf-8 decoded anyway
21:31 sri i don't think there would be a new vulnerability
21:33 Grinnz_ yeah. thats why the / thing is a "security" issue, because percent-encoded / would suddenly become a path separator...
21:33 jontaylor joined #mojo
21:38 sri Grinnz_: your comment in #571 is a bit ambiguous
21:38 sri url says /wont/match but you don't actually show a failure
21:38 Grinnz_ sri: sorry, those are what shows up in the access logs for the respective web servers
21:39 sri ah, so they are allright with it
21:39 Grinnz_ seems so, in one case i got a successful redirect as thats what the server was set up to do
21:40 good_news_everyon joined #mojo
21:40 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/xgZG
21:40 good_news_everyon mojo/master 01709bc Sebastian Riedel: relax request-line handling in Mojo::Message::Request (closes #571)
21:40 good_news_everyon left #mojo
21:41 sri oops, wrong issue number :O
21:41 Grinnz_ haha
21:43 good_news_everyon joined #mojo
21:43 good_news_everyon [mojo] kraih force-pushed master from 01709bc to 9b53988: http://git.io/BhzC7A
21:43 good_news_everyon mojo/master 9b53988 Sebastian Riedel: relax request-line handling in Mojo::Message::Request (closes #751)
21:43 good_news_everyon left #mojo
21:44 sri nobody saw that
21:44 * genio looks the other way and whistles
21:46 Adura Jedi.
21:53 Grinnz_ sri: http://serverfault.com/questions/451521/how-can-i-configure-apache-to-respond-400-when-request-contains-an-invalid-byte i suppose considering it an invalid request is acceptable too, but i think it's fine to do like apache and nginx and leave that up to the application
21:53 inbioz joined #mojo
21:53 Grinnz_ is it possible to see the raw request line from the applicatin?
21:53 Grinnz_ +o
21:55 Grinnz_ either way... i'm not really sure it matters for much
22:03 Grinnz_ wow, someone wrote a whole async implementation of a mysql client for a Mojo::mysql PR?
22:03 Grinnz_ i wish someone would contribute that to DBD::mysql hehe
22:03 genio ok, I need two external cameras to see how this houdini of a dog is getting out of the fence!
22:03 Grinnz_ genio: what kind of dog, and how high is the fence?
22:04 genio american bulldog mix (80-ish pounds) and the privacy fence is over 6 ft, the other fence is ~5 ft tall
22:04 Grinnz_ that's jumpable
22:04 Grinnz_ well, usually it involves a bit of climbing
22:04 genio The other dog doesn't jump out.  She's a good girl!
22:04 purl thanks genio :)
22:05 Grinnz_ lol
22:05 * genio pushes purl down the stairs
22:05 purl Hey! *thump* ow! *bang* argh! *bam* son of a *thump* *crunch* whimper...
22:05 genio damn, cameras are expensive
22:05 Grinnz_ a few of the goldens my parents had would regularly jump the 6-7ft chain fences of the kennels
22:06 Grinnz_ once my mom put a piece of plywood on top and the next day found the dog lying on top of it
22:06 sri :O https://github.com/jhthorsen/mojo-mysql/pull/9
22:07 sri you were not kidding
22:07 mattastrophe joined #mojo
22:07 Grinnz_ yeah
22:07 Grinnz_ i was like "if not DBD::mysql what does this use to do mysql async??"
22:07 Grinnz_ and then i saw the committed module
22:09 sri tests and all
22:09 Grinnz_ a real mysql async client would be fantastic...
22:10 lb if we all close our eyes and click our heels together, mysql might disappear?
22:10 Grinnz_ haha... if only
22:29 polettix joined #mojo
22:30 polettix hello all
22:30 purl It's a crazy world, but hello to you too!
22:32 pink_mist purl is such a nice bot
22:32 pink_mist botsnack
22:32 purl thanks pink_mist :)
22:32 * sri hugs purl
22:32 * purl flees!
22:32 sri :(
22:36 sri jabberwok: i suppose what you really want with wrap_content is a way to replace a content buffer
22:36 jberger jkramer++, sri++, Grinnz_++
22:37 sri and that seems very reasonable
22:43 inbioz joined #mojo
22:56 cpan_mojo Mojolicious-Plugin-AssetPack 0.38 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-0.38
22:59 cpan_mojo Mojolicious-Plugin-AssetPack 0.3801 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-0.3801
23:01 batman jberger: https://github.com/jhthorsen/mojolicious-plugin-assetpack/blob/master/lib/Mojolicious/Plugin/AssetPack/Manual/Modes.pod
23:02 batman hack overload
23:02 batman going to bed
23:02 purl You and me, of course. or a goat
23:02 Grinnz_ ...a goat?
23:03 pink_mist a goat is fine too?
23:07 jberger batman += 3
23:07 jberger not everyone is seeing it all, but batman is kicking all form these last few days
23:09 riche https://www.youtube.com/watch?v=5iDZgEQ87K4
23:10 alnewkirk joined #mojo
23:12 batman jberger: that's how I roll. Every day.
23:12 batman Haha
23:14 batman Well. That's not true. After all I'm not a robot.
23:15 batman I have needs. Like beer. And sleep.
23:15 batman :)
23:15 nicomen batman++ # adding conference howto as tickets :-)
23:16 batman nicomen: Please review them. It feels like we did a bunch more than I got documented in those tickets...
23:20 batman There's so much to hack. And so little time...
23:20 batman Sure goog to miss it when the machines take over though.
23:22 riche batman: nothing to miss because you'll be a battery
23:23 batman What makes you believe I'm not a battery already? :)
23:23 Grinnz_ hey, at least you'll be able to fly in the virtual world they create for us!
23:26 jberger riche: hehehe
23:26 sri greetings fellow humans
23:26 jberger sri: turing test fail
23:27 batman Huh? I thought you were a robot sri :)
23:27 batman jberger: i'm pretty confident the assetpack manual need work. Please let me know how to improve it.
23:28 sri http://i.guim.co.uk/static/w-620/h--/q-95/sys-images/Music/Pix/pictures/2012/4/12/1334228417357/Short-Circuit-007.jpg
23:28 sri me? nooooooo
23:28 jberger we've only just started using it, I'm sure I'll have feedback soon
23:28 jberger does this make sense to anyone?
23:28 jberger purl: humans?
23:28 purl humans are both end of the channel.  Sounds like it's worth taking seriously.
23:28 jberger purl: humans?
23:28 purl humans are both end of the channel.  Sounds like it's worth taking seriously.
23:28 jberger hmmm, it has a german thing too
23:29 batman jberger: Looking forward to it. The POD is totally restructured now.
23:29 jberger purl: literal humans
23:29 purl jberger: humans =are= <reply>Schmutzige menschliche Gestanktiere. Mein Schicksal fällt vom Himmel auf Ihre verurteilten Köpfe!| both end of the channel.  Sounds like it's worth taking seriously.
23:29 Grinnz_ lol
23:29 sri not written by a german
23:29 jberger I was going to replace it with a flight of the conchords
23:30 Grinnz_ Translated German => English: Dirty human stench animals. My fate falls from the sky on your convicted heads!
23:30 sri it's gibberish
23:31 jberger it looked intentional though, so I thought I would ask
23:33 jberger purl: the humans is <reply>The humans are dead! https://www.youtube.com/watch?v=WGoi1MSGu64
23:33 purl OK, jberger.
23:33 jberger BINARY SOLO!!!!!
23:33 purl o/`   0000001 00000011 000000111 00001111    o/`
23:33 riche oh my :)
23:34 Grinnz_ o_o
23:34 jberger I accidentally found that one the other day and I nearly fell off my chair
23:34 Grinnz_ what is most troubling is that those are all different bit widths
23:34 riche I have all their music ... once fell asleep with 3 of their albums on loop on a long flight.  I was screwed up for almost a week.
23:34 jberger riche: hahahahah!
23:34 purl LOLCON 4.5 reached.
23:37 riche yeah I sometimes would just think, "it looks like an arm-fish"
23:39 jberger besides humans are dead and most beautiful girl (obviously), I think my favorite is Jenny
23:40 jberger that is just seriously createive
23:40 jberger s/e//
23:43 riche mine is the hiphopapotamus
23:46 riche https://www.youtube.com/watch?v=sOgC8qp_I2Y
23:49 riche jberger: http://www.billboard.com/articles/events/sundance-2015/6451206/flight-of-the-conchords-tour
23:50 jberger :-)

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