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

IRC log for #mojo, 2016-03-18

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

All times shown according to UTC.

Time Nick Message
00:05 Rubes joined #mojo
00:13 slimer joined #mojo
00:51 asarch joined #mojo
01:26 HtbaaPi joined #mojo
02:09 Rubes joined #mojo
02:19 mcsnolte joined #mojo
02:33 Rubes joined #mojo
02:46 Rubes joined #mojo
03:16 Rubes joined #mojo
03:38 noganex_ joined #mojo
03:44 Rubes joined #mojo
04:22 Rubes joined #mojo
04:32 mche joined #mojo
05:00 melo joined #mojo
05:10 Rubes joined #mojo
05:11 irqq joined #mojo
05:13 jacoby joined #mojo
05:19 inokenty-w joined #mojo
06:35 melo joined #mojo
06:56 melo1 joined #mojo
06:59 dod joined #mojo
07:03 ichi joined #mojo
07:04 dod joined #mojo
07:10 Rubes joined #mojo
07:15 dod joined #mojo
07:21 Lee_ joined #mojo
07:45 salva joined #mojo
07:52 dod joined #mojo
07:57 osfabibisi joined #mojo
08:01 Rubes joined #mojo
08:07 tyldis Any tricks to making Mojo::IOLoop::Stream repsect my setsockopt?
08:07 tyldis Writing a frontend for an embedded device which is very picky about the length and content of each TCP packet.
08:09 tyldis Maybe just do it blocking, will make it easy to throttle stuff if necessary
08:19 Vandal joined #mojo
08:25 tyldis Err, make that Mojo::IOLoop::Client
08:26 AndrewIsh joined #mojo
08:30 trone joined #mojo
08:33 tyldis Ah, calling Mojo::IOLoop->one_tick; seems to fix it somehow
08:39 Rubes joined #mojo
09:06 ashimema any tips on hunting down whats triggering this error: 'Starting Hypnotoad worker services: touch: cannot touch ‘’: No such file or directory'
09:09 irqq joined #mojo
09:09 ashimema 'tis in relation to my init script.. which I'd also be more than happy to have any comments no: https://gist.github.com/mrenvoize/d615da3127c226950609
09:12 ashimema aha..
09:12 batman https://gist.github.com/mrenvoize/d615da3127c226950609#file-list-sh-L74 ?
09:13 ashimema you beat me to it.. that's just what I'd noticed
09:13 ashimema left over from a copy paste of my minion startup script i think ;)
09:14 ashimema much better without it..
09:14 ashimema though still not entirely happy :(
09:20 ashimema any idea's why i'm now getting
09:20 ashimema https://ssl.thorsen.pm/paste/ea7b5a6e4ae6
09:20 ashimema hmm
09:20 ashimema perhaps PERL5LIB
09:21 batman sounds like /home/rebus/rebus-list/script/../local/lib/perl5/Mojolicious.pm is an old version
09:21 ashimema hmm
09:22 ashimema hmm
09:23 ashimema shouldn't be.. that's carton controlled
09:23 ashimema Mojolicious 6.56
09:23 ashimema feels like it's loading from elsewhere
09:24 ashimema ah.. I'm calling hypnotoad from /home/rebus/.plenv/versions/5.20..../whatever
09:24 ashimema so not the ../local/lib version
09:24 ashimema I bet they're not matched
10:34 HtbaaPi joined #mojo
10:36 melo joined #mojo
10:46 punter joined #mojo
11:31 sugar joined #mojo
11:41 ashimema hmm..
11:41 ashimema I've just upgraded postgres from 9.4 -> 9.5 (as required by recent minion)
11:41 ashimema Mojo::Pg is throwing an error: DBD::Pg::st execute failed: ERROR:  check constraint "args" is violated by some row at /home/rebus/rebus-list/script/../local/lib/perl5/Mojo/Pg/Database.pm line 78.
11:41 ashimema anyone got any idea's?
11:47 bpmedley ashimema : You could try the DBI_TRACE env var.
11:49 ashimema good call
11:49 ashimema though.. yikes does that give me a screenful ;)
11:50 yakudzo omg I missed it
11:50 ashimema ?
11:50 yakudzo why Mojo has own PG
11:50 yakudzo ?
11:50 ashimema non blocking love ;)
11:50 yakudzo just for async requests?
11:52 yakudzo As I remember DBD::Pg has sopport of Async requests
11:53 ribasushi yakudzo: they are adapters, they still use the DBD underneath
11:54 ribasushi yakudzo: unlike say https://metacpan.org/release/Net-Async-PostgreSQL, which does reimplement the entire wire-protocol from scratch, never touching DBI
11:56 batman yakudzo: you got Mojo::Pg, ::mysql and ::sqlite to provide an (almost) equal (non-)blocking api
11:57 batman ::SQLite is all blocking, but with a non-blocking api :-)
11:57 batman ::mysql is pretty good, but not as good as Mojo::Pg (DBD::mysql / MySQL server has som missing features)
11:58 ashimema sorted
11:58 batman sorted?
11:58 ashimema seems I had somehow ended up with duplicate jobs in my queue
11:58 batman ah. good :)
11:59 ashimema seems I'll be moving away from toadfarm afterall
11:59 ashimema seems like the cleaner approach for my use case..
11:59 batman yakudzo: all of the above use DBI/DBD though. Mojo::MySQL5 on the other hand re-implements the protocol as well
11:59 ashimema will stash Toadfarm for another day
12:00 batman ashimema: i use toadfarm mostly because of start/stop/reload actions :-)
12:00 ashimema you mean the git hooks functionality?
12:01 ashimema or the init scriptyness
12:01 batman no. /etc/init.d/my-web-app functionality
12:01 ashimema I've in effect built that now in hs ;)
12:01 ashimema s/hs/sh/
12:01 ashimema only with start/stop/reload per app :)
12:01 ashimema but still from one init script :)
12:02 * ashimema is over proud
12:02 batman cool. you should share it.
12:02 ashimema just cleaning it up, then will update that gist and share
12:02 yakudzo Ah understood. Seems like a wrapper for DBI/DBD for Async workflow.
12:02 batman yakudzo: yes. and a pretty smooth api :)
12:03 batman print $pg->db->query("select current_timestamp as now")->hash->{now};
12:19 pink_mist (that one's a blocking call though)
12:34 taichi joined #mojo
12:40 kes joined #mojo
12:46 neilhwatson joined #mojo
12:51 melo joined #mojo
13:10 sri or just read ;p http://mojolicious.org/perldoc/Mojo/Pg#DESCRIPTION
13:18 sri daredevil season 2 is out \o/
13:19 mdom Is there some easy way to always send charset=utf-8? I only found Mojo::Headers::content_type but then i also have to set the mime type and Mojolicious does fine work with setting that automatically
13:19 genio yea, I'm planning on starting DareDevil tonight!
13:19 mdom sri: I already blocked my weekend for that... :)
13:27 jacoby joined #mojo
13:28 ichi joined #mojo
13:41 gryphon joined #mojo
13:42 mcsnolte joined #mojo
14:11 mdom Ah, format => 'txt'!
14:12 Grinnz https://metacpan.org/pod/Mojolicious::Types#DESCRIPTION
14:12 Grinnz update as needed.
14:15 mdom Yeah, i found it there  ... somehow i expected it to be the default for text => 'foo', but i totally makes sense now... :)
14:16 Grinnz text => 'foo' just sends that text, the format can still be basically anything
14:16 Grinnz though I do remember being surprised that it doesn't default to format 'txt'
14:17 jberger text => 'content' really means "this is the response but it needs to be encoded before sending"
14:17 jberger where data => 'content' means similar but do not encode (utf8)
14:17 Grinnz right
14:17 jberger in that sense HTML is really text
14:17 Grinnz it's a different meaning of 'text'
14:18 jberger of course
14:20 mdom Grinnz: It does send Content-Type: text/plain but no encoding
14:21 ashimema I'm having trouble with setting MOJO_LISTEN
14:21 ashimema shuld I not be able to do the following: MOJO_CONFIG="/etc/rebus/list/bucks.conf" MOJO_LISTEN="['http://*:8000']" /home/rebus/.plenv/versions/5.20.2/bin/hypnotoad /home/rebus/rebus-list/script/rebus
14:21 ashimema and thus have hypnotoad listening on port 8000
14:22 ashimema instead, it still seems to attempt to start on 8080 and thus collides and falls over
14:22 ashimema am i doing somthing realy abviosly wrong there?
14:22 Grinnz MOJO_LISTEN is not json
14:22 ashimema no.. it's perl array aint it?
14:22 Grinnz perl arrays are not strings
14:22 Grinnz MOJO_LISTEN is just comma separated addresses IIRC
14:23 ashimema so: MOJO_LISTEN="http://*:8000"
14:23 ashimema I get the exact same issue with that
14:25 ashimema i.e. Can't create listen socket: Address already in use
14:25 ashimema but any port I try in MOJO_LISTEN yields the same..
14:25 ashimema however.. if I stop whats running on 8080.. all works and hypnotoad starts.. but on 8080 of course
14:26 ashimema hense.. i'm sure MOJO_LISTEN isn't actually getting looked at :(
14:30 ashimema this is driving me nuts..
14:30 ashimema anyone?
14:37 Grinnz I think you actually have to specify it in the hypnotoad config to override https://metacpan.org/source/Mojo::Server::Hypnotoad#L13
14:41 nic joined #mojo
14:43 ashimema so it's a hypnotoad thing.. you can't pass MOJO_LISTEN to hypnotoad.. only Mojo::Server::Daemon
14:43 ashimema :'(
14:43 ashimema looks like your right though..
14:43 ashimema I was looking at the wrong stuff
14:46 ashimema I was expressly trying to keep it out of my config :(
14:48 batman ashimema: sub startup { my $app = shift; $app->config->{hypnotoad}{listen} = [split /,/, $ENV{MOJO_LISTEN}] if $ENV{MOJO_LISTEN}; }
14:49 batman the reason it's not in hypnotoad by default is that you can't pass %ENV onto the process on hot reload
14:49 batman which would make it a bit hard to communicate
14:50 batman it = the inconsistent behaviour
14:50 PryMar56 joined #mojo
14:50 batman so the code above only works the first time you start hypnotoad.
14:50 batman do you follow?
14:51 Mikey any thoughts on allowing a Mojo::Pg object to be passed like Minion->new(Pg => Mojo::Pg->new())
14:52 meredith i'm trying to imagine when i'd want to change ports or interfaces in a hot restart and thankfully i am without ideas ;)
14:52 Mikey instead of only taking connect string/urls
14:58 ashimema hmm
14:58 ashimema I think I understand
14:58 ashimema so..
14:59 ashimema looks like i'll have to duplicate config then..
14:59 ashimema once in apache vhosts and once in the mojo app config
14:59 ashimema I hate doing that..
14:59 batman ashimema: https://www.ansible.com/ to the rescue :)
14:59 ashimema mm
15:00 ashimema but that's another hole I didn't want to have to dive into right now :(
15:00 batman all my servers are managed by ansible now. feels good :)
15:11 lluad joined #mojo
16:08 Rubes joined #mojo
16:13 HtbaaPi joined #mojo
16:48 Rubes joined #mojo
17:09 asarch joined #mojo
17:22 irqq joined #mojo
17:37 disputin joined #mojo
17:47 Rubes joined #mojo
18:01 dod joined #mojo
18:09 preaction can anyone think of any dangerous cases if i made a method that took in a hash of form name => value pairs and tested that the form contained those values? i seem to be repeating a series of tests quite a bit
18:10 preaction the problem i can see is that some fields are single-value, some are multi-value, and the ambiguity could cause bugs to creep in
18:25 preaction something like this: https://gist.github.com/preaction/a5d8227fd6d8de2f007c
18:36 disputin joined #mojo
18:49 trone joined #mojo
19:02 ichi joined #mojo
19:07 disputin joined #mojo
19:25 cpan_mojo Mojolicious-Plugin-BModel-0.09 by BCDE https://metacpan.org/release/BCDE/Mojolicious-Plugin-BModel-0.09
19:27 irqq joined #mojo
20:22 punter joined #mojo
20:50 jabberwok joined #mojo
21:59 melo joined #mojo
22:09 sri wow, this season of daredevil starts very strong
22:12 Rubes joined #mojo
22:27 zivester joined #mojo
22:32 Rubes joined #mojo
22:47 Rubes joined #mojo
22:57 Rubes joined #mojo
23:08 sugar joined #mojo
23:18 jacoby_ joined #mojo
23:19 perlpilot joined #mojo
23:19 noganex joined #mojo
23:19 FatalNIX joined #mojo
23:20 csson joined #mojo
23:22 absolut_todd joined #mojo
23:22 stuart joined #mojo
23:27 bc547 joined #mojo
23:46 Grinnz oh damn there's a new daredevil?! netflix notifications have failed me!

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