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

IRC log for #mojo, 2017-06-25

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

All times shown according to UTC.

Time Nick Message
01:04 trippeh joined #mojo
01:14 maschine joined #mojo
01:16 aborazmeh joined #mojo
01:17 schelcj joined #mojo
02:20 noganex_ joined #mojo
02:27 disputin joined #mojo
02:31 aborazmeh joined #mojo
02:37 bb9 joined #mojo
03:11 bb9 joined #mojo
03:43 karjala_ joined #mojo
04:22 bb9 joined #mojo
04:30 trwww joined #mojo
04:44 lthemick joined #mojo
05:05 brunoramos joined #mojo
06:13 dod joined #mojo
06:14 disputin joined #mojo
06:18 dod joined #mojo
07:04 dod joined #mojo
07:20 dod joined #mojo
07:43 schelcj joined #mojo
08:31 S joined #mojo
08:55 dod joined #mojo
09:56 bb9 joined #mojo
10:14 sri think i want to add a new json field to the minion_jobs table
10:14 sri imagine you want to do something like show progress information to the user, or record memory usage of every job
10:15 sri where would you store that information?
10:15 sri something like a meta field would make sense, that's a json hash and you can set arbitrary key/value data about a job at any time
10:19 sri and i guess a new event that runs in the job process when it has reached the end, like the start event runs in the beginning
10:21 sri $job->meta(rss => (BSD::Resource::getrusage())[2])
10:21 sri say $minion->job(123)->info->{meta}{rss};
10:22 sri $job->meta(progress => 0);
10:22 sri $job->meta(progress => 10);
10:23 sri $job->meta(progress => 95);
10:23 sri $job->meta(progress => 100);
10:23 sri you get the idea
10:39 dod joined #mojo
10:45 batman sri: how about "stash" ?
11:22 abra joined #mojo
11:53 sri hehehe
12:11 jberger sri I added a bucket like that for my queue at work
12:11 jberger For similar reasons
12:15 jberger We have a job that can run ~hours
12:15 jberger We needed a way to be sure that things were still running
12:20 sri what did you call it? what's your api like?
12:39 sri still think meta would make sense, since it's arbitrary meta information about the job
13:19 dod joined #mojo
14:15 nic I like the meta idea, but I would need 'progress => 25' to be supported
14:15 nic :D
14:17 sri wonder what the backend method would look like, we basically only need a setter
14:17 sri $backend->meta(foo => 'bar') is all we need
14:17 nic sri: While you're here, can I use the namespace Mojo::Roach purleez?
14:17 sri perhaps the whole thing could be called "progress"
14:18 sri nic: for?
14:18 purl for fun.
14:19 nic sri: yes, for fun and for CockroachDB
14:19 sri i guess that's fine, although Mojo::CockroachDB might make more sense
14:19 sri just for metacpan searchability
14:20 nic I'll definitely put 'CockroachDB' in the short desc, but I prefer the shorter name, and if the platform really takes off, the longer name is still available for core
14:21 nic anyway, thanks.
14:22 * sri shakes jberger
14:22 sri ANSWERS, GIVE ME ANSWERS!
14:24 bb9 joined #mojo
14:24 pink_mist sri: having a more general name than 'progress' would make more sense to me
14:25 sri "stash" would be a rather shitty name though, since it's so different from the mojo stash
14:26 sri $backend->meta(foo => 'bar') for set
14:26 sri $job->info->{meta}{foo} for get
14:27 sri (suppose $job->meta(foo => 'bar') would be there as an alias for set)
14:32 jabberwok it is the intermediate between "args" and "result", I would say neither "stash" nor "meta" seem quite right.  "progress" is better
14:33 sri that's what i thought too
14:34 sri that's definitely what it is
14:34 pink_mist but then it feels like it should only support a single number
14:34 pink_mist between 0 and 100
14:36 nic 'workings'
14:36 sri i do kinda want to allow meta to be set during enqueue too
14:37 sri ->enqueue(foo => [...] => {meta => {track_progress => 1}})
14:38 sri real arbitrary meta data that minion extensions can use for anything
14:38 hertzhaft joined #mojo
14:38 nic fwiw, I like 'meta'
14:39 sri i mean, even if the field is called "meta", the backend method could be called ->note(foo => "bar")
14:39 pink_mist I don't dislike meta but I wouldn't go so far as liking it :P
14:39 sri "Note meta information...lalala"
14:39 jabberwok 'scratchpad'? (flashbacks to RCA CDP1802 programming) hmm.
14:40 sri "notes"
14:40 jabberwok we do seem to be circling around 'meta'
14:40 sri well, i keep pushing that way
14:41 sri only thing i don't like very much is $job->meta(foo => 'bar')
14:41 sri then again, neither is ->enqueue(foo => [...] => {meta => {track_progress => 1}}) really
14:42 sri ¯\_(ツ)_/¯
15:19 cheako joined #mojo
15:29 * jberger reads back
15:29 jberger Sorry, my wife had a triathalon this morning
15:29 pink_mist oh wow, hope she did well! =)
15:30 jberger Yes indeed, mine was called progress
15:30 jberger I also had two fields, an int field and a jsonb
15:30 nic batman, Grinnz: If you, or someone you know, would like to take on the MySQL backend and give it some v2-->v7 luvin, please comment
15:31 nic https://github.com/brianmed/Minion-Backend-mysql/issues/7
15:31 nic (or if you have related opinions, of course)
15:31 jberger She did fine. This was just a local easy going race
15:32 jberger But yes she was happy with her time
15:32 nic yeah, no need to apologise about that
15:32 jberger Only apologizing bc I posted and then didn't reply
15:32 nic :)
15:33 batman nic: sorry, i'm not currently using it
15:33 jberger sri would this be on the job table or a new table?
15:33 sri well, i did this for now https://github.com/kraih/minion/commit/82f0f68fa1351c905e192ed3f99c77bf98451f62
15:33 sri jberger: see commit :)
15:33 nic batman: yeah, thought as much
15:34 jberger Yeah just reading it
15:34 jberger Mine was very different, it was a new fk related table
15:34 jberger And you get all the progress entries
15:34 jberger And append new ones
15:35 jberger But that was driven by our different needs
15:36 kaare joined #mojo
15:36 jberger And of course with jsonb applications could still implement that kind of thing with that commit
15:38 sri still interested in better naming suggestions
15:40 sri and yea, i'm not worried about limitations of the feature, jsonb makes it super versatile
15:40 jberger For how you've implemented it, I like jabberwok's "scratchpad"
15:41 jberger Or notes
15:41 sri kinda like notes and note for the method
15:43 nic sri: In Migrations::migrate, it rejects $active > $latest, but I'm wondering if it should also reject $target > $latest
15:45 sri nic: don't really care, if you do make an issue/pull request and have a vote
15:46 nic k
15:51 sri i like it more this way https://github.com/kraih/minion/commit/e5f35a1edccf9cef2cd74c2a954bd79dcb884ba5
15:52 sri $job->note(foo => 'bar') followed by $job->finish('...') just looks right
15:53 sri the whole feature https://github.com/kraih/minion/compare/78b886afa0f606492276ef9d293e136e34e5c521...e5f35a1edccf9cef2cd74c2a954bd79dcb884ba5
15:58 disputin joined #mojo
16:10 nic sri, jberger, batman, marcus: Please vote on PR https://github.com/kraih/mojo-pg/pull/43
16:11 sri nic: no test, really?
16:11 sri you can do better
16:13 jberger Just to clarify, the case that addresses is if the migration file declares versions 1-5 and the user tries to request migrating to 6 (or 10000), right?
16:21 stryx` joined #mojo
16:21 nic oh, sorry, forgot about the test
16:22 nic jberger: yes
16:22 * nic digs out a test
16:23 nic In other news, Mojo::Roach passes all of Pg's migrations.t tests  \o/
16:23 nic (not as straightforward as it sounds)
16:33 sri guess avoiding bios updates is not really an option anymore https://lists.debian.org/debian-devel/2017/06/msg00308.html
16:34 pink_mist I just got the microcode installed for that on my one box which had an affected CPU
16:34 pink_mist not 20 minutes ago
16:37 nic sri, jberger, batman, marcus: Please ignore that request to vote -- I had broken the file I was working with -- the scenario is already handled by the existing code
16:37 sri :)
17:02 jnbek joined #mojo
17:17 PryMar56 joined #mojo
17:24 cheako joined #mojo
17:33 sh14 joined #mojo
17:42 cheako joined #mojo
17:48 dod joined #mojo
17:54 marcus ack
18:16 schelcj joined #mojo
18:17 sri ok, i think this is pretty good https://github.com/kraih/minion/compare/78b886afa0f606492276ef9d293e136e34e5c521...d69742cea71d9c4532da2f3a00f832557640baf8
18:22 sri wonder if the job command should learn how to add notes :)
18:22 sri could be fun
18:23 sri like, you change notes in between retries, changing memory limits and the like
18:29 sri nic: btw. i'm still not sure what the blessed way of checking for an active lock is
18:29 sri do you have use cases that require a lot of checks?
18:30 nic ah, minion locks.  I have pg locks in my head at the mo
18:30 sri i mean, the only argument against our current ->lock('foo', -1) is that it adds an actual record to the table, which is kinda inefficient
18:30 * nic nods
18:31 sri oh shit
18:31 sri that can be optimized away in the pl/sql function
18:33 nic I'm being called to bedtime duties.  I'll follow on my phone, but won't be able to join in till later
18:33 sri https://gist.github.com/anonymous/ba26328aa96b7c823976d44c7b221a14
18:34 sri that way it signals that the lock would have been acquired, but does not store a pointless lock in the table
18:38 nic very neat solution
18:39 bb9 joined #mojo
19:04 sri and too late for comments, all released as minion 7.01
19:37 howitdo joined #mojo
20:23 nic Minion - the fast-moving job queue :)
20:26 sri and every time i think there are no more features to add :)
20:27 sri but seriously, there can't be that much left
20:29 zivester joined #mojo
21:08 nic sri: https://github.com/kraih/mojo-pg/blob/master/lib/Mojo/Pg/Database.pm#L144
21:08 nic can't that just be...?
21:09 nic return if $self->{watching}++
21:09 jberger nic only increments once
21:09 nic ah
21:09 nic thanks jberger
21:09 jberger np
21:10 jberger I only thought of that since I've had that question other places
21:11 jberger https://github.com/kraih/mojo/blob/master/lib/Mojolicious.pm#L137-L140
21:11 jberger For example
21:11 purl somebody said For example was the usage() function or the help flag managed ok ? or normally perl programmers do it in another way ?
21:11 jberger purl forget for example
21:11 purl jberger: I forgot for example
21:14 disputin joined #mojo
21:36 nic woohoo! Mojo::Roach has all tests passing.  Could be usable by the end of the week
23:04 zivester joined #mojo
23:42 bb9 joined #mojo

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