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

IRC log for #mojo, 2017-01-25

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

All times shown according to UTC.

Time Nick Message
00:02 cpan_mojo Mojolicious-Plugin-Renderer-WithoutCache-0.02 by SIMBABQUE https://metacpan.org/release/SIMBABQUE/Mojolicious-Plugin-Renderer-WithoutCache-0.02
00:20 kiwiroy joined #mojo
00:27 sugar joined #mojo
01:11 kiwiroy joined #mojo
01:18 tchaves joined #mojo
01:19 howitdo joined #mojo
01:32 nicomen joined #mojo
01:43 sugar joined #mojo
01:59 ferreira joined #mojo
01:59 marty joined #mojo
02:39 hernan604 is $tx->on(connection => sub { (connection event) expected to work on WS action ?
02:39 hernan604 message works, finish works, but connection doesnt seems to ? or im doing it wrong ? :)
02:39 purl Sorry, I've never seen works, before.
03:30 jberger hernan604 connection is very early
03:30 hernan604 how can i know a websocket connected ?
03:30 jberger And even then it is probably on the handshake transaction
03:31 hernan604 right
03:31 jberger As a user agent or a server?
03:31 hernan604 server
03:31 jberger Well, you got a request in
03:31 jberger So it connected
03:32 hernan604 right, i thought it inherits all events from Mojo::Transaction as says in http://mojolicious.org/perldoc/Mojo/Transaction/WebSocket#EVENTS
03:32 jberger You can check tx->is_websocket if you are worried about GET requests being in the same handler
03:32 hernan604 ok
03:32 jberger Yes, but it is already connected by the time you access it
03:32 hernan604 oh i see
03:33 jberger You'd need to hook in to the early action of the server to see the connection event
03:33 hernan604 or i could use some mesage event
03:33 jberger What are you worried about?
03:34 hernan604 i will build a hash of connected clients
03:34 jberger What are you trying to guard against?
03:34 hernan604 so i thought, let me handle connection event and resolve the client_id and make this hash
03:34 hernan604 but i can use the on message also
03:34 hernan604 i just thought i could use the connection event
03:34 jberger I mean, the route handler is basically the connection event for what that's worth
03:35 hernan604 then im trying connection in the wrong place
03:35 hernan604 okei jberger =)
03:35 hernan604 thanks again
03:36 jberger What is the end goal? A chat app (or done other relay bus)?
03:36 jberger s/done/some/
03:37 jberger If it's a chat app, then do this once to learn, but there are lots of better ways
03:38 hernan604 its a notifier thing
03:38 jberger Look at Mercury by preaction
03:38 hernan604 ok!
03:39 hernan604 looking on it =)
03:39 hernan604 thats a big mafia... preaction ops in perl, js, css, font, back
03:41 jberger Yep
03:41 jberger Also cpantesters
03:41 jberger And host of chicago.pm
03:41 jberger Pretty cool guy
03:41 hernan604 haha =)
03:42 hernan604 perl mafia
03:42 purl perl mafia? what perl mafia? if ya knows what's good fer ya you'll shaddap and fuhgeddaboutit
03:42 * jberger hugs purl
03:42 * purl nibbles jberger's elbow
03:42 jberger What, I don't even get pushed around?
03:42 * jberger pats purl
03:42 purl don't mess with me
03:47 noganex_ joined #mojo
04:32 inokenty-w joined #mojo
04:49 prajith joined #mojo
04:54 kiwiroy joined #mojo
05:04 dboehmer joined #mojo
05:08 preaction i mean, i'm not ops in ##javascript on freenode, nor in #perl on freenode, though i may at times attempt to deal with rabble-rousers and malcontents and altogether attempt to maintain a friendlier, more-welcoming, diverse, and healthier community...
05:09 kiwiroy joined #mojo
05:27 Grinnz how dare you!
05:44 jabberwok joined #mojo
05:58 Petru joined #mojo
06:01 disputin joined #mojo
06:08 kiwiroy joined #mojo
06:31 disputin joined #mojo
06:54 dod joined #mojo
07:00 dod joined #mojo
07:02 kiwiroy joined #mojo
07:26 Jonis joined #mojo
08:07 AndrewIsh joined #mojo
08:21 trone joined #mojo
08:29 rshadow joined #mojo
08:35 rshadow joined #mojo
09:02 simbabque joined #mojo
09:03 cpan_mojo Mojolicious-Plugin-Renderer-WithoutCache-0.03 by SIMBABQUE https://metacpan.org/release/SIMBABQUE/Mojolicious-Plugin-Renderer-WithoutCache-0.03
09:07 coolo I like that name!
09:23 sugar joined #mojo
09:27 Petru joined #mojo
09:28 celticman joined #mojo
09:55 AndrewIsh hey all. does anyone know if there's a way of forcing assetpack to rebuild all it's assets? it's serving an old version of an asset despite it having changed and me restarting mojo
09:58 ashimema batman ^
09:59 batman AndrewIsh: delete assets/cache/whatever
09:59 AndrewIsh batman:  ah, ok, thanks :)
10:00 ashimema thanks batman
10:01 batman AndrewIsh: it's really weird. I've experienced the same thing myself, but i have no idea how it happens :(
10:01 batman the thing is that the checksum in assetpack.db should tell assetpack to recalculate the asset, but for some reason it sometimes fail to understand that it has to recalculate
10:02 batman you can open an issue on github if you like, but i don't know how to reproduce it
10:02 AndrewIsh batman:  this is the first time i've encountered it, it usually just seems to recognise the need to rebuild
10:03 AndrewIsh batman:  i've no idea how to reliably replicate it either, not sure how much use an issue would be other than to say "it's a problem" :)
10:03 batman yeah, i never experience when i'm working by myself, but a colleague sometimes experience it after pulling in new changes using git
10:04 batman yeah, exactly... the github issue would be more for people to maybe contribute if they experience the same problem
10:04 AndrewIsh mmm, good point. ok, i'll create one now
11:03 htoetl joined #mojo
11:03 htoetl hello, i'm new to mojo and i've a couple of a very dumb questions. if you are nervous, please ignore me :).
11:04 htoetl ->finish on websocket doesn't guarantee finishing sending everything in the queue on that socket?
11:13 ashimema you only use part of the checksum don't you batman.. the first 10 characters?  I wonder if your managing to get overlaps in those 10 chars.. doubtful to be honest.. I don't understand the checksum algorithm well enough to base that on anything
11:18 batman ashimema: i'm pretty sure that's not it.
11:18 batman but it's an interesting theory
11:19 batman would require *us* to be incredible unlucky for that to happen
11:20 stephan48 if you say git... you probably have all files versioned which you run throu assetpack?
11:21 stephan48 if yes, you can find out pretty easily by using the same checksum algorithm on the files in the respective git revisions
11:26 ashimema yeah.. it does need us to be incredibly unlucky to get a conflict.. hence it being an out there idea ;)
11:38 batman stephan48: not at work, since we don't track the output files in git
11:53 tchaves joined #mojo
12:12 bpmedley http://24.72.144.208:3000/minion_ui <-- First try at responsive layout.  Should work on mobile, desktop, and kinda tablet..
12:17 tchaves joined #mojo
12:24 Petru joined #mojo
12:25 sugar joined #mojo
12:38 blonewolfs joined #mojo
13:16 aborazmeh joined #mojo
13:33 janl joined #mojo
13:34 sugar joined #mojo
13:51 Petru joined #mojo
14:00 perlpilot joined #mojo
14:11 jabberwok joined #mojo
14:14 Pyritic joined #mojo
14:18 sugar joined #mojo
14:19 gryphon joined #mojo
14:44 dikim joined #mojo
14:52 trone joined #mojo
14:58 marty_ joined #mojo
15:11 zivester joined #mojo
15:27 sugar joined #mojo
15:30 kes joined #mojo
15:30 kes What will be happen if finish will not be called?
15:30 kes http://mojolicious.org/perldoc/Mojo/Pg/Results#hash
15:37 sh14 joined #mojo
15:49 Dandre1 joined #mojo
16:26 disputin joined #mojo
16:29 cpan_mojo Mojolicious-Plugin-OpenAPI-1.08 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-OpenAPI-1.08
16:34 sri regarding better REST client support in mojo, i suppose we could make mock testing easier too
16:35 sri you know, automating the whole setting up a mock app and server
16:36 vicash is there a Mojo plugin or sample implementation for implementing an OAuth2 server ? or is it better to just wrap something like Net::OAuth2
16:36 sri that dance https://github.com/openSUSE/build-check-statistics/blob/master/t/basics.t#L30-L83
16:37 sri i'm sure we could make that easier
16:37 sri and also mocking with query parameters
16:38 sri stumbled over this in some SUSE code, and it's pretty damn convenient https://github.com/openSUSE/osc-plugin-factory/blob/master/tests/maintenance_tests.py#L283
16:38 pink_mist vicash: did you search metacpan for mojolicious oauth2 plugins?
16:38 pink_mist vicash: if you didn't, please do so
16:38 vicash pink_mist: thanks
16:38 sri right now we mock with a real mojo app, that matches with routes, so you have to handle query params manually
16:39 sri i know some folks wanted query param matching in routes, this is a very valid use case
16:47 sri i can imagine a param matcher constraint for example
16:48 sri get '/foo/api/v1/lalala' => (params => {test => qr/\d+/, bar => ['a', 'b', 'c'], baz => 'yada'})
16:51 sri that and a setting in Mojo::UserAgent to replace a certain host with the local test server would cover most of what i need
16:52 sri perhaps not even that
16:52 sri a better idiom fo rthis though https://github.com/openSUSE/build-check-statistics/blob/master/t/basics.t#L75-L79
16:57 sri my $daemon = Mojo::Server::Daemon->new(app => app); my $port = $daemon->start_local_test;
16:57 sri like that
16:58 sri sets $daemon->listen(['http://127.0.0.1']) and returns the automatically assigned port
16:59 Grinnz jberger: https://twitter.com/realDonaldTrump/status/824080766288228352?ref_src=twsrc%5Etfw
16:59 sri we do have "Mojo::IOLoop->acceptor($daemon->acceptors->[0])->port" 8 times in core tests
17:00 sri so there is a core use case
17:01 sri jberger: he saw your tweets and is coming for you now!
17:02 jberger yeah, I saw
17:02 sri he already got the national park service folks tweeting about climate change
17:02 jberger he's gonna have to make a hard case about needing martial law where I'm at
17:02 jberger but then again, this is how things work with fascists
17:03 jberger sri: the official NPS accounts deleted their climate change stuff
17:03 jberger then the unofficial ones popped up
17:03 jberger seriously, this scares me
17:03 jberger GOP is supposed to be the party that "loves freedom"
17:03 jberger but yeah
17:03 jberger I'm off topic
17:04 sri today is his big national security day, i expect things to get much worse very quickly
17:04 andy_ joined #mojo
17:05 jberger I've actually conciously tried not to look at twitter today
17:05 jberger I want to know what's going on, but it ends up just putting me into an unproductive state
17:06 * jberger tempts fate
17:07 sri suddenly i have the urge to listen to the suckerpunch soundtrack again
17:08 sri fits the political climate very well
17:08 kiwiroy joined #mojo
17:09 sri (bad movie, awesome soundtrack)
17:15 vicash bpmedley: love the new UI... works really nicely on an iPhone 6s+ and Firefox on the desktop but the mobile UI i like a lot
17:15 bpmedley vicash : Thanks!  Should be a straight git pull for any updates on local installs..
17:16 vicash bpmedley: does it need the telerik dependency to be used for a local install?
17:17 bpmedley vicash : Yes, for the drawer and a few other things..
17:17 bpmedley Although, that's the free version of telerik..
17:19 vicash bpmedley: would it be too difficult to replace that with say Bootstrap ? the fact is that users might want to add their own skins if they would like to merge this into their existing mojo apps for uniformity of look-and-feel.
17:20 sugar joined #mojo
17:21 vicash actually it may not matter to me personally anyway... this is great.
17:21 bpmedley vicash : The Telerik dependency is replaceable; however, Bootstrap (layout), Vue (mvvm), and jQuery (data management) would be needed for replacing..
17:21 Petru joined #mojo
17:21 jnbek joined #mojo
17:29 Pyritic joined #mojo
17:45 polettix joined #mojo
17:53 sri jberger: your park services folks are awesome
17:54 sri https://twitter.com/RedwoodNPS/status/824311863362011136
17:55 lluad joined #mojo
17:58 sri https://twitter.com/DeathValleyNPS/status/824273025285705730
17:58 sri more are coming out of the woodwork (pun intended!)
18:01 pink_mist more are coming out of the woodwork (pun indented!)
18:02 sri http://i.imgur.com/snLplqq.jpg
18:04 jberger yeah, on-the-ground public servants really care about stuff
18:04 jberger I'm pretty proud of them right now
18:04 jberger I know I've tweeted a lot and maybe people didn't see this one
18:04 jberger https://twitter.com/joelaberger/status/823956037044674560
18:06 pink_mist sri: no no, I indented it .. it's different :3
18:06 pink_mist a whole four spaces!
18:13 mishanti1 I have some relatives who're traveling to the US in a weeks time. If anyone of you americans feel a need to be smuggled out we can probably talk business. :p
18:13 mishanti1 Or if you need care-packages sent in.
18:13 mishanti1 That can also be arranged.
18:13 tchaves joined #mojo
18:16 dod joined #mojo
18:25 Petru joined #mojo
18:36 PryMar56 joined #mojo
18:42 sri i think this change would make sense https://gist.github.com/anonymous/12e3354d66889202377e42280c82cec3
18:42 sri just unfortunate that the method can't be a one-liner
18:43 Petru joined #mojo
18:47 jberger I like that change
18:56 sri not sure if in the one-liner case the magical form of map is ok
18:56 sri sub ports { [map $_[0]->ioloop->acceptor($_)->port, @{$_[0]->acceptors}] }
18:58 sri we actually have more such cases
19:01 rshadow joined #mojo
19:08 tchaves joined #mojo
19:09 rshadow joined #mojo
19:23 sugar joined #mojo
19:24 dod joined #mojo
19:26 oalders joined #mojo
19:27 jberger I find the map EXPR form to be really hard to read
19:27 jberger resorting to that just to save a few characters and thus save a few lines seems to be taking the golf thing a bit too far
19:28 jberger that said, that's only really true if you agree with me on map EXPR
19:28 sri generally i agree
19:28 sri it's just one-liners
19:30 haarg i tend towards the EXPR form as a micro-optimization
19:30 htoetl hello, i'm new to mojo and i've a couple of a very dumb questions. if you are nervous, please ignore me :). question: ->finish on websocket doesn't guarantee finishing sending everything in the queue on that socket?
19:31 haarg which is rather silly, and it's certainly a wart in the language
19:31 jberger htoetl: as I told you the other day, if you only call it in the callback of the previous write it will work in order
19:32 jberger $c->send($data => sub { $c->finish() });
19:32 htoetl is it just me believing it's counter-intuitive?
19:33 jberger in nonblocking programming (which websockets necessarily must be) then you read that as "first do this send, then do this sub { ... }"
19:33 htoetl another question then. a bunch of ->send will be sent in a random order?
19:33 jberger once that sinks into your knowledge it will not seem counter intuitive
19:33 sri haarg: yea, the fact that EXPR can be an optimization pains me too, it just doesn't fit into the language
19:33 htoetl non-blocking doesn't have to mean no queues :)
19:34 sri htoetl: the docs say ->finish closes the connection gracefully
19:34 htoetl yes, i know
19:34 htoetl i believed it would first finish sending
19:34 sri gracefully means it waits for stuff to be written
19:34 htoetl i thought so too
19:34 sri before actually closing
19:34 htoetl but then it seemed to be otherwise
19:35 jberger before taking this conversation too far, I'm going to ask to see the code
19:35 sri and by wait, i mean it only sets a flag that will trigger a close later on in the event loop
19:35 jberger because last time there were some problems that we couldn't have understood about your code from talking about it in the abstract
19:35 htoetl jberger: please ignore me :)
19:35 sri ye, code or get out
19:36 jberger I don't think "or get out" is needed
19:36 jberger but other people's time is valuable
19:36 jberger and working in nonblocking is difficult at first
19:36 htoetl well, i didnt do a test case for that, so i don't have a small piece of code
19:36 jberger indeed even talking about it is
19:36 jberger htoetl: if you didn't do a test case, how do you know it doesn't work
19:36 htoetl i just changed it into the form alike to that mentioned by jberger
19:37 htoetl and it then worked
19:37 sri imagine i said that sarcastically
19:37 jberger I know
19:37 htoetl otherwise when i was calling ->finish after ->send i saw in browser consol "data frame received after closing" and the thing didn't work.
19:37 jberger but I'm going to guess english isn't htoetl's first language
19:37 htoetl so i decided to ask, because it could be something obvious due to my misunderstanding
19:38 htoetl well, there is not much to guess, considering my english sucks ).
19:38 sri there's also the russian smiley
19:38 jberger that's what tipped me too :D
19:38 sri :D
19:39 * htoetl shrugs
19:39 jberger actually, htoetl, you're english is better than some we get in here, I haven't had a problem undestanding you
19:39 htoetl i wasn't hiding that kinda
19:39 Grinnz jberger: your* :P
19:39 jberger HAHAHAH
19:39 jberger Freudian
19:39 htoetl but thinking about your replies
19:39 htoetl is it just me or you 2 just contradicted?
19:39 jberger I was going to say "you're doing fine" then changed my mind
19:40 sri Grinnz: your being pedantic
19:40 htoetl jberger said it should be tied to send, and sri said it's gracefully sends everything
19:40 jberger htoetl: the question is still about your code from yesterday?
19:40 htoetl no
19:40 jberger then I can't answer
19:41 htoetl ok
19:41 jberger your code from the other day didn't start sending
19:41 jberger so graceful stop didn't apply
19:41 htoetl the yesterday's question was resolved yesterday :)
19:43 tchaves joined #mojo
19:43 good_news_everyon joined #mojo
19:43 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vMp2v
19:43 good_news_everyon mojo/master fece5de Sebastian Riedel: add ports method to Mojo::Server::Daemon
19:43 good_news_everyon left #mojo
19:44 kgoess joined #mojo
19:45 kgoess does Test::Mojo fork a webserver, or does run the user-agent and server all in-process?
19:46 Grinnz in-process
19:46 kgoess that's what I thought, thanks
19:46 Grinnz otherwise it wouldn't work very well on windows
19:47 kgoess no doubt, I'm just trying to track down a "Can't connect: No address associated with hostname" error in my first test
19:48 Grinnz maybe it's trying to connect to a URL instead of an application?
19:48 Grinnz i don't remember all the logic that goes into that
19:49 jberger the test server only responds to relative urls, not absolute
19:50 bwf joined #mojo
19:52 kgoess hah, yep, I needed a leading "/" in the test url, thanks
19:53 jberger ah, yeah, that too :-P
20:03 sri File::Path::remove_tree is another candidate for Mojo::File
20:03 sri not currently used in mojo core, but i do use it a lot
20:07 jacobydave joined #mojo
20:08 sri any more votes for https://github.com/kraih/mojo/issues/1042?
20:08 sri jberger: ?
20:09 sri marcus, batman: ?
20:09 jberger does Path::Tiny::spurt accept @lines? I don't have a strong opinion but I'd guess I'd follow Path::Tiny where there is doubt
20:09 sri it does
20:09 sri and it calls it ::spew :)
20:09 jberger then I mildly favor accepting @lines too
20:10 jberger I don't care what the name is, we aren't trying to be api compatible
20:10 jberger I'm just saying that there is a documented example of and api providing that interface, presumably because it is useful in places
20:10 jberger s/and/an/
20:13 polettix joined #mojo
20:13 stryx` joined #mojo
20:14 Pyritic joined #mojo
20:15 haarg it also fits with the api of print
20:19 celticman joined #mojo
20:22 good_news_everyon joined #mojo
20:22 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vMpKj
20:22 good_news_everyon mojo/master bed4003 Sebastian Riedel: add a few new features to Mojo::File
20:22 good_news_everyon left #mojo
20:23 pink_mist sri++
20:23 jberger sri++
20:33 Petru joined #mojo
21:02 Petru joined #mojo
21:21 iamb joined #mojo
21:23 sri jberger: btw. do we need more stickers?
21:24 jberger we have lots
21:24 jberger I need to get them out to more people to distribute
21:24 jberger I sent a few hundred to england
21:24 jberger but most are still in my office
21:24 Ryoga joined #mojo
21:25 sri ah :)
21:25 jberger I'll give some away at YAPC::NA no doubt
21:25 sri really too bad we couldn't take up the offer for usb sticks
21:25 jberger I'll also replenish mdk there too assuming he gives some away between now and then
21:27 perlpilot jberger: you mean TPC::NA?  ;)
21:42 cpan_mojo Mojolicious-Plugin-AssetPack-1.39 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-1.39
21:46 jberger perlpilot: I will probably never say that correctly now :s
21:46 jberger not that I don't want to, habit and all that
21:46 disputin joined #mojo
21:53 Ryoga joined #mojo
22:00 kiwiroy joined #mojo
22:08 sivoais joined #mojo
22:16 sri Path::Tiny::touch is an interesting idea
22:17 sri think touch and open methods are two candidates for future addition
22:18 sri my $handle = path('/foo/bar.txt')->open('<');
22:18 sri say path('/foo/bar.txt')->touch->slurp;
22:20 sri good thing about ->open would be that it throws on error
22:22 disputin joined #mojo
22:23 sri well, not now :)
22:23 sri gotta leave some stuff for later
22:30 sri btw. i'm still very interested in ideas for making Mojo::UserAgent better for dealing with REST APIs
23:02 kiwiroy joined #mojo
23:06 jabberwok left #mojo
23:07 gizmomathboy joined #mojo
23:09 Ryoga joined #mojo
23:10 good_news_everyon joined #mojo
23:10 good_news_everyon [mojo] kraih tagged v7.22 at f2abe98: https://git.io/vMhJb
23:10 good_news_everyon left #mojo
23:10 good_news_everyon joined #mojo
23:10 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vMhJN
23:10 good_news_everyon mojo/master a1c045a Sebastian Riedel: bump version
23:10 good_news_everyon left #mojo
23:11 sugar joined #mojo
23:16 disputin joined #mojo
23:33 batman joined #mojo
23:33 disputin joined #mojo
23:46 lluad_ joined #mojo
23:54 gizmomathboy joined #mojo

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