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

IRC log for #mojo, 2015-09-27

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

All times shown according to UTC.

Time Nick Message
00:00 preaction indeed, that's why you need a broker
00:00 jberger I still would like to see multiplexing of topics
00:00 jberger Then you're really getting somewhere
00:00 preaction zeromq does not support that pattern, afaik
00:00 jberger But a broker command is a stroke of brilliance
00:01 jberger Well do what you have now and we'll see
00:01 preaction if you're clever with your topic heirarchy, you could probably get away with not needing more than one topic
00:01 preaction but yeah, the rest of the nanomsg patterns seem more elegant than the zeromq patterns: http://nanomsg.org/index.html
00:01 jberger I was just going to invent a little protocol
00:02 preaction maybe what you really want is a bus, a bidirectional socket where all messages go to all other connections
00:03 jberger hmmmm nanomsg looks cool, I hadn't seen that before
00:03 * jberger reads
00:03 preaction or one could implement some more state over this thing, where the server sees all the messages, and then forwards only the right ones on to the client
00:03 preaction it's the successor to zeromq
00:03 jberger preaction: yeah, that's where I was going, a bus
00:03 jberger With a filter
00:04 preaction yeah, i'm going to add the /bus and /pair and maybe a /req and /rep pattern
00:04 jberger Do this first though
00:04 jberger Do yours I mean
00:04 jberger Oh, yeah they could all just be routes
00:04 preaction so this thing lets your server processes talk to each other. then your server processes handle communicating with clients
00:04 * jberger likes
00:07 disputin joined #mojo
00:12 jberger preaction: this nanomsg vs zmq page is pretty extensive
00:12 preaction should the dist be Mojolicious-Plugin-Broker or Mojolicious-Command-Broker? or something else? Mojolicious-Broker? Mojo-Broker?
00:12 jberger Has anyone written nanmsg bindings for perl?
00:13 preaction yeah, it wasn't until a few months into the zeromq-using project that calid found nanomsg, and it was too early in development to use at that time
00:13 preaction looks like there's a NanoMsg::Raw, but no idea as to its quality
00:14 preaction it's like ZMQ::Raw looks like. very, very low-level. not nearly the kind of Perly API that ZMQ::FFI provides
00:14 jberger I'd use Mojolicious* as it uses the mojolicious websocket handling
00:14 jberger (Ie not mojo)
00:15 jberger I usually only name the dist -Command- if there is only the command
00:15 jberger Plugins often add commands, rarely the other way
00:15 preaction i'm tempted to say Mojolicious-Broker then, as it provides a broker which can be used without mojolicious, and i plan to add a plugin that makes it easier to use the broker inside mojolicious
00:16 jberger Mojolicious-Plugin-Broker would probably been my first choice
00:16 preaction we'll see if that second thing happens though. if it doesn't, no need, and then the dist names itself
00:16 jberger But if you can use it outside of a mojo app, then maybe you are right
00:16 preaction i have a fear that if startup() is called before forking, i'll need to delay the broker's socket connecting, which means some state handling in the plugin
00:17 preaction also probably the plugin would need some reconnection logic
00:20 bpmedle__ joined #mojo
01:01 sh4|2 joined #mojo
01:02 good_news_everyon joined #mojo
01:02 good_news_everyon [mojo] kraih tagged v6.22 at 4947ff5: http://git.io/vcef2
01:02 good_news_everyon left #mojo
01:04 good_news_everyon joined #mojo
01:04 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vcefw
01:04 good_news_everyon mojo/master d4cd906 Sebastian Riedel: bump version
01:04 good_news_everyon left #mojo
01:19 Adura joined #mojo
01:35 mattastrophe joined #mojo
01:44 meredith joined #mojo
01:45 ZoffixMobile joined #mojo
01:46 ZoffixMobile batman, happy Batman Day :) https://mobile.twitter.com/hashtag/batmanday
01:56 meredith finally got around to dist-upgrading this box. all it took wa[C[C[Cs about 4 emails from digitalocean "we need you to stop and reboot whether you like it or not"  >_>
02:09 ZoffixMobile :)
02:22 meredith joined #mojo
02:25 mattastrophe joined #mojo
02:38 preaction if i'm shipping this broker app, should i include the little example javascript app with it?
02:39 noganex joined #mojo
02:47 AndroUser2 joined #mojo
02:52 Zoffix Sure why not
02:53 bpmedley_ joined #mojo
02:55 bpmedley_ preaction: In regards to the Javascript app, yes, I would.  A good example makes it easier to start something new.
02:56 preaction okay. i'm thinking i should hide it behind a command-line switch. like, add "--example" to add the javascript app or something
02:56 preaction i mean, i don't think it's largely a big deal if i just leave it there all the time, so maybe i'll just do that until someone complains...
02:57 jberger preaction: just include it in ex/
02:57 jberger ?
02:58 preaction would that work? you need the broker running for it to do anything, and it needs the broker's URL, and it needs to pass the same-domain policy to work
03:01 jberger I mean in the dist's ex/ directory
03:01 bpmedley_ preaction: I think there would be confusion if the example was embedded in the code.
03:06 preaction jberger: yeah, but how would one execute it? you can't open it in a browser using file:///. you'd need to do some crazy server-side config to get it working. a switch to turn it on with the broker command would smooth all that out
03:07 preaction bpmedley_: i could put it in Mojolicious::Broker::Examples maybe?
03:08 bpmedley_ I see.  Hrmm.  Is the code available for viewing?
03:10 preaction https://gist.github.com/preaction/2078d33d87b126621e45 <-- it's the bottom of this. but as i add more patterns, i will need to add a bunch more examples
03:11 preaction specifically https://gist.github.com/preaction/2078d33d87b126621e45#file-broker-pl-L132
03:11 bpmedley_ preaction: Sorry, it might be easier if you specify the line number.
03:11 preaction heh, thinking the same thing
03:25 AndroUser2 joined #mojo
03:30 preaction ahh! i'll use -m development to do the example app. if it's anything else, no example
05:16 mattastrophe joined #mojo
05:38 kaare_ joined #mojo
05:38 davido_ joined #mojo
05:46 asm35 joined #mojo
06:02 marty_ joined #mojo
06:17 tyldis joined #mojo
06:26 davido_ joined #mojo
06:26 cpan_mojo Mojo-Webqq-1.5.0 by SJDY https://metacpan.org/release/SJDY/Mojo-Webqq-1.5.0
06:28 asm35 joined #mojo
06:43 asm35 joined #mojo
06:50 asm35 joined #mojo
07:09 cpan_mojo Mojolicious-Broker-0.001 by PREACTION https://metacpan.org/release/PREACTION/Mojolicious-Broker-0.001
07:26 panshin joined #mojo
07:42 damaya joined #mojo
07:43 bpmedley_ preaction++
07:43 damaya Hey all, what's the best way to return a single column from a single row with Mojo::Pg? I tried $db->query('select id from table where name = 'foo')->hash->{id}; but it did not work :/
07:44 damaya By did not work I mean that it returned multiple rows, and bailed out, but I'd just like the first one.
07:45 Grinnz ->hash returns one row
07:45 Grinnz or undef if there are none
07:46 batman damaya: what's the error message?
07:47 damaya can't call on an undefined value I believe was the error, but I figured it out and I'm an idiot.
07:48 damaya Also, just a quick thing, not sure if this is a bug, but Bing has a ridiculous API that is a complete a total POS.
07:48 Grinnz microsoft APIs sure are fun
07:49 damaya Anyway, it uses http basic auth, and my API key happens to have a / in it. When I do Mojo::URL->new('https://aPi/key:aPi/key@bing_url...); what I get is https://api/key:aPi/key@bing_url.
07:50 damaya In other words, the letters in API key before that / end up getting lowercased and it doesn't work.
07:51 damaya Grinnz: Seriously, Bing API is insane. Query must be capitalized, and value must be single quoted. Then format and top must have a dollar sign (i.e., $format=json&$top=10).
07:51 Grinnz userinfo needs to be URL escaped
07:51 Grinnz / is not allowed there
07:51 damaya Ah, OK. So not a bug then.
07:52 Grinnz it interpreted "aPi" as your host
07:52 damaya Wasn't really sure, so I figured I'd check. I got around it by doing $url->scheme, $url->userinfo, etc.
07:52 damaya But, say aPi was the host; is there any reason to lowercase it?
07:53 Grinnz domain names are case insensitive
07:53 Grinnz unlike the rest of the URL, usually
07:55 damaya yeah, not sure why it's being lc'd: return lc $host unless $host =~ /[^\x00-\x7f]/;
07:58 Grinnz "When a URI uses components of the generic syntax, the component   syntax equivalence rules always apply; namely, that the scheme and   host are case-insensitive and therefore should be normalized to   lowercase."
07:58 trone joined #mojo
07:58 Grinnz http://tools.ietf.org/html/rfc3986#section-6.2.2.1
08:00 damaya Ah, that makes sense then. Though it just seems odd that if it's case insensitive that it should matter at all, but if that's what the RFC spec says, then I get it.
08:11 bpmedley_ damaya: https://github.com/brianmed/CallsAbound/blob/master/lib/CallsAbound/Model.pm#L91 <-- I use this, there's probably a better way
08:12 Vandal joined #mojo
08:28 damaya bpmedley_: Nice, thank you for sharing that. I'm writing my own create_or_update subroutines and stuff like that, so I think I'll just steal your col subroutine and put it in there :D
08:31 bpmedley_ damaya: Thanks.  What do you think of the Model.pm SQL lookup methodology?
08:36 niczero joined #mojo
08:38 niczero minion is 'eventually consistent'
08:40 niczero How can we safely assume a missing job has completed?
08:40 niczero It might not have arrived yet
08:41 bpmedley_ niczero: Are you referring to a chain of jobs?
08:42 niczero yes
08:44 niczero btw, adding them as a chain doesn't work in general
08:45 bpmedley_ The assumption I'm making is that the jobs will be inserted into the DB from least dependent to most dependent.  That is, a FIFO (I think).
08:45 bpmedley_ niczero: May I ask how you're adding them?
08:45 niczero doesn't work (fifo)
08:45 bpmedley_ May I see your code?
08:49 niczero sorry, 1 sec
08:51 nic sorry, bpmedley_, systemd problems
08:51 * nic shakes fist at systemd
08:52 bpmedley_ nic: I'm not sure what to do about systemd.
08:52 nic it's been a regression on every single device I've installed it on
08:52 bpmedley_ Regression?
08:52 nic debian used to be the home of stability... and then they adopted systemd
08:54 nic right, what niczero was trying to say...
08:54 nic I might be misunderstanding what sri was saying yesterday, but I have concerns that missing-means-successful might not be safe
08:55 nic in a distributed deployment
08:55 bpmedley_ Oh dear, are y'all different people?  (nic and niczero)?
08:56 nic second concern, your adding-as-a-chain is mighty convenient, but doesn't handle all cases (eg mine)
08:57 bpmedley_ nic: Do you have some example code?
08:57 nic C depends_on A & B
08:57 nic E depends on B & D
08:58 nic Last night I got to play with a 'hello world' minion app
08:59 nic and it looks like depends_on is the only missing feature stopping me using it for real
09:00 nic (I hadn't noticed that job results are directly available within minion; last time I looked I would have to add those myself)
09:00 bpmedley_ nic: Can you use my fork'd version and show an example that fails?
09:01 nic bpmedley_: Show me how you add the example above via chains
09:06 bpmedley_ https://bitbucket.org/snippets/bpmedley/69aEg <-- This is what I currently have.  Perhaps you can modify to show for your scenario.
09:08 nic bpmedley_: I don't think you're understanding: dependencies are not linear in general
09:08 nic adding them as chains assumes they're linear, or that someone is able to linearise them
09:09 nic so fine for batches, as long as nothing else depends_on something in the batch
09:10 nic so...  I think we want/need both the method that sri suggested (individual, you need to find the job ids yourself) and the method you suggested (add as chains)
09:10 bpmedley_ I see your point.  However, that's the code I have right now.  I didn't meant to give the impression I was doing fancy dependencies.
09:10 nic I don't see those as fancy, they're the dependencies I am working with every day
09:11 nic and I'm not saying you're a bad person for proposing an incomplete solution :)
09:11 bpmedley_ What your working with is basically a tree, right?
09:11 nic I'm really just responding to sri's pondering as to whether we wanted one or the other
09:12 bpmedley_ Let me restate my sentence:  I didn't meant to give the impression I was doing non-linear dependencies.
09:13 nic bpmedley_: no, dependencies are a dag not a tree
09:13 nic (in general)
09:13 bpmedley_ Thanks for giving me the nomenclature.  I sometimes get lost in jargon.
09:14 nic it's not vocabulary, those are different things
09:14 bpmedley_ Rather, thank you for specifying the data structure.  I was ambiguous.
09:15 nic s/ambiguous/not general enough/
09:15 bpmedley_ I'll drink to that sentence.. ;)
09:16 nic I'm thinking, if depends_on was available in minion, I could implement all my complex dependencies (and every other one I've ever thought of) quite simply
09:17 nic each of my jobs would depend on it's own helper job, which would check all its dependencies
09:17 nic s/helper/guard/
09:17 bpmedley_ https://github.com/kraih/minion/compare/master...brianmed:master <-- So, you need a new sub called depends_on?
09:18 nic So all my complexity of dependencies would materialise as lots of seemingly-standalone pairs
09:21 nic bpmedley_: http://irclog.perlgeek.de/mojo/2015-09-26#i_11279384
09:25 nic One of the things making depends_on attractive is it makes job management clearer
09:25 bpmedley_ https://github.com/kraih/minion/compare/master...brianmed:master <-- Pls reload
09:26 bpmedley_ https://github.com/brianmed/minion/blob/fcea248eaa489beeff4654f57ebe82da0e51f668/lib/Minion/Backend/Pg.pm#L35
09:27 nic It's easy to identify jobs where the only problem is their preconditions haven't been met, in contrast to problems with the job itself
09:28 bpmedley_ nic: For your scenario, what would you need to see added to the Backend?
09:28 nic and it can make execution much more efficient and less confusing because all the job dependent on A aren't even attempted if A failed (eg the underlying resource is dead)
09:38 damaya I hate systemd :<
09:39 bpmedley_ Why did enterprise linux move to an unproven project?
09:39 damaya bpmedley_: I'm stealing Model.pm in its entirety :D
09:39 damaya This is awesome.
09:39 bpmedley_ damaya: That's what it's there for.  Would you consider an attribution?
09:40 damaya Sure! I will make sure the company I'm currently working for attributes it to you with a link.
09:40 damaya Though we won't be using the functionality of CallsAbound, but I will be using Models.pm
09:41 nic sri: On some postgresql deployments, this line can break integrity (because it's non-deterministic): https://github.com/kraih/minion/blob/master/lib/Minion/Backend/Pg.pm#L191
09:42 bpmedley_ That's understandable.  I wanted something I could reuse in my apps.
09:42 nic 'some deployments' eq 'any using statement-based replication'
09:42 damaya I'm also looking at using Minion for a job queueing system, for a distributed crawler, but not sure if it would work for that.
09:42 damaya I have to look into it more.
09:43 preaction why wouldn't it?
09:46 nic damaya: someone reported here (more than a year ago) using it for that, and it sounded like win
09:46 CandyAngel It works fine as a crawler
09:46 CandyAngel I use it for that
09:49 nic sri: I think if the 'order by' is "order by priority desc, created, id" it becomes deterministic
09:49 damaya nic: Awesome, I will be using it for distributed crawling with Gearman and Mojo::UA then.
09:50 damaya Actually, not Gearman, in place of Gearman I mean.
09:50 nic damaya: ah, was just about to ask that :)
09:50 damaya :P
09:50 damaya So, what's next for the Mojolicious team? An ORM?
09:50 damaya haha
09:51 nic I'm actually pondering a php client for minion so my colleagues can throw away gearman
09:51 CandyAngel <.<
09:51 CandyAngel >.>
09:51 CandyAngel PHP client?
09:51 nic worker
09:52 bpmedley_ nic: All you would need to support is enqueue, correct?
09:52 nic nope
09:52 damaya nic: Have you everHave you used Nutch at all?
09:53 nic no, hadn't heard of it
09:53 bpmedley_ I must be confused.  What else would be needed to add jobs to an already running minion?
09:53 CandyAngel Oh, I thought you meant like a UI thing for it
09:53 nic :P
09:53 damaya nic: I rather like Nutch, but it's a bit more complex than I need for this project. It's Apache's distributed crawler.
09:53 nic yeah, just read the intro
09:54 nic the thing you encounter again and again... there's little out there that's as fun to code against as Mojolicious and Minion
09:54 preaction bpmedley_: they want a php thing that will do minion tasks. a minion worker, but in php
09:54 stephen joined #mojo
09:55 bpmedley_ Wowzers
09:55 nic we pass jobs between perl and php
09:56 nic everything can enqueue to minion via mojolicious; if there was a php worker we could pass the other way too
09:56 damaya I like Java, I love Perl (Mojolicious, Minion, Moo, Mojo::Pg and DBIx::Class being my favorites).
09:57 damaya Not a big fan of PHP, Node.js, or Ruby. Those are probably my least favorites.
09:58 damaya Biggest fan of Lisp.
09:58 damaya It's the only thing I have more fun in than Perl really.
09:58 damaya preaction: Do you work with nic?
09:58 nic NEVER!
09:58 preaction uh. no
09:59 nic jberger used to, no?
09:59 preaction yes
09:59 nic so it can be done
10:00 preaction i don't recommend the experience
10:00 nic he's certainly not been the same person since
10:00 preaction yes. he's lost a lot of hope since that time...
10:01 * nic wrestles the gin bottle out of jberger's clutches
10:03 preaction eh, it is a necessary trait of a senior developer to be completely devoid of optimism. if they were any less optimistic, they'd be sysadmins
10:03 nic :D
10:07 nic bpmedley_: That patch is attractive in terms of loc, but I don't like the query
10:08 bpmedley_ nic: Understood.  I just wanted to put some code on the table as soon as possible.
10:08 nic I'd recommend benchmarking that query alone, with say 2k jobs sitting in the table
10:09 nic Does pg implement that as 1 subselect or 2?
10:09 bpmedley_ nic: Understood.  I need to rewrite to handle priorities, also.
10:09 nic To be clear, I mean bm at the db level, independent of perl & minion
10:10 nic cos that's easy, and if it fails you know it would have failed the more comprehensive test
10:11 cpan_mojo BenchmarkAnything-Storage-Frontend-HTTP-0.007 by SCHWIGON https://metacpan.org/release/SCHWIGON/BenchmarkAnything-Storage-Frontend-HTTP-0.007
10:12 nic that's an amusing coincidence of timing
10:13 nic I'm pondering an alternative tack...
10:13 nic conceptually you don't want dependent jobs considered part of the queue
10:13 nic if there's a way to freeze or lock them, that might be the route to efficiency
10:14 nic each job stores its list of outstanding dependencies
10:15 nic when a job completes, something looks for pending jobs listing that as outstanding, and removes it
10:16 nic if the last outstanding is removed, that job is back in the real queue (eg un-frozen)
10:16 nic Obvious problem, each end-of-job checking could be expensive
10:16 nic but perhaps not if an inside-out implementation was used
10:17 nic but then I don't know if any of this thinking works distributed (eventually consistent)
10:17 bpmedley_ nic: I'm not ignoring you, just not sure.. :)
10:18 nic oh, don't worry, my default irc mode is to assume everyone's got me on their ignore list :)
10:19 nic When someone complains I'm saying too much, my bot auto-replies that their ignore list must be faulty
10:21 nic Of course, we already have the solution in front of us...
10:22 nic 1. each job creates a proxy object and stores a strong ref to that in each list for the jobs it depends on
10:23 nic 2. when a job finishes, delete its list
10:23 nic 3. in the DESTROY block for that proxy object, put the real job in the real queue
10:23 nic </tongue-in-cheek>
10:25 * nic &
10:33 damaya What's the best way to get a single row if it exists? E.g., $alias_id = $db->query('select alias_id where name = ?', $alias)->hash->{alias_id}; (but if it doesn't exist I get the "Can't call... on an undefined...").
10:34 damaya Sorry if that's a terrible question, just tired and I want to get this script running before passing out :D
10:34 preaction can't call what? hash?
10:35 damaya yeah, I believe it was that.
10:35 preaction ... guessing isn't very good
10:35 damaya dog gonnit, I will test real quick :D
10:36 nic_ joined #mojo
10:36 preaction i suspect ->hash returns undef if there's nothing, so you'll get a different error
10:37 damaya Can't use an undefined value as a HASH reference at ./poologs.pl line 10.
10:37 damaya that's it
10:37 nic_ (... // {})->{..}
10:38 preaction so: my $row = ...->hash; my $id = $row ? $row->{alias_id} : return;
10:38 nic_ ($db->query->hash // {})->{id}
10:39 nic_ https://letsencrypt.org/2015/09/14/our-first-cert.html
10:40 damaya wow, that's some pretty sweet syntax
10:41 preaction doing my $row ...; return unless $row; might make what you're doing more obvious. remember: code is read 10x as much as it's written
10:41 damaya preaction: I actually did end up doing it your way just so when I read it later I know wtf I was doing, but that's still some new/sweet syntax to me.
10:41 damaya I know the // operator, but never have I seen it used like that :D
10:48 sh4 joined #mojo
10:57 batman to get the root node in a json-pointer, must i use ->get("") or ->get("/"); ? https://ssl.thorsen.pm/paste/a5b6e732bbcd
10:57 batman i was a bit surprised that "/" didn't work, but it's probably because an empty hash key is supported..?
11:34 cpan_mojo JSON-Validator-0.54 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/JSON-Validator-0.54
11:38 cpan_mojo Swagger2-0.54 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Swagger2-0.54
11:52 mattastrophe joined #mojo
12:05 jberger I do recommend the experience of working with preaction, I don't recommend the location
12:06 * jberger snags the bottle of gin back from nic
12:41 meshl joined #mojo
12:51 mattastrophe joined #mojo
12:58 cpan_mojo Mojolicious-Plugin-AssetPack-0.66 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-0.66
13:00 mattastrophe joined #mojo
13:05 mattastrophe joined #mojo
13:12 mattastrophe joined #mojo
13:13 kaare_ joined #mojo
13:17 mattastrophe joined #mojo
13:22 ajr_ joined #mojo
13:25 SmokeMachine joined #mojo
13:26 cpan_mojo Mojolicious-Plugin-AssetPack-0.67 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-0.67
13:32 absolut_todd joined #mojo
13:47 cpan_mojo Mojolicious-Plugin-Bootstrap3-3.3504 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-Bootstrap3-3.3504
13:49 cpan_mojo Mojolicious-Plugin-FontAwesome4-4.2005 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-FontAwesome4-4.2005
13:52 Lucas1 joined #mojo
13:57 Craftsmanship joined #mojo
14:01 McA joined #mojo
14:23 bpmedley joined #mojo
14:28 mattastrophe joined #mojo
14:36 gryphon joined #mojo
14:48 irqq joined #mojo
14:55 Craftsmanship joined #mojo
14:56 cpan_mojo Swagger2-0.55 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Swagger2-0.55
15:05 cpan_mojo Mojolicious-Plugin-ServerStatus-0.03 by FUKAI https://metacpan.org/release/FUKAI/Mojolicious-Plugin-ServerStatus-0.03
15:06 absolut_todd joined #mojo
15:12 bpmedley_ joined #mojo
15:14 asm35 joined #mojo
15:15 asm35 joined #mojo
15:15 PryMar56 joined #mojo
15:22 asm35 joined #mojo
15:24 asm35 joined #mojo
15:34 cpan_mojo Test-Mojo-Role-SubmitForm-1.001007 by ZOFFIX https://metacpan.org/release/ZOFFIX/Test-Mojo-Role-SubmitForm-1.001007
15:35 asarch joined #mojo
15:40 meshl joined #mojo
15:49 sri nic: i don't think job ordering in minion needs to be deterministic right now
15:49 sri in fact, we make no guarantees
15:50 sri but i guess replication is a problem to put on the list
15:50 sri for job deps
15:51 asm35 joined #mojo
16:00 mattastrophe joined #mojo
16:09 sri i feel like chrome is getting worse with every release
16:10 asm35 joined #mojo
16:10 sri scrolling around in bigger pages of the mojo docs used to be buttery smooth
16:10 sri now it's jittery
16:11 sri yet, in firefox it's still buttery smooth
16:16 sri oh, i'll have to remember this when postgres 9.5 gets released, since i doubt travis will have it right away :) https://github.com/travis-ci/travis-ci/issues/4264
16:50 bpmedley_ I wish OmniWeb was as useful as it was before.
17:19 zz_Foxcool joined #mojo
17:23 Foxcool joined #mojo
17:33 mattastrophe joined #mojo
17:41 sri hmm, skip locked seems to be hard to benchmark
17:48 PryMar56 joined #mojo
17:54 panshin joined #mojo
18:15 sri hmm, there is certainly lock contention, replacing skip locked with nowait results in failures (as expected)
18:16 sri but i can't really measure performance differences
18:16 sri my setup might not be good enough
18:39 panshin joined #mojo
18:52 sri ok, i think i might have a decent enough benchmark
19:04 sri https://gist.github.com/anonymous/241198b8de16e19c66b5
19:04 sri this one goes from 600/s to about 700/s with SKIP LOCKED
19:05 sri numbers might need adjustment depending on your hardware
19:05 sri the more workers the better for lock contestion to become visible
19:09 ZoffixWork joined #mojo
19:10 sri bpmedley_: that might be interesting for you
19:10 bpmedley_ Hrmm.  Thank you.  I'll try and work on the SQL today.
19:10 sri tested on my little macbook air, that's why the numbers are a little low
19:14 ZoffixWork What are your thoughts on -W flag for morbo to ignore certain dirs from watching? e.g: { morbo -w templates -w lib -w public/CSS -w public/JS bin/ggg.pl } would become { morbo -w . -W public/packed  bin/ggg.pl }
19:15 ZoffixWork And this is a short example. On some cases (when I use more than one SASS file?) I get a sass-cache dir in /CSS
19:15 ZoffixWork so I'd have to be listing all the file(?).
19:16 ZoffixWork How do you guys do it? My { -w . } trick alone actually doesn't work. I just never noticed morbo restarting after each request.
19:20 melo joined #mojo
19:21 sri lol, the benchmark just killed my os x
19:25 dvinciguerra_ joined #mojo
19:28 rwp joined #mojo
19:29 Craftsmanship joined #mojo
19:54 batman i wonder how i can test an event-source long-polling resource
19:54 batman can i do it with Test::Mojo directly..?
19:55 * batman looks at https://github.com/kraih/mojo/blob/master/t/mojolicious/longpolling_lite_app.t
20:52 lluad joined #mojo
21:06 damaya joined #mojo
21:50 sri just stumbled over this, really quite interesting http://johtopg.blogspot.de/2015/01/queues-queues-they-all-fall-down.html
21:51 sri there's sql examples for all kinds of job queues
22:02 sri i'm really disappointed with postgres advisory locks
22:03 sri in theory such a nice feature, but there is so many problems
22:07 cpan_mojo API-Client-0.01 by AWNCORP https://metacpan.org/release/AWNCORP/API-Client-0.01
22:13 meshl joined #mojo
22:26 lluad joined #mojo
23:02 sri hmm
23:03 * sri wonders if $job->retry should allow the priority to be changed too
23:03 sri currently we only allow a delay
23:10 CandyAngel It would allow you to slowly degrade a repeatingly failing jobs priority
23:15 sri or increase it for important jobs that might depend on a backend somehow, perhaps rate limit
23:16 sri cost is one line per backend
23:17 sri funny thing, it would just work with the job command because of the way option flags are implemented
23:23 sri not sure about it yet https://gist.github.com/anonymous/1f0b49a682f2a8d862ab
23:26 CandyAngel Looks okay to me
23:26 CandyAngel Your tests involve more line edits that the code changes :P
23:26 sri not worried about the code, just the usefulness
23:27 sri the delay option was a much easier decision
23:32 sri i guess it's consistent at least
23:33 sri hmm, a use case for increasing the priority might be when you're actually trying to debug a job and want it to be run right away
23:35 sri ok, that's multiple decent use cases

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