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

IRC log for #mojo, 2017-10-29

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

All times shown according to UTC.

Time Nick Message
00:19 EvanCarroll joined #mojo
00:40 aborazmeh joined #mojo
01:44 VVelox joined #mojo
01:59 zach joined #mojo
02:01 zach So, in trying to write unit tests, when I do a $t->get_ok('/route') and I have a ->status_is(302) and I want to test that the place it's redirected to has ->text_is(h1 => 'Welcome') it shows the content in the error of the first page and not the page it redirects to, but I can have a subroutine that checks the route that it was on to ensure it was redirected to the right route, and it totally is, and sure
02:01 zach enough if I run the web app it does redirect correctly
02:04 batman zach: i normally check ->header_is(Location => "/redirected-to"); and then i do $t->get_ok($t->tx->res->headers->location)->status_is(200);
02:04 batman ..or header_like(Location => qr{...})
02:06 rickbol joined #mojo
02:10 rickbol_ joined #mojo
02:11 batman hm... does anyone know if i can revert a version on cpan? I just uploaded AssetPack 2.00, which wasn't supposed to be 2.00 at all :/
02:12 mohawk far as i know all you can do is delete it off PAUSE then wait
02:12 mohawk presumably the pause or metacpan folks have the capability to fast-track that
02:13 Grinnz yeah gotta wait the 3 days
02:14 Grinnz then probably trigger a reindex on the dist, not sure if it will automatically do that
02:15 Grinnz watch http://cpanmeta.grinnz.com/#=Mojolicious::Plugin::AssetPack for the state of the index
02:16 batman ok. thanks!
02:31 zach batman: so, the route that the location is supposed to go to is tested earlier, so you think that as long as I test that the 302 is correct and that it's actually going to the other page, it's enough?
02:31 batman that's what i would do
02:44 zach ok
02:56 ilbot2 joined #mojo
02:56 Topic for #mojo is now 🍩 nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
03:33 noganex_ joined #mojo
03:41 mib_4xsqqs joined #mojo
03:41 mib_4xsqqs hi
03:41 mib_4xsqqs pidorases
03:51 mib_4xsqqs l
03:51 mib_4xsqqs l
03:51 mib_4xsqqs l
03:51 mib_4xsqqs l
03:51 mib_4xsqqs l
03:51 mib_4xsqqs l
03:51 mib_4xsqqs l
03:51 mib_4xsqqs llll
03:51 mib_4xsqqs *&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@
03:51 mib_4xsqqs *&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@
03:51 mib_4xsqqs *&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@
03:51 mib_4xsqqs *&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@
03:51 mib_4xsqqs *&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@
03:51 mib_4xsqqs *&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@
03:51 mib_4xsqqs *&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@
03:51 mib_4xsqqs *&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@
03:51 mib_4xsqqs *&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@
03:52 mib_4xsqqs *&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@
03:52 mib_4xsqqs *&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@
03:52 mib_4xsqqs *&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@
03:52 mib_4xsqqs *&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@#*($&~*($!$()*!()%)@(#%*&$*(#$&@
03:59 Grinnz that was... unique
04:04 dboehmer joined #mojo
05:04 dboehmer_ joined #mojo
05:04 batman that's one way to put it :D
05:58 zach whatever became of https://github.com/kraih/mojo/pull/956
06:05 mohawk it got closed</capt_obvious>
06:05 mohawk that was 17 months ago
06:08 zach Clearly, but as the ending point was that it would continue to be discussed for the path of it, I was curious what that path was if anything
06:09 mohawk i guess next time sri is here he can steer us
06:46 purl joined #mojo
07:44 Vandal joined #mojo
08:07 dod joined #mojo
08:11 dod joined #mojo
09:07 sri nobody has worked on that since as far as i know
09:12 hrupp joined #mojo
09:21 karjala_ joined #mojo
09:36 sri the spam on this network is getting really annoying
09:46 VVelox joined #mojo
09:51 dod joined #mojo
10:26 trone joined #mojo
10:30 aborazmeh joined #mojo
11:13 petru joined #mojo
11:35 ghenry joined #mojo
12:20 karjala_ joined #mojo
13:15 jberger batman even if you delete the dist, version numbers can never go backwards. Unfortunately you've hit 2.0 it seems
13:21 dod joined #mojo
13:31 karjala_ the river can't go back
13:37 garo joined #mojo
13:41 garo I just noticed that "get '*path' => sub {}" matches every form of "website/some/path", but it doesn't match "website" or "website/"
13:41 garo What placeholder(s) should i use for this ?
14:08 ChmEarl joined #mojo
14:23 [vlad] joined #mojo
14:50 sri garo: that is incorrect, and path is a reserved name
14:54 karjala_ left #mojo
14:57 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Catch-all-route
14:58 ghenry joined #mojo
15:08 petru joined #mojo
15:51 karjala_ joined #mojo
15:57 dod joined #mojo
15:59 mohawk jberger, as i understand it (remember PDL 2.4.0?) once it's off pause and therefore cpan, clients won't see it?
16:00 jberger that's only partially true
16:00 jberger some cpan mirrors are backpan mirrors retaining all previous releases
16:00 mohawk backpan ruining everything again
16:00 jberger this includes metacpan
16:01 jberger but also, pause won't index anything that moves version number backwards
16:01 mohawk ah
16:01 jberger so yes, batman could delete the 2.0 release, but his next release has to be >2.0
16:01 mohawk batman, that sounds like your answer - you'd need to get your 2.00 zapped from the index
16:01 jberger so he's at 2.0+ no matter what that content will be
16:01 mohawk zach, sounds like it's available for working on?
16:03 jberger I don't know what you mean by zapping from the index
16:03 jberger that's not a thing
16:03 mohawk an index is data
16:03 mohawk data can be subtracted from as well as added to
16:04 jberger you want to get andreas to change pause because batman accidentally spoiled a version number?
16:04 jberger I wouldn't ask that
16:04 jberger delete 2.00 from pause, release the previous/indented content as 2.01
16:05 jberger and when you want to make a breaking change (which presumably he meant with 2.0) then release that as 3.0
16:05 jberger honestly, though I side with the semver people, the ultimate adherence to it is kinda crazy
16:15 mohawk agreed
16:15 mohawk i was a bit blown away (in a good sense) by elm's semver - it's all automatic
16:16 mohawk bump third number if new release, second if add something, first if delete something (of available "actions")
16:18 sh14 joined #mojo
16:31 good_news_everyon joined #mojo
16:31 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vFLln
16:31 good_news_everyon mojo/master 9ded0f1 Sebastian Riedel: rewrite history a little bit
16:31 good_news_everyon left #mojo
16:31 sri speaking of versioning
16:31 sri those were kinda silly releases
16:32 sri didn't even do anything significant
16:32 pink_mist yay, we can use tropical drink and smiling cat face with heart-shaped eyes again! :P
16:35 sri it's already been 1 year and 3 months since the last major release :o
16:37 sri bit of a bummer we didn't have one more release before promises
16:38 sri will be 7.49 now, out 599th release
16:38 sri s/t/r/
16:51 CandyAngel On a scale of 1-10, how annoying is it to have [Submit] [           ], rather that [         ] [Search]?
16:51 CandyAngel Err
16:51 CandyAngel Search for both buttons :P
16:51 mohawk at least 5
16:51 pink_mist at least 8
16:51 pink_mist possibly even a 9
16:54 Grinnz jberger: deleting from cpan also deletes from the index. you can then force a reindex so the older version is indexed again. I'm not actually sure whether PAUSE would care that there was once a 2.00 for its 'higher version' check, or if that's just going off the currently indexed version
16:54 Grinnz jberger: the only primary issue is if someone installed 2.00 in the meantime, then they wouldn't automatically be able to update to the lower version
16:55 Grinnz jberger: backpan would still have the 2.00 but that only matters if someone tries to install that exact version, since it won't be indexed
16:55 pink_mist what happens when he really does want to release version 2.00? will backpan overwrite the wrong one?
16:56 Grinnz no idea. PAUSE will accept it since it doesn't exist on cpan anymore
16:57 Grinnz the only restriction on *uploading* is that the filename doesn't already exist; the restriction on indexing is that the version number is higher, and i think that means higher than currently indexed
16:57 mohawk it might clash on backpan
16:58 jamesaxl I wonder why perl does not accept this syntax :) push @data, {name => 'jamesaxl', country => 'rhapsody'};
16:58 Grinnz that syntax is fine
17:00 jamesaxl Grinnz: maybe I miss something in my code then, because I am using DBIX and the problem with Dbix we can not return the result to be json directly
17:00 Grinnz DBIx is not a thing, it's a namespace
17:00 Grinnz did you mean DBIC / DBIx::Class?
17:01 mohawk jamesaxl, show actual (cut down) code
17:01 jamesaxl I meant DBIx::class
17:01 mohawk USING a paster, not in channel
17:01 pink_mist and none of that has anything to do with json
17:01 Grinnz the code you showed is a hashref not json
17:01 sh14|2 joined #mojo
17:02 jamesaxl Grinnz: I know, but with mojo i can convert it.
17:03 jamesaxl pink_mist: you did not get me and you start arite very fast
17:03 jamesaxl s/arite/write
17:03 Grinnz jamesaxl: nobody knows what you're talking about. show code
17:04 jamesaxl Grinnz: I know, that is why I answered him
17:04 jamesaxl a moment please
17:04 purl a moment is lost
17:10 jamesaxl https://bpaste.net/show/8f3d32312d27
17:11 good_news_everyon joined #mojo
17:11 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vFL4R
17:11 good_news_everyon mojo/master 4790c91 Sebastian Riedel: use a little less code
17:11 good_news_everyon left #mojo
17:12 jamesaxl Grinnz ^ pink_mist
17:14 Grinnz jamesaxl: and what error are you getting?
17:16 jamesaxl Grinnz: Grinnz I scalar instead of data that I pushed
17:16 Grinnz what?
17:26 Ionit joined #mojo
17:26 Ionit Hello
17:27 Ionit Does anyone know if it is possible with Mojo: DOM to extract image paths that are stored by CSS (background-image) in html source?
17:37 rshadow joined #mojo
17:41 jamesaxl pink_mist: are you fan of Ace of base?
17:45 Grinnz Ionit: it won't parse style attributes if that's what you're asking
17:45 Grinnz you can use it to find the style attribute though
17:50 jamesaxl where should I upload mojolicous api?
17:52 Ionit Grinnz: find('img')->attr('background-image') ??
17:52 good_news_everyon joined #mojo
17:52 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vFLRA
17:52 good_news_everyon mojo/master 3096cd3 Sebastian Riedel: use less code and fix memory leak
17:52 good_news_everyon left #mojo
17:53 pink_mist Ionit: ->attr is for html attributes, you're asking for a css attribute ... which Mojo::DOM doesn't support
17:53 sri i think Promises leaks too
17:53 Ionit give it a Mojo-Plugin for CSS-Atributes?
17:54 pink_mist Ionit: you're welcome to write one
17:54 Ionit rofl ;-)
17:54 Ionit i am beginner ;-)
17:54 Ionit also, mit Mojo i cant extract "background-image" image-path?
17:55 sri so far the other fix hasn't even been acknowledged though, so i guess i won't put too much effort into fixing Promises for now
17:56 sri at least Mojo::IOLoop::Delay should be leak free
17:57 Grinnz Ionit: Mojo::DOM is an HTML parser. it does not parse anything else, and it does not render CSS rules (that's the browser's job)
17:58 Grinnz it uses css *selectors* to traverse nodes, that's all
17:58 Ionit Grinnz: I know bit Mojo have a lot of plugins
17:58 Ionit Mojo::DOM::CSS
17:58 Ionit exmaple and so on
17:58 Grinnz that's not a plugin, that's the CSS selector engine
17:59 Grinnz as pink_mist said, you're welcome to write a CSS parser
17:59 Grinnz but I don't think any exists
17:59 Ionit Grinnz: I am a beginner. I cant write Parser ;-)
17:59 Ionit Ok, i will use normal regex then
18:00 CandyAngel Ionit: Do it anyway! \o/
18:00 Grinnz there is e.g. https://metacpan.org/pod/CSS::DOM but I don't know if it's good or not
18:01 Grinnz you don't need to use something mojo based
18:01 jamesaxl Ionit: you can write it if you try, if you say "I can not" you will not do anything.
18:02 Ionit thank you very much. I will use regex for this ... i fond examples for this problems.
18:02 CandyAngel Not like you have to write it totally on your own, you can always ask for help as you get stuck on bits
18:02 Grinnz well, CSS rules are much easier to regex than HTML at least
18:02 Ionit jamesaxl: I dont have time to learn and write a parser for this problem here by me.
18:03 Grinnz i would still recommend using Mojo::DOM to find the CSS rules within the HTML, rather than trying to parse the HTML with regex too
18:03 jamesaxl Ionit: regexp will lose your time, trust me
18:04 Ionit Grinnz: Yeah, that's exactly what I'm going to do. Thank yoi!
18:06 zach mohawk: thanks, I'll add it to my list of things to look into
18:07 zach ugh that reminds me there's a puppet module I said I'd fix for automating cpan stuff and I forgot about it and someone pinged me about it this week
18:07 jamesaxl I see that Dbix::class does magic things. Great
18:54 EvanCarroll joined #mojo
19:32 karjala_ joined #mojo
19:32 dod joined #mojo
19:33 karjala_ Promises.pm just had a release
20:42 mohawk karjala, headlines from that? (looking as well)
20:42 karjala_ I don't remember
20:42 mohawk "BUG FIXES: removed hard-dependency on the different backends"
20:42 mohawk tantalisingly, it's number 0.98
20:43 mohawk sorry
20:43 mohawk that's from 0.98, and apparently 0.99 is latest
20:43 mohawk thanks metacpan
20:43 karjala_ [0.99
20:44 karjala_ https://www.perlmodules.net/viewfeed/distro/Promises
20:44 mohawk now it's "BUG FIXES: skip all backend compile tests"
20:47 good_news_everyon joined #mojo
20:47 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vFLKk
20:47 good_news_everyon mojo/master 1f14b86 Sebastian Riedel: more links
20:47 good_news_everyon left #mojo
20:48 sri quality of Promises is really not that good, code degraded with every new maintainer it seems
20:51 mohawk no sign of travis builds on the promises repo
20:51 sri i'm really curious how well our combination of steps and promises will work out
20:51 sri still think the combination has a lot of potential
20:51 mohawk i am looking forward to having a go quite soon
20:52 sri but i predict that the error event will turn out to be the first problem
20:52 mohawk i got sidetracked a little on my dbic-schema-to-graphql-schema in fixing up travis-perl/helpers
20:52 mohawk but after that, promises!
20:52 sri without subscribers it's fatal and throws an exception
20:52 mohawk what catches it?
20:52 sri a subscriber
20:52 mohawk (if there's no subscriber)
20:53 sri and ->then(undef, sub {...}) is technically not a subscriber
20:53 mohawk could it be made so?
20:54 sri i'm hesitant to adding that kinda hacks just yet
20:54 sri want to start clean and address problems as they pop up
20:55 sri it could be a problem, but might not
20:55 sri we need people to experiment with delays
20:55 mohawk agreed
20:56 EvanCarroll joined #mojo
20:58 sri think i'd like it best if those events didn't exist
20:59 sri but then jberger will yell at me again :/
21:02 sri pretty sure those events will be gone in 8.0
21:03 mohawk jamesaxl, your $pages calculation is bizarrely complicated and seems not to work if ->count == 10
21:04 mohawk also seems to result in non-int (->count / 10)
21:05 sri hmm, the error event actually prevents the delay helper from being written correctly with a ->catch handler
21:06 itaipu joined #mojo
21:06 sri quite annoying actually
21:06 sri $c->delay can't be used as a promise
21:07 sri that's going to be confusing
21:08 mohawk jamesaxl, use this instead (note testing shows it's correct): map { print "$_ = ", pages($_), "\n" } 1, 9, 10, 11, 19, 20, 21; sub pages { 1 + int((shift() - 1) / 10) }
21:08 mohawk ha ha, destroyed by good code?
21:08 bjakubski joined #mojo
21:09 jamesaxl joined #mojo
21:09 pink_mist POSIX::ceil(shift() / 10)
21:10 good_news_everyon joined #mojo
21:10 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vFL6Z
21:10 good_news_everyon mojo/master 62ffba5 Sebastian Riedel: mention that the delay helper can only be used for flow-control
21:10 good_news_everyon left #mojo
21:11 mohawk pink_mist, that's no fun. especially with giganto deps ;-)
21:11 pink_mist POSIX is core =)
21:12 mohawk i wonder how much memory that would take up
21:13 pink_mist in my head it will take up much less than your solution since yours is much more complex
21:13 jberger I'm ...
21:15 mohawk my POSIX.so is 101k
21:17 jberger look, I hate to bring this up, and I'm afraid of what the consequences might be
21:17 pink_mist mohawk: I believe there are places in the Mojo codebase that loads POSIX too, so
21:17 mohawk omg
21:17 mohawk fair enough ;-)
21:17 jberger but are you sure that Delay is a promise library? like it kinda seems like its two libraries
21:22 sri jberger: it would be if we didin't have the old steps baggage
21:23 jberger that's the Delay part
21:23 sri no
21:23 sri ->steps is perfectly fine
21:23 jberger nm, I'm not trying to start a fight
21:23 sri it's the events that cause trouble
21:24 sri on its own steps is a concept that fits in well with promises
21:24 sri just the garbage we added around steps over the years
21:24 sri ...
21:25 jberger in the great usability campaign
21:25 jberger didn't really work out, I'll grant you that
21:25 sri thing is, there should only really be ->steps and ->begin, everything else was just a futile attempt to keep up with promises
21:25 jamesaxl mohawk: It is just a simple example, I should improve it
21:26 sri the finish event is not even that bad, it stays out of the way
21:27 sri it's the error event that messes things up
21:27 sri not even a deprecation path
21:27 sri it will have to be removed in 8.0
21:27 jberger I mean, if you remove that, my usage of Delay steps is completely wrecked
21:27 jberger I'll likely have to fork it (with blessing, I'd hope)
21:27 sri then your usage is bad anyway
21:28 jberger that's the exception path
21:28 sri not something we'd want to encourage in the future
21:28 jberger that's literally what we encouraged
21:28 sri yea, and we made a huge mistake
21:28 jberger you believe
21:28 sri i know
21:29 sri this is mojo, we don't hang on to shitty code, we adapt and get better incrementally
21:29 jberger I've agreed before that promises have won the battle overall
21:29 jberger but again, shifting the api of a class that is used in a complex way like this is scary to me
21:30 mohawk jamesaxl, did your problem get sorted?
21:30 jberger I'd rather you'd just make a Mojo::Promise and split Mojo::IOLoop::Delay off
21:30 jberger (and I don't love that idea either, mind)
21:31 sri ->steps and ->begin are good
21:32 jberger so in this newly envisioned api, with steps but without the error event, where does the error go if the first step errors?
21:32 jberger say second step
21:32 sri rejected promise
21:32 sri ->catch(sub {...})
21:32 sri already does
21:33 sri steps result in a promise that will get settled at the end
21:33 jamesaxl mohawk: yes, it was just my mistake,
21:33 mohawk great
21:35 jberger so the good news is that I never use the invocant of the error handler anyway
21:35 jberger the bad news is that there's no deprecation path, and I spent an afternoon fixing all my modules with the wrong fix and send my old company off to do the same
21:35 jamesaxl mohawk: I am re-writing an API for asterisk, the old one was in php codeigniter, the official one will be in perl mojo
21:36 jberger jamesaxl: a new asterisk module is sorely needed
21:36 jberger (I'm glad it isn't needed by me anymore, thankfully)
21:36 jamesaxl jberger: it is for real-time, and I include also AMI
21:38 jberger you're doing a service to your country son
21:43 good_news_everyon joined #mojo
21:43 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vFLPI
21:43 good_news_everyon mojo/master 6be6023 Sebastian Riedel: deprecate Mojo::IOLoop::Delay::remaining
21:43 good_news_everyon left #mojo
21:46 sri actually, i don't mind ->pass either
21:46 sri ->steps, ->begin and ->pass are the essential parts of steps
21:47 sri everything more complicated is what promises are for
21:47 sri and steps are a promise, so you can just mix and match
21:48 jberger remaining I'm fine deprecating
21:48 sri you just hate when i deprecate things that you use, eh? :p
21:49 jberger I use what's good
21:49 sri aside from the error event i'm really happy with delays now
21:50 sri now it's almost like what i would have designed if i could start from scratch today
21:53 sri i'm aiming for a release tomorrow
21:54 jberger my code at work is fixed, my cpan modules are fixed, my former company is informed, but ALL of those now use the error event
21:54 jberger fyi
22:02 sri this would make the error event non-fatal https://gist.github.com/anonymous/13bc60625d9005863649b67017fae0cb
22:04 sri think fatal error event will become more of an annoyance in the future
22:05 sri it throws the exception so that it gets caught on the reactor level
22:05 jberger I think I'm safe from that change, but surely that's a breaking change, right?
22:05 sri jberger: what breaks?
22:05 purl breaks are good. trym's brain takes a few of them.. without me asking it to
22:05 jberger people who relied on the fatal nature of that event
22:06 sri jberger: how would they rely on that?
22:06 jberger by not handling it
22:06 sri umm
22:06 sri what?
22:07 sri have you actually looked at the code?
22:07 sri this is not an excpetion you could catch in a controller
22:08 sri it's a last resort kind of deal, not something anyone relies on
22:16 sri well, since jberger insists on blocking my change, and it is only cosmetic i'll leave it be
22:17 jberger I disklike that characterization
22:17 sri but, ->steps + ->catch will result in a reactor warning
22:29 sri for the record, the delay exception gets throws in the reactor, from a next_tick, resulting in a warning, no user can catch it, we only made it that way back in the days so the risk of users missing errors was lower
22:30 sri most pointless backcompat argument ever... but whatever... blocked by lawyering
22:33 jberger I'll concede I was quick to oppose that change and LIKELY won't affect anyone
22:41 sri well, my plan is this now https://github.com/kraih/mojo/issues/1143
22:43 sri and your blocked change is the main argument for it
22:43 sri i expect use complaints until then, since those warnings are annoying as i noticed while fixing core tests
22:43 sri *user
22:59 good_news_everyon joined #mojo
22:59 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vFL1h
22:59 good_news_everyon mojo/master cf993d7 Sebastian Riedel: fix typo
22:59 good_news_everyon left #mojo
23:04 rickbol joined #mojo
23:08 sri season 2 of stranger things is really good
23:09 jberger +1
23:09 purl 1
23:47 genio I've only seen the first episode so far.
23:49 jberger we just finished episode 8

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