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

IRC log for #mojo, 2016-03-09

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

All times shown according to UTC.

Time Nick Message
01:10 zivester joined #mojo
01:46 asarch joined #mojo
02:29 noganex joined #mojo
02:40 asarch joined #mojo
02:48 ilbot2 joined #mojo
02:48 Topic for #mojo is now ???? cheers | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
03:16 bc547 joined #mojo
03:44 noganex_ joined #mojo
03:52 asarch How would you dump on console.log the content body of a request with XMLHttpRequest?
03:52 asarch I mean, if I do: var req = new XMLHttpRequest(); req.open("POST", "/foo", true); req.send("bar");
03:53 asarch Is it with req.onreadystatechange?
03:54 mattp_ use jquery or something similar that abstracts that
03:55 mattp_ no joke ive been doing web dev for years and have never written a raw xmlhttprequst by hand. not even once
03:56 meredith yeah o thoml that
03:56 meredith wow
03:56 meredith yeah i think that's the hook you want
03:56 asarch ?
03:57 meredith set a function there:  req.onReadyStateChange = function (i don't remember what you get passed) { console.log(the thing) }
03:58 mattp_ you'd need to check that readyState == 4 / DONE before reading response/responseText via onreadystatechange
03:58 meredith oh, nothing passed, you just use req in the function.
03:59 meredith yeah i'm pretty used to wrappers too :)
04:04 asarch You mean: req.onReadyStateChange = function(data) {console.log("I got ", data);};
04:04 asarch ?
04:07 mattp_ asarch: the callback will fire multiple times for each state. you only want to read when the state is DONE
04:10 disputin joined #mojo
04:17 disputin joined #mojo
04:49 berov1 joined #mojo
04:55 irqq joined #mojo
05:04 irqq joined #mojo
05:06 inokenty-w joined #mojo
07:00 ichi joined #mojo
07:18 cpan_mojo MojoX-Renderer-JSON-XS-0.07 by YOWCOW https://metacpan.org/release/YOWCOW/MojoX-Renderer-JSON-XS-0.07
07:25 dod joined #mojo
07:30 dod joined #mojo
07:56 Vandal joined #mojo
08:05 CandyAngel s1037989: I totally took your advice. I now have an IRC bot that I can send notifications to :P
08:14 CandyAngel s1037989: I need to flesh it out as a solution (allow other notification types, write a client instead of just CURLing, some sort of authentication), but I like it
08:14 Adura New MCE version, eeenteresting.
08:15 ichi joined #mojo
08:16 cpan_mojo Business-Payment-SwissESR-0.13.0 by OETIKER https://metacpan.org/release/OETIKER/Business-Payment-SwissESR-0.13.0
08:18 trone joined #mojo
08:42 AndrewIsh joined #mojo
08:46 * sri yawns
08:51 CandyAngel Heyas sri
08:51 sri o/
09:04 sri oh, here we go, looks like apple made the first http/2 only service
09:05 sri the new Apple Push Notification service
09:06 sri https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/APNsProviderAPI.html
09:11 sri you have to use an http/2 client to access it, http/1.1 is completely unsupported :o
09:20 sri we are still looking for volunteers to work on http/2 support!
09:20 sri *nudge nudge*
09:32 bc547_ joined #mojo
09:32 disputin1 joined #mojo
09:50 irqq joined #mojo
10:10 sri *crickets*
10:10 sri -.-
10:13 CandyAngel I would, but I'd have no idea what I was doing
10:13 CandyAngel ANd if you say that I don't anyway I'll.. I'll.. nod in agreement :P
10:21 CandyAngel Is there a list of things that need doing to support it?
10:21 sri http://i2.kym-cdn.com/photos/images/newsfeed/000/478/261/226.gif
10:21 CandyAngel :P
10:22 sri https://github.com/kraih/mojo/issues/423
10:31 sri aside from one big open question it's mostly grunt work now
10:32 sri big open question is how to deal with concurrent streams in Mojo::Server::Daemon
11:13 bpmedley sri : http://bmedley.org:3000/ <-- Did you see the minion ui changes?  Especially with jberger's modifications
11:17 bc547_ jkdihenkar: /win 2
11:17 bc547_ oops
11:19 bpmedley sri : The UI is a plugin.. https://github.com/brianmed/minion_ui/blob/master/lib/Minion/Command/minion/ui.pm and https://github.com/brianmed/minion_ui/blob/master/ex/pg_demo.pl
11:23 sri bpmedley: scrolling is very odd in chrome
11:23 bpmedley How so?
11:23 sri jumps around
11:25 dvinciguerra joined #mojo
11:26 bpmedley Sorry, not sure I understand.  Do the visuals change physical location on the screen or is the speed random or is it something else?
11:26 pink_mist bpmedley: have you tried looking at it in chrome yourself? that might help
11:26 bpmedley pink_mist : I am running in chrome.. hence my confusion
11:27 sri this was chrome on os x
11:27 pink_mist ah
11:27 bpmedley I'm in os x
11:27 * sri shrugs
11:28 pink_mist fwiw on windows it's smoother in firefox for me; there's some glitching in chrome on windows
11:28 bpmedley Can you describe the glitching?
11:29 pink_mist a small bit of the page gets inverted colour for about 0.08 seconds
11:29 sri your charts are still weird too, with inactive and active
11:29 bpmedley What would be better charts?  I can fix that easily..
11:30 sri no inactive workers at all
11:30 pink_mist bpmedley: the inverted colours seems to be a circle shape on the middle of the page
11:30 pink_mist maybe two circle shapes
11:30 bpmedley sri : Is there a bluish line at 0 and a orangish line at 2?
11:31 bpmedley pink_mist : Could be a spinner gone crazy.
11:31 sri bpmedley: yes
11:31 bpmedley Let me run a couple jobs
11:31 sri the charts just don't make sense
11:32 sri orange line serves no purpose
11:32 bpmedley Hrmm, how can that situation be improved?  Only show active workers?
11:33 sri liek here https://i.imgur.com/vtBtViM.png
11:33 sri this looks so weird
11:33 dvinciguerra_ joined #mojo
11:33 pink_mist on finished & failed graph, I think you should switch the colours around; blue is visually closer to green, which is usually a colour meaning 'ok', and orange is visually closer to red, which is usually a colour meaning 'not ok'
11:33 bpmedley Perhaps a bar graph that only shows active active workers?
11:34 pink_mist (I thought it was displaying 8 failed jobs when I first glanced at it)
11:34 bpmedley pink_mist : That's great feedback
11:34 nic I just get err_connection_timed_out
11:35 bpmedley nic : Does any part of the page load?  Do you get HTML via curl?
11:36 pink_mist sri: I think it looks fine
11:36 sri think i've said it before, not such a big fan of that kind of ui design, so take my feedback with a grain of salt
11:37 bpmedley sri : Hrmm.. happen to have an example of what you'd rather see?
11:37 sri pink_mist: have to disagree
11:37 nic bpmedley: no.  It's resolving to 64.91.234.170, but can't get anything from :3000
11:38 bpmedley nic : I have no idea
11:39 sri bpmedley: mix of the mojolicious core templates and https://raw.githubusercontent.com/mperham/sidekiq/master/examples/web-ui.png
11:39 sri your app is clearly mobile specific, so i guess you can't really compare it
11:39 pink_mist sri: I ... don't really see how that's any different except colour-wise
11:40 pink_mist and no grid
11:40 bpmedley Perhaps the Finished and Failed jobs look like a big blob on the page?
11:40 sri that's ok, i'm very picky about design
11:41 sri small things like a proper color palette matter a lot to me
11:43 bpmedley I'd be happy to change the visuals, if a mobile centric ui could prove useful..
11:46 sri it's really hard to criticize design without offending someone
11:46 bpmedley nic : Would you try now?
11:46 nic just did
11:47 bpmedley nic : Did you get data?
11:47 nic I can pull the html into Canada (tho a bit slow) but nothing into UK
11:47 bpmedley Very strange hrmm
11:47 nic It might be the $work firewall doesn't like your ip
11:47 nic so not worth worrying about
11:47 sri think the best i can do is to say that it currently has no discernable design language at all
11:48 bpmedley sri : That made me smile.. :)   You're somewhat correct - it looks like an engineer with no sense of color and layout designed the UI, eh?
11:49 * sri nods
11:49 sri "an engineer designed this"
11:49 bpmedley Which is correct..
11:52 * sri doesn't like it when his criticism sounds so harsh... but also doesn't want to give dishonest feedback :S
11:53 bpmedley I think a Mobile UI can be more useful than desktop one.  Perhaps we can put some thought into layout and color?  I
11:53 sri don't ask me for feedback on uis!
11:53 bpmedley The feedback so far has been pragmatic, not harsh.
11:54 sri this design is also pretty decent http://automattic.github.io/kue/
11:56 bpmedley I like the sidekiq one better.  I'd like to see a graph on the landing page; however, I'm more than willing to change color and format of the graph.
11:59 punter joined #mojo
12:01 bpmedley I'll see if I can change the graph styles somewhat.  Also, plugin approach is really sweet.
12:02 bpmedley be back in a bit.. may take a couple days to change the UI
12:05 sri pretty sure the minion core ui will not be a single-page app
12:06 bpmedley Understood
12:07 sri if i ever actually get around to it ¯\_(ツ)_/¯
12:48 kaare joined #mojo
13:04 vanHoesel joined #mojo
13:05 vanHoesel1 joined #mojo
13:13 asarch joined #mojo
13:55 zivester joined #mojo
13:57 vanHoesel joined #mojo
14:01 ramortegui joined #mojo
14:17 neilhwatson joined #mojo
14:29 sri bpmedley: ignoring the design, your job listing features also seem super limited
14:30 sri there's no separtion by states, or queues
14:31 sri this ui is pretty ugly, but has the kind of information i would expect https://cloud.githubusercontent.com/assets/1458008/5229932/76dd0e70-7716-11e4-9551-e87ce799d8dc.png
14:35 jberger Does anyone understand the swat/sparrow/cpanparty thing?
14:35 jberger http://swatpm.org/cpanparty/
14:35 sri no
14:36 jberger It's like, maybe behavior testing?
14:36 jberger But each thing one has only the most basic "test"
14:37 jberger s/one//
14:38 jberger It seems like he's excited about testing, but doesn't have any experience with it?
14:41 preaction he's writing more tests for these things, and then running them
14:43 acamari joined #mojo
14:44 genio hrm.  I didn't know Raisin existed.  cpanparty taught me something :)
14:53 mcsnolte joined #mojo
14:57 zivester joined #mojo
15:22 twinhooker jberger, I worked with author of swat things. He worked as DevOps in our company and got many webapps to deploy on perl/python/ruby. And always wanted smoke tests after build. Some of us created this tests but some of us not. So as I understood after leaving us he build swat to test everything him self.
15:24 jberger right, so this is a "framework" for integration testing
15:24 jberger but how can that possibly work on a third party site?
15:24 sri twinhooker: what is your nick supposed to mean?
15:24 preaction he's building his framework and testing it using cpan modules
15:26 twinhooker Second purpose, as he told me, is integration testing when you test your application with nginx for e.g.
15:26 jberger I also don't understand why you'd want to build an entirely new framework for it
15:26 twinhooker sri, just nick of ragga-jungle DJ
15:26 jberger you can still write your integration tests using tap and test::more etc
15:27 sri jberger: is that nick as offensive as it looks to me?
15:27 jberger seems there is a musical artist
15:27 twinhooker actually I dont understand either ((:
15:28 sri how does a musical artist make a word non offensive?
15:28 Jonis it could also be a fishing reference :)
15:28 jberger twinhooker: it would be <s>easier</s> less controversial if you picked a different nick
15:29 yakudzo ehehee
15:29 jberger yakudzo: much easier, thanks
15:30 yakudzo jberger, https://github.com/naturalist/kelp/issues/49
15:30 yakudzo here is what he told me
15:32 yakudzo sri, and why it is so offensive ?
15:33 jberger yakudzo: hooker being a prostitute and twin being by definition siblings implies incest
15:33 jberger which I think most people would find at least slightly offensive
15:34 jberger as to the conversation, as I read it (and I haven't gotten to the end) I had lots of the same questions when he approached us
15:35 jberger the idea of testing an HTML response as raw text is almost useless (let alone structured data)
15:35 jberger which is why we have nice testing tools already
15:36 jberger even HTML should be tested as structured data since it is mostly whitespace independent
15:36 * sri actually knows now what he wants the minion admin to look like
15:37 jberger "but I don't test an application, I test it's building blocks" this argues against swat being for integration testing
15:39 genio I've tried to understand the purpose of his swat app, but I don't get it either.
15:40 jberger I don't like that he keeps pushing testing of "good enough" subsets (because his framework can't test certain things) that's a huge design flaw, especially for a new system
15:41 zivester_ joined #mojo
15:42 sri this is the design i want https://camo.githubusercontent.com/f263ab4060a09e4375cc4197fb5bfe2afcacfc20/687474703a2f2f68616e67666972652e696f2f696d672f75692f64617368626f6172642d736d2e706e67
15:42 jberger here was his similar issue to us: https://github.com/kraih/mojo/pull/827
15:42 jberger sri: looks nice
15:43 sri it's from here http://hangfire.io/
15:43 sri this is also nice http://cdn.hangfire.io/img/ui/retries.png
15:43 yakudzo hahahaha next time I'll see him I will copy/paste this conversation for him. He drives me crazy with this swat thing.
15:44 preaction i don't think i got a really good answer to my question about how cpanparty differs from cpantesters, and/or why it could not be added to the existing cpantesters infrastructure (technical issues notwithstanding)
15:46 jberger yakudzo: I'm not trying to be intentionally antagonistic
15:46 jberger I just really cannot understand what value it brings
15:47 jberger and he just keeps saying "read more here" where that link doesn't tell me either
15:47 yakudzo sri, and about "twinhooker". Hook is also punch in boxing and twin as a double. So I understood it as "double puncher"? (;
15:52 Lee why would you release a testing framework that itself has no tests? :/
15:53 CandyAngel Twinhooker sounds like a fishing hook </two_cents>
15:55 genio When I first saw it the first thing that popped into my mind was fishing as well. I can see how it could be taken the other way though
15:57 CandyAngel Also, could be a surgical locking plate
15:57 CandyAngel Or anything with two hooking points
15:58 CandyAngel http://cdn.shopclues.net/images/detailed/6446/2_1407937863.jpg
15:58 vanHoesel1 joined #mojo
15:59 jberger lets just say thanks for changing the nick and avoiding confusion :-P
16:01 CandyAngel If you see "twinhooker" and think of prostitutes, you may have played too much GTA
16:02 CandyAngel :P
16:03 yakudzo jberger, the only thing I can suggest is to tell him that mojolicious concept is to have everything in one module ("Web out of box") and having testing framework in seperate module is not correct for Mojolicious
16:03 yakudzo (:
16:04 jberger yakudzo: I don't think that's what I'm saying at all
16:05 jberger I'm saying that testing HTML or any other web application response as strings is going backwards
16:05 jberger and we already have TAP so we don't need a text based testing protocol
16:06 preaction also problematic, as whitespace is insignificant in most html contexts
16:06 jberger and we have TAP emitters and harnesses so we don't need things that run text based tests
16:07 jberger and in particular Test::Mojo can startup a web server on demand so you don't need architecture to do that either
16:07 jberger at which point I'm running out of reasons for swat
16:07 jberger and the only response I get is "it works for some applications"
16:08 Grinnz_ better than me, since I can't figure out what it's for to begin with
16:10 jberger sri: I'm going to put together one more framework benchmarks PR now that it seems that the 20+ cores thing is settled (I waited a few days)
16:10 jberger can you remind me what settings you expect I should start with
16:10 jberger (I'm also gonna get rid of the config file business)
16:13 yakudzo jberger, copied your reasoning for him. Hope it will help him to understand why I dont need swat either (:
16:13 jberger please convey to him that I'm not trying to be hostile
16:14 jberger and I appreciate his enthusiasm
16:14 jberger but I just don't see what gap he's trying to fill
16:14 yakudzo of course
16:17 lluad joined #mojo
16:18 jberger sri: was this the last word on settings: http://irclog.perlgeek.de/mojo/2016-03-03#i_12132851 ?
16:18 sri yes
16:19 jberger cool thanks
16:23 CandyAngel So I looked at the nicklist and there are 3 nicks that could be offensive :P
16:24 Grinnz_ let's not go fishing
16:24 CandyAngel The most obvious one is "Bender", which is an insulting term for homosexual
16:24 CandyAngel diegok could be read as "die gok", which might count as hate speech
16:25 CandyAngel And "crab", which is clearly insensitive to people with pubic lice :P
16:25 preaction this doesn't sound like a productive area of discussion
16:26 sri are you making fun of the code of conduct?
16:26 sri nothing burns me out faster than these kinds of discussions :(
16:27 sri you know, i was just having some fun designing a minion ui... and now i just need to get offline
16:27 sri i hate this shit so much
16:27 CandyAngel Sorry, I didn't mean to upset you
16:28 CandyAngel I won't mention it again
16:28 perlpilot CandyAngel: what *did* you mean to do?  It didn't sound like anything useful or fun or interesting.
16:29 preaction i'm sure we can just drop it at this point
16:29 perlpilot aye
16:32 sri joined #mojo
16:54 dvinciguerra joined #mojo
17:07 jberger sri: https://github.com/TechEmpower/FrameworkBenchmarks/pull/1961/files
17:56 zivester joined #mojo
17:59 mspo sri: you were offended for three minutes
18:01 pink_mist mspo: we were supposed to have dropped it...
18:05 Grinnz_ jberger: https://metacpan.org/release/BALLARD/WWW-LetsEncrypt-0.001
18:06 Grinnz_ (yay, git logs as changelogs)
18:06 mspo pink_mist: just funny (to me)
18:07 ribasushi mspo: it's funny to me too fwiw
18:08 PryMar56 joined #mojo
18:27 jberger copyright dreamhost
18:27 disputin joined #mojo
18:28 jberger and still the mojo plugin has what none of the others can do, serve the challege request from your app, automatically, without stopping your app
18:29 mspo anyone want to recommend front end stuff?
18:29 mspo I'm having a lot of trouble putting together all of pieces
18:32 preaction i like bootstrap and angular1, personally
18:33 mspo I was looking at react and it seemed nice
18:33 mspo is it the only one that doesn't require jquery? :)
18:33 preaction what's wrong with jquery?
18:34 genio nothing wrong with jquery, it just opposes how some of the frameworks for SPAs work.  mixing the two becomes troublesome
18:34 preaction weirdly, that WWW::LetsEncrypt includes the GPL3 in the license file, but claims "Same terms as Perl itself", which is Artistic-1/GPL-1
18:34 mspo I get offended when things like backbone claim to be "small" but require jquery
18:34 preaction jquery _is_ small though
18:35 genio We've been using Ampersand lately  https://ampersandjs.com/
18:38 jberger I am a little of mad that I didn't get my ACME module out before that one
18:39 jberger I mean I didn't know it was coming, but it makes sense that others are in the works
18:40 lluad React is quite nice, though it's as much a philosophy / HOWTO as it is a framework. I mostly use bootstrap for CSS, even though there are other frameworks out there that are better in some respects.
18:41 lluad (I'd probably look hard at zurb foundation as a bootstrap alternative if I were doing a public-facing, reactive site)
18:42 genio There are tons of nice front-end CSS kits and most of them have SASS/LESS to start with, so.. meh. pick one at random
18:45 mspo thanks for the links
18:48 Grinnz preaction, technically the "terms as perl" is GPL 1+
18:48 Grinnz but yeah I would consider that whole dist gpl 3
18:48 Grinnz https://metacpan.org/source/BALLARD/WWW-LetsEncrypt-0.001/dist.ini#L3
18:57 mspo looking at that benchmark results site, I'd never heard of Ur
18:57 mspo mojo is doing okay but that latency number is pretty bad
18:58 jberger mspo: https://github.com/kraih/mojo/issues/925
18:59 mspo I almost had a job at peak hosting
18:59 jberger sounds like you wouldn't have had it anymore :-P
18:59 jberger if I understand correctly
18:59 mspo I knew the CTO
18:59 mspo but he quit shortly after asking me to interview
18:59 mspo which was odd
19:00 Grinnz heh
19:17 irqq joined #mojo
19:49 preaction well, they're going to fix that WWW::LetsEncrypt license, it's just going to be unusable for it... not as unusable as Affero, but still pretty unusable...
19:49 mspo ha
19:51 jberger a letsencrypt client isn't client facing, it almost doesn't matter what the license is
19:52 preaction but if i use it, and then upload my app to cpan, my app is now GPLv3
19:53 preaction affero would take effect if i even let someone use my app from the web. gplv3 requires me to distribute.
19:55 ribasushi in the interest of thoroughness: the applicability of copyleft to interpreted languages has never been tested in court
19:55 ribasushi it's tricky because you both distribute the source as part of the normal runtime lifecycle *and* the compilation happens on the end-user box, which clearly falls under the "linking exemption"
19:56 ichi joined #mojo
19:56 ribasushi for example it was never clear if ExtJs being GPL3 has a leg to charge for "commercial licenses"
19:56 preaction i was talking with some sencha lawyer about this. they seem to think it absolutely does, at least regarding javascript
19:56 ribasushi people keep paying them because it's easier than duking it out with a layer
19:56 preaction oh, heh, yeah, for that reason
19:59 ribasushi I did contact the gpl violation thing oh... 8 years ago about it
19:59 ribasushi they were (surprise) unwilling to issue a clarification
19:59 preaction they hold copyright, so they can relicense to whatever. that's my understanding of their business model at least
20:00 preaction that's why they had to stop relying on YUI
20:00 ribasushi no, I framed it in terms of "the GPL in this case is being stretched beyond its meaning, as an extortion tool"
20:01 ribasushi notably the FSF didn't come back with "we don't see a problem"
20:01 ribasushi but rather with a guarded "you have to talk to your legal council"
20:01 preaction heh. so basically "we aren't going to start this battle, but you're totally free to pony up for it"
20:01 ribasushi this.
20:03 jberger oh look OpenBSD dropping support for VAX https://twitter.com/phessler/status/707609007213699073
20:05 ribasushi :/
20:05 mishanti1 Oh wow.
20:05 mishanti1 That is pretty surprising.
20:05 vicash jberger: is there a module that does slurp of a file on a remote host. File::Remote vs File::Remote::Slurp ?
20:05 jberger vicash: not that I know of
20:06 jberger I'd probably look at using Path::Tiny and Object::Remote
20:08 vicash thanks. i am checking them out now.
20:09 jberger Object::Remote is the interesting bit
20:09 jberger and note that I have no idea about the modules you mention
20:09 jberger they might be just fine, but I haven't used them
20:10 preaction using ssh could also work
20:12 jberger Object::Remote uses ssh transport IIRC
20:12 Grinnz_ yeah, but ssh foo 'cat blah' is pretty straightforward
20:12 preaction right
20:13 jberger but where's the fun in that?
20:14 preaction the fun in a job done!
20:16 vicash yea i am using ssh directly for certain calls but to slurp a file i was looking at File::Slurp::Remote as an option since i don't have to reimplement functionality.
20:16 vicash Object::Remote is a huge install and memory hog.... has too many dependencies..
20:16 Grinnz_ there's no functionality. you'd do the slurping on the results of the ssh
20:17 Grinnz_ and hopefully not with anything related to File::Slurp
20:17 vicash yea.. that's what i am doing now
20:18 Grinnz_ i mean, you can even use `` to grab the output. but then you'd have to make sure your ssh args are shell quoted
20:19 vicash yes that's what i am doing. `ssh $host 'cat /proc/$PID/cmdline'`.
20:19 Grinnz_ doesn't look like reimplementing anything to me ;)
20:20 Adurah joined #mojo
20:20 Grinnz_ that file is likely to be ascii too, so you don't have to worry about the encoding
20:22 Grinnz_ i wouldn't name a variable $PID though. it's the english name for $$
20:24 vicash yes i have that as something else
20:29 s1037989 CandyAngel: Awesome on the IRC notification!  Can you share how you wired it up?
20:31 CandyAngel s1037989: it's really simple, but I'll throw up a gist of what I have if you like. It's not pluggable or anything though
20:32 s1037989 CandyAngel: That's cool, just something to start with...!
20:39 McA joined #mojo
20:40 orev what kinds of things cause a csrf token to become invalid?  I'm noticing it seems to become invalid often.  is it just when the app is restarted?  seems to do it a lot when running with morbo and making code changes
20:44 McA2 joined #mojo
20:50 patrickz joined #mojo
21:15 nehaljwani joined #mojo
21:16 nehaljwani How to return custom HTTP codes using mojolicoius? like, 201, or 303
21:17 Grinnz_ https://metacpan.org/pod/Mojolicious::Guides::Rendering#Status-code
21:17 nehaljwani Thanks
21:20 irqq_ joined #mojo
21:29 new_student When I do $c->ua->get(some-domain-which-does-not-exist) How and where is the error handled?
21:30 Grinnz_ https://metacpan.org/pod/Mojo::Transaction#error
21:30 Grinnz_ the beginning of the Mojo::UserAgent synopsis also shows it
21:31 irqq_ joined #mojo
21:31 new_student Got it.
21:31 stephan48 joined #mojo
21:32 new_student What if there is a call back supplied?
21:32 Grinnz_ you get the same $tx back in the callback
21:32 new_student okay
21:34 new_student Um... if I perform submit callback, it is async. So, it returns a tx and also passes it to the callback as an arg?
21:34 new_student s/perform//
21:34 new_student For async, where do I check for error?
21:35 Grinnz_ the return value of the methods when used async is unspecified
21:35 Grinnz_ you only get $tx in the callback
21:35 Grinnz_ (that's the only place it's relevant, also)
21:35 new_student But, is the callback called, if the domain doesn't exist, or is not resolvable?
21:36 Grinnz_ try it?
21:36 new_student it didn't
21:36 new_student that's I am confused where to check for error in async
21:37 new_student oh wait, sub is called
21:37 new_student let me check again
21:37 new_student got it. thanks
21:37 Grinnz_ $ perl -MMojo::UserAgent -E'my $ua = Mojo::UserAgent->new; $ua->get("http://example.co", sub { my ($ua, $tx) = @_; say $tx->error->{message} }); Mojo::IOLoop->start'
21:38 orev is there a way to continue long lines over multiple lines in a template?  using %= or <%=
21:39 orev like with form_for
21:40 jberger orev: <%= %> can span lines
21:42 orev jberger: this gives an error: http://fpaste.org/336466/59735145/
21:42 orev also if I try to use \
21:44 jberger well its possible that I could be wrong, I've not done that in a while
21:45 jberger I KNOW (or at least am 90% sure) that <% %> can span lines
21:45 jberger try with MOJO_TEMPLATE_DEBUG=1
21:45 jberger see what it is generating
21:46 orev maybe the <% can for multiple statements, but still 1 statement per line
21:47 preaction i'm building a multi-line hash with <% ... %>, so it's not that
21:48 orev maybe tag helper issue then
21:50 preaction orev: what error are you getting?
21:51 orev preaction: qq/Bareword "begin" not allowed/  though if I put the closing %> on the same line as begin it works
21:52 preaction right, because begin/end is kind of special
21:52 CandyAngel s1037989: You around?
21:53 new_student I am using Mojolious::Lite. What is the easiest way to add a custom sub to the event loop ?
21:54 pink_mist Mojo::IOLoop->recurring()?
21:54 Grinnz_ what the heck does "add a custom sub to the event loop" mean?
21:54 orev say what you want to do, not how you want to do it
21:56 new_student I want to run a while loop, which keeps polling redis every 0.1 second to update a global hash inside the mojolicious app
21:56 Grinnz_ then yes, recurring timer
21:56 Grinnz_ remove the words "while loop" from your thought process
21:57 new_student okay :)
21:57 pink_mist isn't redis meant to be able to notify you itself?
21:58 Grinnz_ yes, pubsub over redis is usually a better idea than polling
21:58 Grinnz_ http://redis.io/topics/pubsub
21:59 Grinnz_ even if it's just a message "the hash data is ready in redis"
22:02 cpan_mojo App-txtnix-0.07 by MDOM https://metacpan.org/release/MDOM/App-txtnix-0.07
22:02 new_student ah, this is nice.
22:06 bradjm joined #mojo
22:13 marty joined #mojo
22:31 marty joined #mojo
22:52 rwp joined #mojo
22:55 rwp left #mojo
23:30 cpan_mojo Test-Mojo-More-0.06 by COOLMEN https://metacpan.org/release/COOLMEN/Test-Mojo-More-0.06
23:58 esh_ joined #mojo

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