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

IRC log for #mojo, 2017-08-17

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

All times shown according to UTC.

Time Nick Message
01:30 gizmomathboy joined #mojo
02:02 noganex_ joined #mojo
02:17 itaipu joined #mojo
02:59 noganex joined #mojo
03:32 jasanj CandyAngel: not have a sollution yet
03:32 jasanj batman: https://github.com/jhthorsen/mojo-ioloop-readwritefork/issues/9
03:33 jasanj i have file a issue in github
04:07 perlpilot joined #mojo
04:44 crab joined #mojo
04:53 crab joined #mojo
05:11 q_gone joined #mojo
06:01 inokenty-w joined #mojo
06:45 marcus sri++
06:50 AndrewIsh joined #mojo
07:05 trone joined #mojo
07:28 trone_ joined #mojo
07:34 itaipu joined #mojo
07:46 Vandal joined #mojo
07:50 dod joined #mojo
07:50 cosimo joined #mojo
07:55 dod joined #mojo
08:07 rshadow joined #mojo
08:07 mermi joined #mojo
09:03 rshadow joined #mojo
09:23 ashimema jberger about..?  Wondering if you might spare a few minutes to continue helping me narrow down my Mojo::Pg/WebSockets problem?
09:23 ashimema 15:31 <jberger> the thing I'd check next is that pg isn't actually sending out the notification multiple times
09:23 ashimema I was hopeing for a hint on how I might actually rule that one out?
09:28 ashimema oh.. hang on.. there's also a minor modification to Mojo::Pg on this locally which I've been meaning to write a test for and submit.. might be worth clearing that up first.
09:28 petru joined #mojo
09:32 marcus ashimema: probably still very early in jberger's tz
09:32 ashimema ah, ok.. I'll try again this afternoon
09:32 ashimema thanks marcus
09:32 marcus np :)
09:33 sri who isn't awake at 4am :p
09:33 marcus sri: you just haven't gone to bed yet.
09:34 marcus sri: Do you prefer that roles have the Role:: prefix for cpan modules?
09:34 sri ever since i started using f.lux last year my sleep cycle has been normal \o/
09:34 marcus sri: Like Mojo::DOM::Role::PrettyPrinter
09:34 sri i do
09:34 marcus cool beans
09:36 sri i'll upload a new mojo release in an hour if there are no objections
09:36 marcus I'm all for it, 7.42
09:37 marcus batman is probably for and anyways likely too hungover to object :p
09:58 tinita joined #mojo
10:00 tinita joined #mojo
10:03 rshadow joined #mojo
10:28 pirateFinn joined #mojo
10:48 petru joined #mojo
11:16 good_news_everyon joined #mojo
11:16 good_news_everyon [mojo] kraih pushed 2 new commits to master: https://git.io/v7xGd
11:16 good_news_everyon mojo/master 8c7c1df Sebastian Riedel: more consistent example
11:16 good_news_everyon mojo/master 96a9fb1 Sebastian Riedel: bump version
11:16 good_news_everyon left #mojo
11:36 ilbot2 joined #mojo
11:36 Topic for #mojo is now � nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
11:58 ilbot2 joined #mojo
11:58 Topic for #mojo is now � nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
12:11 sri marcus: your synopsis is wrong https://metacpan.org/pod/release/MRAMBERG/Mojo-DOM-Role-PrettyPrinter-0.01/lib/Mojo/DOM/Role/PrettyPrinter.pm#SYNOPSIS
12:11 sri +Role::
12:11 sri you don't mention the Role::
12:11 marcus sri: damn, thanks
12:11 marcus I'm using it correctly in the tests :)
12:11 sri actually, your whole pod is messed up
12:13 marcus lacking a = in front of METHODS
12:13 sri Mojolicious should also be a dependency
12:14 sri otherwise i really like it, good example for what role extensions should be
12:14 sri marcus++
12:14 sri Akron++
12:15 sri marcus: there's a "use Mojo::UserAgent;" that does nothing too
12:16 sri the loy specific code doesn't seem very useful either
12:23 marcus sri: Agree, that can go :)
12:32 zerah joined #mojo
12:37 marcus pushed 0.02 btw
12:39 * ashimema wonders about creating Mojo::JSON::Pointer::Role::Patch to allow application of json patches to data structures.. would be trivial to convert my current code
12:46 PryMar56 joined #mojo
12:56 PryMar56 joined #mojo
12:58 ChmEarl joined #mojo
13:12 jberger marcus++
13:13 jberger ashimema I've thought about that too. How do you deal with the ambiguity of new data structures? Just prohibit creating new levels (ie no autoviv)?
13:17 itaipu joined #mojo
13:21 marcus Kinda wish we could apply roles to objects for cases like ashimema mentions. like $tx->res->json->with_roles('+Patch')->patch(...)
13:22 sri $tx->res->json is not even an object
13:22 marcus sri: json('/pointer')
13:22 marcus hmm, I guess that doesn't return a object either.
13:23 marcus sri: applies to ->dom tho
13:26 sri marcus: make a proposal
13:27 Kundun joined #mojo
13:27 marcus sri: https://irclog.perlgeek.de/mojo/2017-08-08#i_14984167 seems like it would work.
13:27 sri of course it works
13:27 sri it's a documentation problem
13:27 sri needs a clean explanation
13:28 sri the code is trivial
13:28 marcus ok, will spend time on it this evening then.
13:28 marcus now I have to do what my employer pays me for :)
13:28 sri drinking coffee? :p
13:29 marcus making mojo roles .
13:29 marcus I actually applied my PrettyPrinter role to work code already ;)
13:29 marcus so we could get rid of XML::Twig
13:31 dboehmer joined #mojo
13:31 sri heck, i'd write the code if anyone can come up with a good explanation for the docs
13:32 nicomen introducing me to fish shell ;D
13:32 * sri reverted to bash
13:32 sri (from zsh)
13:33 marcus I'm still on zsh. The autocomplete on fish is pretty rad tho
13:33 marcus as you type
13:33 marcus but I don't have time to convert my dotfiles setup.
13:34 sri i'd rather spend more time ti get better at bash scripting than learn more shell dialects
13:41 gizmomathboy joined #mojo
13:43 marcus I almost never do shell scripting, since I know how to script in Perl. :)
13:46 ashimema did you see my github link on #swagger jberger.. egarding json-aptch
13:46 ashimema json-patch even..
13:46 ashimema the rfc deals with that ambiguety for us I believe..
13:48 ashimema also.. if your about jberger ;)
14:01 vicash joined #mojo
14:03 gryphon joined #mojo
14:04 jberger ashimema: oh, no I hadn't
14:04 jberger neat
14:05 ashimema needs work on the api.. and some of the more advanced tests fail still..
14:05 ashimema so needs a little polish
14:05 ashimema but it's not bad for a quick hack ;)
14:06 ashimema would appreciate some shepherding on it if you think anyone would be interested in it..
14:12 jberger I may end up investigating json patch for some stuff at work
14:12 jberger most times I think I've wanted it, I really have needed a way to generate the patch rather than just apply it
14:12 jberger but coming up I may have a reason to be sending updates for known deltas
14:13 ashimema yeah.. I've not dug into the creating patches end of that problem myself yet
14:13 ashimema all our patches are created clientside so I just need to apply them serverside at present
14:13 ashimema would be nice to do both.. though again i have no idea what I'd do for an api there ;)
14:15 jberger and actually, that's a good point, my case is the opposite :( I need a way to apply the patch in javascript
14:15 jberger which I'm sure exists, but isn't this
14:15 ashimema right.. so.. starting at the beginning for this socket/pg stuff
14:16 ashimema https://github.com/Starcounter-Jack/JSON-Patch/ is the best js json-patch implementation I've found to date.. very reliable
14:18 ashimema So.. I was finding that my Mojo::Pg::PubSub connection was going away at random.. so sometimes I was getting an error when calling notify on it
14:21 ashimema that's what that vuechat hack was about.. https://ssl.thorsen.pm/paste/f7f0b9d1c24f to try and demostrate how I'm using the components together.. i.e. notify is called i one controller whilst the listen is happening in another.
14:24 ashimema so.. I believed at the time that that was because as far as I can tell we weren't keeping the pg connection alive
14:24 ashimema have you ever experienced anything like tat?
14:24 ashimema have you ever experienced anything like that?
14:26 mib_kcn04m joined #mojo
14:26 ashimema which lead me to attempting this (with hints from sri) in my local Mojo::Pg https://github.com/kraih/mojo-pg/compare/master...mrenvoize:pubsub_keepalive
14:27 sri i almost forgot about that
14:28 sri been weeks since you said you wanted to look into it
14:28 gordonfish joined #mojo
14:30 ashimema children and school holiday season has lead to me having far too little time to dig into these proper.. so it's horribly spread out.. sorry
14:32 ashimema and I got gazumped when I went to write a test and found a test already existed which I'm pretty sure already tests exactly the symptom I thought I was getting :(
14:33 mib_kcn04m Hi Guys i'd like to get your help with the following code snippet, taken from Mojo::EventEmitter;
14:34 ashimema basically.. I find that if I start two sockets as different users, then disconnect one, the the pubsub connection goes away for the other one but isn't noticed until someone hits the controller that call the notify
14:34 mib_kcn04m sub on {   my ($self, $name, $cb) = @_;   my $tx = $self->tx || Carp::croak 'Connection already closed';   $self->rendered(101) if $tx->is_websocket && !$tx->established;   return $tx->on($name => sub { shift; $self->$cb(@_) }); }
14:34 jberger ashimema: btw, the "reveal begin/end *" comments are just for my presentation to split between slides
14:34 mib_kcn04m I don't understand why weaken is not used here
14:35 ashimema yeah.. thought they probably were.. but they didn't do any harm leaving them in ;)
14:35 jberger right, that's why I made the preprocessor look for comments :D
14:35 mib_kcn04m as $tx contains reference to $self and $self contains reference to $tx
14:35 gordonfish joined #mojo
14:36 jberger that can't be from Mojo::EventEmitter
14:37 jberger there are no transactions in EventEmitter
14:37 jberger that looks like Mojolicious::Controller
14:37 jberger and in that case, the reason you don't need it is that the transaction is weakened in the controller already
14:37 mib_kcn04m sure you are correct
14:38 mib_kcn04m it is on  Mojolicious::Controller
14:46 mib_kcn04m thanks for the answer
14:49 ashimema ack.. I can't distil this down.. do you guys understand the problem I'm having in the slightest..
14:52 sri ashimema: your patch is definitely wrong, you never clean up the recurring timer
14:53 ashimema mm, I was aware of that but hadn't yet worked out where to put the cleanup ;)
14:53 sri in reset
14:53 zivester joined #mojo
14:54 sri Mojo::IOLoop->remove(delete $self->{ping}) if $self->{ping};
14:54 sri doubt the whole thing is testable at all
14:54 sri outside of chat apps demonstrating the problem over minutes
14:55 sri if you can do that i'd be fine with a patch that doesn't contain tests though
14:58 ashimema don't these tests already effectively check for it: https://github.com/kraih/mojo-pg/blob/master/t/pubsub.t#L91-L126
14:59 ashimema by killing the connection from the pg end.. effectively behind Mojo::Pg's back?
15:00 dboehmer_ joined #mojo
15:00 ashimema I may be entirely misunderstanding pg_terminate_backend though..
15:00 sri don't have time to look into it
15:05 stomper I'm toying with Test::Mojo::Role::Selenium to test an external site. I notice once I use the `driver` (in this case Selenium::Chrome)  it tries to create a session.
15:06 stomper But the URL it is looking for is http://127.0.0.1 not the MOJO_SELENIUM_BASE_URL
15:08 stomper so I guess the question is, Can I override that behaviour?
15:21 PopeFelix joined #mojo
15:22 ashimema so.. I'm pretty confident now that it's my Mojo::Pg::PubSub patch that leads to the multiple firings of the listen callbacks.. but without that patch I consistently have the pg connection drop silently between each new websocket connection coming up.. which leads to calls to notify failing with connection lost.
15:24 dboehmer joined #mojo
15:29 dboehmer_ joined #mojo
15:34 dboehmer joined #mojo
15:56 rshadow joined #mojo
16:10 VVelox joined #mojo
16:11 rick_soc joined #mojo
16:11 rick_soc \o/
16:21 jberger ashimema: what is your patch?
16:22 jberger (sorry, I'm actually in the office today so I'm going to be in meetings etc throughout the day)
16:22 rick_soc I think I might give the mojo email options a try today.
16:22 rick_soc I was looking up how to do this the other day but 3 different blogs went about it in completely different ways
16:23 jberger stomper: light the bat-signal! (/cc batman)
16:23 jberger rick_soc: probably because mojo really has nothing to do with email, so the options are pretty much limited only by what cpan offers :-P
16:24 Grinnz generally: use Email::Stuffer, or Email::MIME directly if that's not enough
16:24 rick_soc There is the Mojolicious::Plugin::Email which seems like the obvious pick, but then I see use of Email::Sender
16:25 Grinnz or Email::Sender directly for simple things
16:25 rick_soc yea Email::MIME was the other one I saw recommended
16:25 Grinnz there's no reason to make it a plugin
16:25 Grinnz Email::MIME and Email::Sender work hand in hand, and Email::Stuffer combines them for you plus helpful attachment methods
16:27 rick_soc is there something wrong with the plugin
16:28 Grinnz no idea. but what's the point of a plugin for using unrelated modules?
16:28 rick_soc looks like maybe it's just a wrapper for MIME::Lite
16:29 rick_soc I only ask because I'm trying my best to stay within the Mojolicious framework / community supported methods of using Mojolicious
16:30 Grinnz mojolicious has no opinion on sending emails
16:30 Grinnz in general perl opinion, MIME::Lite is out of date
16:31 rick_soc okie dokie
16:31 pink_mist rick_soc: there's 2 official spin-offs of Mojolicious: http://mojolicious.org/perldoc#SPIN-OFFS
16:31 pink_mist those are recommended
16:32 pink_mist anything else ... well, it depends
16:32 rick_soc In the Plugin I see it has it's own version of accessing templates via name.mail.ep, but I assume I can just use the standard name.html.ep and pass that to the email instead of rendering a page
16:32 Grinnz you can use Mojo::Template directly, sure
16:33 Grinnz sri: might be too late now, but a suggestion from mst: make ->with_roles('::Foo') do what ->with_roles('+Foo') does now (packages can't start with :: so it makes sense to me)
16:34 Grinnz ah, he just posted an issue for it
16:34 rshadow joined #mojo
16:47 sri meh https://github.com/kraih/mojo/issues/1122
16:50 stomper jberger: What does the bat-signal do?
16:51 jberger summons batman of course :P
16:53 stomper I think I need Robin or Jan
16:54 jberger stomper: I'll let you in on a secret ... Jan Henning Thorsen ... is ... batman!
16:54 jberger shhhhh, don't tell!
16:54 stomper Spoiler :-)
16:55 stomper Now I think of it, perhaps that was the t-shirt he was wearing when he gave his talk.
17:02 rick_soc what is a bat man
17:04 stomper jberger: I'll try him tomorrow. Thanks.
17:05 sri as far as i'm concerned you all had your chance to object https://github.com/kraih/mojo/issues/1122#issuecomment-323134547
17:05 rick_soc I object
17:06 * sri puts rick_soc on ignore
17:07 rick_soc :(
17:08 jberger https://www.youtube.com/watch?v=lLMBHvDNYiU
17:09 jberger sri: I think I agree on + for relative
17:09 sri i did make a mistake though https://github.com/kraih/mojo/issues/1122#issuecomment-323135486
17:09 sri thought Test::Mojo::WithRoles did it the other way around
17:10 jberger it seems like to ask for a weird thing (a relative module vs a regular) then you should ask for it
17:10 jberger IIRC I caved to pressure
17:10 sri obviously +Foo for relative seemed intuitive to me too
17:10 Grinnz jberger: mst suggested to use leading :: to indicate that, which wouldn't conflict with modules using + for a different meaning
17:10 sri or i wouldn't have gotten it wrong
17:10 sri Grinnz: that's ugly
17:11 sri ::Foo already has another meaning in Perl
17:11 Grinnz it does?
17:11 Grinnz require ::Foo is a fatal error
17:13 Grinnz personally i prefer the default to fully-qualified as it does now, but + for relative is apparently inconsistent with existing systems
17:15 robut joined #mojo
17:17 jberger I'm trying to find something in the log
17:17 jberger but failing
17:17 jberger I'm sure I didn't come up with + myself
17:21 rick_soc <3 render_to_string
17:24 jberger yeah, it looks like mst must have suggested the + behavior to me: https://github.com/jberger/Test-Mojo-WithRoles/commit/a010dca3c16676f50557b732174d15d856accd72
17:24 jberger but I don't think I have logs with him from the time
17:32 sri well, i kinda like the current behavior, but don't care very much
17:33 sri if the community decides to vote against it we'll change it
17:33 sri otherwise... meh
17:37 marcus I like the current behavior.
17:37 xenn joined #mojo
17:42 petru joined #mojo
17:43 dod joined #mojo
17:44 rick_soc What is a clean way of having a mojo app running but idle, waiting for new jobs to show up in a queue
17:45 rick_soc I'm thinking something like checking every minute if a mysql table has new rows with the job info
17:45 rick_soc My amateur inclination is to just setup an infinite while loop waiting for termination
17:46 jberger rick_soc: have you looked at Minion?
17:46 rick_soc no
17:46 jberger I think you might like what you see there :D
17:46 pink_mist 18:32 <pink_mist> rick_soc: there's 2 official spin-offs of Mojolicious: http://mojolicious.org/perldoc#SPIN-OFFS <-- let me again point you to this
17:49 rick_soc pink_mist:  thanks, I missed the minion description first time around because I stopped reading at the Postgres note :]
17:51 jberger rick_soc in the Mojolicious world, the documentation is very concise, please do read it, it isn't just fluff :)
17:56 rick_soc This is neat
17:56 batman stomper: can you show me the actual command you're running with environment variables?
17:56 batman and paste the test file somewhere
17:57 tchaves joined #mojo
18:03 xenn joined #mojo
18:26 sri marcus: don't let the syntax discussion distract you from the object role patch
18:26 sri and like i said, if you find a good enough description for the docs i'd write the code and tests if needed
18:39 karjala_ joined #mojo
18:46 rick_soc oh no - using cpanm to install Email::Stuffer and it just keeps gooooiiiinnnggggg  :]
18:47 rick_soc eek, it installed 24 dependencies and still bailed
19:19 PopeFelix joined #mojo
19:26 sri marcus: well, here's a patch :) https://gist.github.com/anonymous/10210f643001514b551f6c23fb59e682
19:27 sri just needs the description to be fixed
19:27 sri and maybe some more golfing
19:28 sri well, actually, i guess it's slightly wrong
19:28 sri since it just reblesses the object
19:31 sri marcus: ok, this one should be correct https://gist.github.com/anonymous/59a415b779a8f51f0578fa33c40858de
20:13 * sri pokes marcus with a stick
20:15 jberger sri: I like the new TESTS!
20:24 good_news_everyon joined #mojo
20:24 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v7pKw
20:24 good_news_everyon mojo/master 350a293 Sebastian Riedel: allow roles to be applied to objects
20:24 good_news_everyon left #mojo
20:24 sri oh well, now it has a shitty description
20:25 good_news_everyon joined #mojo
20:25 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v7p6m
20:25 good_news_everyon mojo/master bd2add1 Sebastian Riedel: fix typo
20:25 good_news_everyon left #mojo
20:46 VVelox joined #mojo
20:57 disputin joined #mojo
21:46 Grinnz The Defenders out tomorrow on netflix
21:53 mudler joined #mojo
22:40 Grinnz https://www.youtube.com/watch?v=D_6J9BqgonU
22:41 Grinnz there was another trailer today but this ones better i think
23:40 karjala_ joined #mojo

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