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

IRC log for #mojo, 2017-01-17

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

All times shown according to UTC.

Time Nick Message
00:19 c0xc joined #mojo
00:41 aborazmeh joined #mojo
00:55 sugar joined #mojo
01:46 zach so, I got my password hashing to work, but when I'm in a controller and tell it to render, it does a post, shouldn't it be doing a get? The case for the moment is, show something about 'incorrect username and/or password' if not defined $hash or if $hash ne $pass
01:46 zach also, it continues in the sub after the render, i thought the render exited the sub
01:47 pink_mist uhm, the user agent does a post or get request ... your controller *handles* them
01:47 pink_mist and no, 'return' is the keyword that stops executing a sub
01:47 pink_mist render calls the render method, and then continues
01:48 yesbookit joined #mojo
01:48 yesbookit left #mojo
01:48 pink_mist this is basic perl, zach
01:48 zach ah, so i do a return $self-render
01:48 zach i get it
03:28 oalders joined #mojo
03:41 zivester joined #mojo
03:55 noganex_ joined #mojo
05:04 dboehmer joined #mojo
05:06 prajith joined #mojo
05:13 cpan_mojo Mojo-SQLite-1.004 by DBOOK https://metacpan.org/release/DBOOK/Mojo-SQLite-1.004
05:42 inokenty-w joined #mojo
06:16 prajith joined #mojo
07:13 dod joined #mojo
07:19 dod joined #mojo
07:59 prajith joined #mojo
08:09 janl joined #mojo
08:15 dotan_convos joined #mojo
08:18 trone joined #mojo
08:22 rshadow joined #mojo
08:29 rshadow joined #mojo
08:43 sugar joined #mojo
08:57 rshadow joined #mojo
09:17 dod joined #mojo
09:20 Petru joined #mojo
09:36 Lee joined #mojo
09:38 dod joined #mojo
10:03 a6502 joined #mojo
10:21 Petru joined #mojo
10:21 Lee joined #mojo
10:51 marty_ joined #mojo
10:57 Lee joined #mojo
11:21 tchaves joined #mojo
11:24 tchaves joined #mojo
12:20 Petru joined #mojo
12:26 ashimema_ joined #mojo
12:45 Petru joined #mojo
13:06 sugar joined #mojo
13:20 nic jberger: I came upon a websocket chat ex (in a gist of yours) and I can't get my head around it
13:21 nic https://gist.github.com/jberger/4702783#file-mojo_chat-pl-L53-L56
13:21 nic how do you know the 'finish' event is specific to that user?
13:21 nic I could be misreading it or there's some magic I'm not seeing
13:22 nic It registers a callback to unsubscribe this user upon receipt of a 'finish' event, that's clear.
13:23 nic But how does it know it has received the 'right' finish event?
13:23 nic My novice head is thinking that as soon as a finish event comes along, all users get unsubscribed
13:24 nic understanding that would be a step forward in my understanding of websockets
13:31 Petru joined #mojo
13:32 sugar joined #mojo
13:33 jberger nic the finish event in the controller is bound to the transaction
13:34 jberger But you are right to feel squeamish about that code
13:35 jberger Because the unsubscribe logic is always the hardest when it comes to message buses
13:36 jberger And actually, that is now one of the first things I consider when evaluating message bus libraries
13:36 jberger "How easy does it make the unsub call"
13:37 jberger Mojo::Pg is really easy, Mojo::Redis2 is harder
13:38 jberger Patty if that is that pg's blocking nature actually helps it, I've actually tried to improve the unsub in Mojo::Redis2 and I couldn't
13:49 tchaves joined #mojo
13:57 sword_smith joined #mojo
13:59 sugar joined #mojo
14:06 gryphon joined #mojo
14:08 gizmomathboy joined #mojo
14:16 nic jberger: When the 'finish' event arrives, what links it to the correct callback?
14:26 genio I can accept that it's bound to the transaction, but it does seem a bit magical
14:26 dikim joined #mojo
14:40 nic maybe it's "the transaction" that I'm not understanding
14:42 nic Is it that every ws event is linked (by id) to that ws connection, so that ws events can only trigger callbacks registered by the same connection?
15:05 jberger yes, each transaction (from the HTTP sense of the word) is an individual unit and events on that transaction or its related controller (there is exactly one controller per transaction and mostly the same vise versa) are bound only to it
15:05 jberger genio: how is that magical?
15:06 jberger "when the transaction ends, do these other things"
15:06 jberger $c->on(finish => sub { shift->app->log("this transaction is finished") });
15:07 jberger that would be pretty useless if it fired any time any transaction finished right (maybe assume there is some application-specific unique id embedded in the string to make that even more clear)
15:08 nic I think I get it now, thanks
15:09 nic probably the biggest gap in my understanding was not thinking of all the interactions as one transaction
15:12 jberger a websocket is just one long "transaction"
15:12 jberger that statement is both more and less true than it sounds
15:19 nic To be able to send, you're storing instances of the controller, so I guess we need to keep mindful that those objects aren't overly big
15:38 jberger nic: btw, that example is for a non-forking server
15:39 jberger you can only use that with daemon/morbo and not with prefork/hypnotoad
15:39 jberger because yes, that one does its magic by "crossing streams" of the controllers, which is kinda cheating
15:40 jberger and limits your load anywya
15:40 jberger anyway
15:40 jberger this is our canonical chat example now btw: https://github.com/kraih/mojo-pg/blob/master/examples/chat.pl
15:41 jberger it uses Mojo::Pg as a message broker
15:41 jberger it isn't as fully fleshed out as the other (older) example, but it is intentionally short
15:41 jberger effectively a golf
15:42 jberger and this is now my favorite form of it: https://gist.github.com/jberger/0963d5e31b8378030fde5827e386beac
15:42 jberger because it uses vue.js on the front-end to make it nicer (and that one actually takes it a bit further and adds a username)
15:46 AndrewIsh joined #mojo
15:46 hertzhaft joined #mojo
15:48 nic thanks jberger, I like the sound of the Vue version -- I'll take a look later
15:51 genio jberger: Yea, it's a lot less magic-y when you remember that it's a loooooong transaction.
15:53 AndrewIsh Hey all, I'm working on a simple PR for Mojolicious::Plugin::AssetPack and, given that I've not had much exposure to Mojolicious, I'm struggling to run tests.
15:53 AndrewIsh In my clone of my fork of MPA I'm running: prove -l -v t/mytestname.t
15:54 AndrewIsh But I'm getting back: "Can't locate Mojo/Base.pm"
15:54 AndrewIsh I'm assuming this is because I've only got a clone of MPA, does it need to be in the context of full Mojo before I can test it
15:54 genio do you have Mojolicious installed?
15:54 AndrewIsh Now that I say that, it's a rediculous question, of course I do!
15:54 genio In order to test the plugin, you must have mojo installed. :)
15:55 AndrewIsh genio:  Yep, as soon as I asked it, I thought "What a stupid question"!
15:55 AndrewIsh Sorry!
15:55 genio AndrewIsh: heh. sometimes you just need to type it out to see the problem.
15:55 AndrewIsh genio:  Very true. Thanks, sorry about that ;-)
16:02 zivester joined #mojo
16:10 Pyritic joined #mojo
16:13 stryx` joined #mojo
16:17 hertzhaft Hi! Mojo::File::make_path croaks when a directory path already exists, is that the intended behaivour?
16:17 Petru how can I access session(‘username’) inside the startup function of the web app $self->session(‘username’) does not work
16:18 hertzhaft File::Path::make_path just returns an empty array in that case
16:23 diegok Petru: session is something related to te current request (the cookie sent by the http client) so it makes no sense on the startup phase...
16:27 hertzhaft should I file a bug?
16:30 CHYC sudo -u www-data calibre-server --with-library=/data/owncloud/data/mert1415/files/Ebooks --daemonize --url-prefix=/calibre
16:31 CHYC Umm
16:31 CHYC That's not even in my clipboard. I have no idea what I just pressed.
16:33 CHYC Apologies for the noise.
16:48 sh14 joined #mojo
17:11 jabberwok joined #mojo
17:18 hertzhaft done: https://github.com/kraih/mojo/issues/1039
17:20 sri hertzhaft: your suggested behavior is a bit sketchy
17:21 sri we'd need a specific proposal with one or more variants to vote on
17:21 hertzhaft sri: you mean the last part :-) ok
17:22 hertzhaft will think about it
17:24 sri looks like make_path already dies on errors it considers fatal, so our croak is at least not needed
17:28 stryx` joined #mojo
17:28 disputin joined #mojo
17:28 good_news_everyon joined #mojo
17:28 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vMiGE
17:28 good_news_everyon mojo/master ea6c74d Sebastian Riedel: fix a bug in Mojo::File where the make_path method would die even if no error occurred (closes #1039)
17:28 good_news_everyon left #mojo
17:28 sri so, i consider that part a bug
17:32 sri and we still want to bring this back https://github.com/kraih/mojo/issues/1038
17:32 sri we just can't
17:32 sri yet
17:33 sri today i had to track down code that blocked the event loop, and i really don't like how hard that currently is
17:33 jberger I'm not sure what you could do about it though?
17:33 sri so, a reactor backend with diagnostics got bumped up on my todo list
17:34 jberger hmmm, I suppose that would help
17:34 Seth joined #mojo
17:34 sri it would store the callstack of every callback that got registered
17:34 sri and keep timing information
17:34 sri and then make stats
17:35 sugar joined #mojo
17:36 hertzhaft sri: thanks, that was quick, and probably more sensible than introducing new functionality
17:36 sri can't break the api outside of a major release
17:37 hertzhaft sir: understood
17:37 hertzhaft sorry, sri
17:37 disputin joined #mojo
17:38 sri nothing to be sorry for... i think
17:38 hertzhaft :-) only for swapping the r and the i
17:39 sri :O
17:39 hertzhaft yessri
17:43 hertzhaft I'm perfectly happy with the fix, so not going to make other proposals for make_path
18:01 lluad joined #mojo
18:18 lluad joined #mojo
18:23 dod joined #mojo
18:31 PryMar56 joined #mojo
18:33 dod joined #mojo
18:33 sri i can't believe how bad sherlock got in season 4
18:34 Grinnz there's a season 4??
18:34 sri episode 2 was pretty good, but 1 and 3... damn...
18:41 Petru joined #mojo
18:42 genio ah, I really liked that series.  to watch season 4 or not to watch
18:42 sri watch it for episode 2
18:42 sri and fast forward through the two other ones knowing they are terrible
18:48 rshadow joined #mojo
18:49 pink_mist I watched ep 1 of season 4, and that made me feel like not watching ep 2 ... but now I will
18:55 kaare joined #mojo
19:26 jberger hmmm, that's too bad
19:26 jberger I have liked several of those
19:26 nic this is the first series to get bad reviews.  i wonder what went wrong
19:26 jberger haven't seen season 4 yet though
19:26 jberger there were some duds earlier
19:27 genio Usually BBC shows are pretty darn good. What kills me is having to wait an unknown amount of time in between seasons. and odd numbers of shows per "season"
19:28 nic in season 3 each one was pretty much a film, so I think they were justified
19:28 nic anyone seen that film from last year with Cumberbatch as a superhero?
19:29 pink_mist dr strange? yes
19:29 pink_mist loved it
19:29 nic oh, while we're here, thanks to all who recommended Travelers -- enjoying that a lot, after ditching The AO
19:36 zivester joined #mojo
19:52 sri dr strange was pretty forgettable imo
19:53 * sri wants more deadpool and guardians of the galaxy
20:00 dod joined #mojo
20:16 * Grinnz is really liking the intertwined seasons of Arrow/Flash/Legends of Tomorrow
20:17 Grinnz you just gotta know what order to watch them in at a certain point, or it starts to get confusing
20:28 sri got too cheesy for me
20:28 jberger mmmmm cheese
20:28 sri i'd rather watch another season of jessica jones
20:40 Pyritic joined #mojo
20:47 pink_mist oh yeah, I should go watch jessica jones
20:48 genio I tried to watch the flash, but the second season just hit an all-time high for teenage angstiness that wasn't tolerable
20:48 martin joined #mojo
20:55 rshadow joined #mojo
21:03 sri genio: it only gets worse
21:04 rshadow joined #mojo
21:13 jabberwok this season's sherlock was a slow motion train wreck
21:38 stryx` joined #mojo
22:09 Janos joined #mojo
22:36 marty joined #mojo
22:44 lluad joined #mojo
22:45 disputin joined #mojo
23:00 marty_ joined #mojo
23:01 sugar joined #mojo
23:36 batman joined #mojo
23:38 tardisx joined #mojo

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