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

IRC log for #mojo, 2017-02-06

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

All times shown according to UTC.

Time Nick Message
00:27 witch joined #mojo
00:50 aborazmeh joined #mojo
02:13 lluad joined #mojo
02:14 ferreira joined #mojo
02:23 ferreira I wrote a wrapper around Mojo::IOLoop::Stream that implements reading from a handle line by line – the prospective name for the module is MojoX::LineReader.
02:24 ferreira If someone feel like taking a look at the docs https://github.com/aferreira/cpan-MojoX-LineReader/blob/master/lib/MojoX/LineReader.pod and code https://github.com/aferreira/cpan-MojoX-LineReader/blob/master/lib/MojoX/LineReader.pm and giving feedback, you're welcome.
03:09 batman ferreira: I would add a new event called "line". That way, you can use the same module for bytes and lines.
03:13 batman The new() method looks strange. Not sure why you need it at all. Why not just put the logic inside the builder for the stream attribute?
03:14 batman Like the variable names are non standard...
03:19 ferreira batman: thanks. I don't like the idea of using the same module for bytes and lines. You cannot mix them without doing a mess, and if you want bytes go with Mojo::IOLoop::Stream for better performance.
03:20 batman why can't you mix them?
03:22 ferreira ok, you can mix them - just emit  the bytes-read event and the multiple line-read events from inside the handler. Not sure about the use case for that.
03:22 ferreira I am going to dump the new() and put the logic into the stream attribute builder - like you said, it will look cleaner.
03:23 batman i think i was wrong about the attribute
03:23 ferreira How so?
03:23 batman because of "handle"
03:25 ferreira oh, yeah - that is true, I would need to store "handle" or pass it as an argument which does not work for the builder
03:30 batman this is not tested, but this is how i would write it: https://ssl.thorsen.pm/paste/2c3b4e760199
03:33 batman just updated with correct sorting of code
03:36 ferreira That is very nice – I haven't thought about avoiding the in-core IO handle by using $ in a regex (achieving the same effect of $/ defining the concept of line)
03:37 batman yeah... because you have no control of $/ from when you constructed the object, to when an event is triggered.
03:38 batman that is hopefully just a theoretically problem though.
03:38 ferreira Do you mind if I update my code based on your suggestions? You advanced my code a few commits ahead my silly start (weakened refs, configurable line definitions, etc.)
03:39 ferreira I don't think it is theoretical – I plan to use it in a Mojo application where I read line-delimited files and do a few non-blocking stuff (writing to databases, remote logging, etc.)
03:41 ferreira hm, sorry, you called theoretical problem the issue with control of $/ – theoretical probems happen more often than not at production systems :-P
03:44 batman ferreira: you can do what you like with the code i wrote :)
03:45 ferreira Thanks! Can you comment on your choice for the package name?
03:45 batman MojoX:: is not something that is used anymore.
03:46 batman you should ask here if my suggested module name is ok, but i don't think any core module will be called that
03:47 batman that = Mojo::IOLoop::LineReader
03:47 ferreira Okay. Your help has been awesome!
03:47 batman you're very welcome
03:49 batman ferreira: have you looked at https://metacpan.org/pod/Mojo::IOLoop::Tail ?
03:50 asarch joined #mojo
03:55 ferreira batman: not yet - interesting stuff there
03:56 batman or https://metacpan.org/pod/MojoX::LineStream
03:58 ferreira That is the first one I looked at.
04:00 ferreira It uses only \n as line delimiter, chomps the lines, and other few inconsistencies.
04:01 ferreira (Well, of course mine has its own inconsistencies like you pointed.)
04:03 ferreira It seems that I can't do all (in an easy way) the magic around $/ and readline http://perldoc.perl.org/perlvar.html#%24%2f – mainly about $/ = undef, and ""
04:03 ferreira ^ with regexes
04:14 batman while $self->{buffer} =~ s!^(.*?)$/!!s; <-- i forgot the "s" modifier in the paste
04:55 Grinnz fyi, $ in a regex matches only \n, rather than being affected by $/
04:55 Grinnz i don't know if that matters for your use case, but it is a difference between using a regex and readline, for instance
05:04 dboehmer_ joined #mojo
05:57 batman Grinnz: i'm using the variable $/, not just $ :)
06:25 hartenfels joined #mojo
06:35 hartenfels1 joined #mojo
06:53 disputin joined #mojo
06:53 disputin1 joined #mojo
06:55 polettix joined #mojo
07:16 dod joined #mojo
07:19 Vandal joined #mojo
07:39 mbudde joined #mojo
07:44 rshadow joined #mojo
08:00 AndrewIsh joined #mojo
08:02 trone joined #mojo
08:44 stryx` joined #mojo
10:43 irqq joined #mojo
11:00 stryx` joined #mojo
11:02 trone joined #mojo
11:03 gregf_ joined #mojo
12:09 aborazmeh joined #mojo
12:19 foursixnine joined #mojo
12:20 dustinm joined #mojo
12:29 gryphon joined #mojo
12:30 dod joined #mojo
12:45 dantti_laptop joined #mojo
13:01 cpan_mojo Mojolicious-Plugin-Restify-0.04 by KWAKWA https://metacpan.org/release/KWAKWA/Mojolicious-Plugin-Restify-0.04
13:08 foursixnine joined #mojo
13:15 dod joined #mojo
13:23 kes joined #mojo
13:26 dod joined #mojo
13:31 perlpilot joined #mojo
13:40 itaipu joined #mojo
13:47 foursixnine joined #mojo
13:55 zivester joined #mojo
14:13 Pyritic joined #mojo
14:14 stryx` joined #mojo
14:33 dod joined #mojo
14:38 dod joined #mojo
14:42 dod joined #mojo
14:46 gregf_ joined #mojo
15:04 Lee joined #mojo
15:09 Pyritic joined #mojo
15:13 dotan_convos joined #mojo
15:18 bwf joined #mojo
15:34 tchaves joined #mojo
15:40 sh14 joined #mojo
16:00 itaipu joined #mojo
16:10 disputin joined #mojo
16:10 mcsnolte joined #mojo
16:32 lluad joined #mojo
16:36 gryphon joined #mojo
16:37 marty joined #mojo
16:43 sh14|2 joined #mojo
16:46 PryMar56 joined #mojo
17:09 itaipu joined #mojo
17:17 ribasushi jberger: here, have a bowl of grief https://news.ycombinator.com/item?id=13581293
17:20 Grinnz the name will continue to confuse people for a good decade or so
17:21 Grinnz i'm frankly baffled they didn't seem to think this would happen
17:21 sri you mean until perl6 dies ;p
17:21 sri if we're lucky it will never hit critical mass
17:23 Grinnz and someone posted those terrible perl jam videos on the parent post :|
17:23 Grinnz which was about perl 6, even
17:41 sri hmm, odd seeing my butterfly on a commercial book :S https://leanpub.com/perl6
17:59 gizmomathboy joined #mojo
18:03 asarch joined #mojo
18:03 kes joined #mojo
18:10 dod joined #mojo
18:15 rshadow joined #mojo
18:19 genio sri: Did you freely give away the artwork?
18:28 sri genio: it's complicated, i gave it to the open perl6 book, but i don't remember which license
18:28 rshadow joined #mojo
18:28 genio ah
18:29 sri looking at the open perl6 book, i think no license was specified, which i guess means it's not free to use
18:29 sri https://github.com/perl6/book/blob/master/src/images/cover.jpg
18:31 sri i meant to release it under an open license with mojo 1.0, but then nobody in the perl6 community wanted to use the logo, and it got forgotten
18:31 genio this seems outrageously fun: https://twitter.com/spectatorindex/status/828657043489845251
18:32 Grinnz PULL!
18:33 coolo have you played asphalt 8: airborne? :)
18:33 coolo they have a track on a carrier :)
18:34 coolo https://www.youtube.com/watch?v=_o4Swh1ZoEo
18:47 Pyritic joined #mojo
18:58 itaipu joined #mojo
19:02 irqq joined #mojo
19:15 jberger ribasushi: I don't know if I can handle a whole lot more grief atm
19:25 dod joined #mojo
19:27 blonewolfs joined #mojo
19:27 rshadow joined #mojo
19:31 disputin joined #mojo
19:51 disputin joined #mojo
20:02 jberger ok fine, I did reply ...
20:02 jberger actually because I had to respond to the perl jam crap
20:17 disputin joined #mojo
20:23 rshadow joined #mojo
20:31 rshadow joined #mojo
20:45 gryphon_ joined #mojo
21:01 stryx` joined #mojo
21:10 cfedde joined #mojo
21:52 sri oh, next postgres release will be version 10
21:57 litwol I know of piwik. but it's running exclusively on mysql. considering ya'll solr me on postgres (running it successfully for personal hobby site), do you have a recommendation for piwik alternative that runs on postres?
21:57 pink_mist what's a piwik?
21:58 litwol https://piwik.org/
21:58 pink_mist not interested in going to links all evening, so if you don't want to tell me, I'll go do something else
21:59 litwol "Piwik is the leading open-source analytics platform that gives you more than just powerful analytics:"
21:59 litwol it's like google-analytics.
21:59 litwol just claims to be open source.
22:00 litwol you know.. the evil "track everything about your visitors" thing.
22:00 lluad There is - according to their own FAQ - a port to postgresql. Might be worth a look.
22:00 pink_mist ah, yeah ... no idea about that :P
22:05 Grinnz may be evil, but if it weren't for tracking what your users do, the web would be a vastly less-useful place
22:05 Grinnz we'd still be using aol keywords
22:14 tchaves joined #mojo
22:15 polettix joined #mojo
22:42 PryMar56 joined #mojo
22:56 dantti_laptop|2 joined #mojo
23:07 gizmomathboy joined #mojo
23:33 tchaves joined #mojo
23:56 ferreira joined #mojo

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