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

IRC log for #mojo, 2016-02-21

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

All times shown according to UTC.

Time Nick Message
00:28 hummeleBop joined #mojo
00:36 CandyAngel Is there a proper way to do multiple inheritance with Mojo::Base?
00:37 sri no
00:37 genio multiple inheritance is the devil, is it not?
00:37 CandyAngel Hmm..
00:37 CandyAngel Oh, hold on
00:38 CandyAngel I can inherit EventEmitter in the base class.. duh
00:38 sri if single inheritance and delegation are not enough i tend to use roles these days
00:42 CandyAngel I'm hoping I'm organising this code well.. but there is an aspect I'm really not sure of
00:42 CandyAngel I need to get better at MVC stuff I think
00:55 asarch joined #mojo
01:10 dhg joined #mojo
01:44 dhg joined #mojo
03:55 noganex_ joined #mojo
03:58 dhg left #mojo
04:27 mattp joined #mojo
04:44 kaare joined #mojo
04:51 kaare joined #mojo
06:13 davido joined #mojo
06:27 genio finally saw deadpool \o/
06:46 saki jelly
06:46 taichi joined #mojo
07:22 batman CandyAngel, chansen: i built the format into https://metacpan.org/pod/Mojolicious::Plugin::Logf
08:12 taichi joined #mojo
08:19 Vandal joined #mojo
09:01 melo joined #mojo
09:40 taichi joined #mojo
09:45 janus joined #mojo
10:03 ichi joined #mojo
10:40 renormalist joined #mojo
10:41 taichi joined #mojo
10:47 renormalist joined #mojo
11:10 bobkare joined #mojo
11:32 dod joined #mojo
12:02 sri how is "use MONKEY-SEE-NO-EVAL;" a thing in perl6? Oo
12:04 batman it sounds awful.
12:04 taichi joined #mojo
12:31 CandyAngel batman: Ah, that plugin does pretty much what I do when I use Mojo::Log anyway >.< I always sprintf stuff..
12:43 batman CandyAngel :)
13:08 batman CandyAngel: let me know if you have some more tricks that fits into the plugin
13:08 batman s/the/that/
13:10 taichi joined #mojo
13:31 batman anyone using AssetPack? please have a look at https://twitter.com/jhthorsen/status/701398745624223744
13:32 batman #feedbackwanted :)
13:32 taichi joined #mojo
13:36 asarch joined #mojo
13:37 taichi joined #mojo
13:39 pink_mist batman: s/purposed/proposed/
13:39 batman pink_mist: thanks
13:39 * batman waits a bit before pushing the changes
13:39 taichi joined #mojo
13:39 batman there's probably more, hehe
13:39 pink_mist also s/blooks/blocks/ =)
13:40 batman yeah. and s/pulic/public/
13:42 batman pink_mist: please let me know if the article has loose ends/doesn't make sense at all :/
13:42 pink_mist "The new design enable most of" <-- enables =)
13:42 pink_mist still reading, will let you know =)
13:43 taichi joined #mojo
13:45 pink_mist "finding processed assets as lot more robust" <-- a lot =)
13:45 sri batman: post it to the mailing list too
13:46 batman sri: working on it. just had to clean up a commit first...
13:46 taichi joined #mojo
13:46 batman sri: but thanks for reminding me :)
13:47 pink_mist "I much rather want to improved the process" <-- improve
13:47 batman oh. that's a silly one :(
13:48 pink_mist "The reason behind this is that it will very" <-- will be very =)
13:48 taichi joined #mojo
13:49 pink_mist "“jsx” support is incredible difficult to get right" <-- incredibly
13:49 pink_mist "Variables such as SASS_PATH is used" <-- are used =)
13:50 pink_mist "Environment and global variables is just" <-- are just =)
13:50 taichi joined #mojo
13:51 pink_mist "There are (at least) one missing features" <-- is and feature =)
13:52 batman sri: done
13:52 pink_mist "create CSS. from" <-- weird .
13:53 taichi joined #mojo
13:53 pink_mist batman: it sounds great =)
13:55 batman pink_mist: wohoo!
13:55 batman owe you a beer
13:56 batman pink_mist: https://github.com/jhthorsen/jhthorsen.github.com/commit/0a1d80d672ee51b116b275f11149f640ada02ac2 <-- hope that's all
13:57 pink_mist batman: actually
13:57 pink_mist one correction wasn't quite correct enough :P
13:57 taichi joined #mojo
13:57 pink_mist https://github.com/jhthorsen/jhthorsen.github.com/commit/0a1d80d672ee51b116b275f11149f640ada02ac2#diff-2f4ca2db104ff59e962828e668fcd7c2R169 <-- add a 'would' after 'I'
13:58 batman *done*
13:59 batman pink_mist: anything in particular you like/dislike about the change?
13:59 pink_mist https://github.com/jhthorsen/jhthorsen.github.com/commit/0a1d80d672ee51b116b275f11149f640ada02ac2#diff-2f4ca2db104ff59e962828e668fcd7c2L183 <-- also, this paragraph still reads a bit oddly, probably a runon sentence? not quite sure what to make of it
14:00 batman oh. might be merge issue from earlier :(
14:00 batman i'll look into it
14:01 pink_mist batman: for the new features the streamlining of the pipes is what seems most awesome to me, not to mention that automatic browser reload bit ... MAGIC! :P
14:02 batman cool :)
14:03 batman pink_mist: i take the "merge issue" back... can you point out what is wrong? is the sentences simply too long or does the actual point come too late..?
14:04 batman maybe remove the colon...?
14:04 pink_mist nah, the colon is fine .. I feel the issue is more with the comma earlier
14:04 pink_mist yeah, probably just remove the comma
14:04 batman ok... let me try a complete rewrite
14:04 pink_mist The reason behind this is that it will be very difficult to know which files to include when a new release of an application is installed with the standard CPAN toolchain:
14:05 pink_mist also maybe 'The reason for' instead of behind
14:09 batman pink_mist: what about this? https://ssl.thorsen.pm/paste/3562b74fc828
14:10 pink_mist that sounds good =)
14:13 batman thanks
14:43 ashimema joined #mojo
17:28 dod joined #mojo
18:14 hesh joined #mojo
19:28 stephan48 is there an easy way to wait for an Minion job to finish?
19:33 sri wait?
19:39 stephan48 something like "do { $jobstatus = $minion->job($job_id)->info->{'state'}; } while( $jobstatus ne 'failed' && $jobstatus ne 'finished' )". that would work but it does feel sort of bad and inefficient. My worker runs as another user with another set of permissions. I just want a quick fire and get result asap mechanism.
19:45 sri no
19:45 sri there was for a time, but it was removed again
19:45 stephan48 no as in there is no better solution or no as in "WARG. bad practice"?
19:46 stephan48 okey
19:47 batman stephan48: i guess this is kind of evil, but maybe you can add a trigger inside the database which can give you some sort of event...
19:48 sri not evil at all
19:49 sri that's how i would do it if i ever add it again
19:49 batman cool :)
19:49 batman stephan48: what's your backend?
19:49 stephan48 Pg
19:49 preaction stephan48: jberger has Minion::Notifier
19:50 stephan48 the only concern is hammering the backend but this can be reduced with some "sleep" statement to atleast reduce the load a little bit(50/100ms or so)
19:52 batman preaction++ # sound spot on
19:53 pink_mist stephan48: hammering the backend and using sleep both sound like very bad ideas. much better to take a look at preaction's recommendation
19:54 PryMar56 joined #mojo
19:55 stephan48 yea i just did that
19:55 stephan48 and I like it very much
19:55 sri doesn't Minion::Notifier have race conditions?
19:55 sri actually waiting for a job notification seems like a bad idea
19:56 stephan48 true
19:56 stephan48 by design you can miss job notifications
19:56 sri if i added waiting for jobs to minion again today i'd use notifications only to reduce latency, and let it poll in huge intervals, to be sure
19:56 stephan48 so it would be necessary to atleast implement a failsave
19:56 stephan48 yea
19:57 batman sri: can't you start waiting for the job, before creating it?
19:57 batman ...to avoid race conditions
19:57 stephan48 damn you sri. you are thinking quicker than I am able to type!
19:57 sri you don't have the id before
19:57 batman seems like Minion::Notifier allow you to wait for any job
19:57 sri and notifications are not guaranteed
19:57 batman yeah. that's right.
19:58 sri postgres has only limited storage for notifications
19:58 sri no guarantees, if storage runs out notifications get lost
19:58 batman stephan48: why not do Mojo::IOLoop->recurring(0.2 => sub { check_for_job($id) }); ?
19:59 stephan48 sweat!
19:59 batman where you replace 0.2 with something relative to how long you expect it to run?
19:59 sri it's just a pub/sub message bus, not a broker with guarantees, like rabbitmq or whatever
19:59 batman "sweat!" ..?
19:59 * batman doesn't follow
19:59 stephan48 i always keep forgetting about the thing that there is an eventloop
20:00 batman "relative to how long..." = no need to poll every 0.2 seconds if you don't expect it to complete until ten seconds...
20:00 stephan48 don't worry there are times where I don't follow my own thoughts
20:00 stephan48 yup
20:01 preaction that brings up a couple interesting features i could add to mercury about locking and some kind of promise/trigger that stays "on" for a given amount of time.
20:02 sri 30s+ for polling seems more reasonable
20:04 stephan48 thank you all for your help :)
20:05 batman sri: stephan48 is using minion for running a task as a different user. that doesn't mean the job takes forever.
20:05 stephan48 if the job takes more than half a second I would already call it an problem
20:05 stephan48 because even the "ipset does not exist" error is instantanious
20:06 sri batman: notifications + 30s+ polling
20:06 stephan48 ah yea
20:06 batman sri: ah
20:06 pink_mist can you add a job paused? that'd take care of the Minion::Notifier race wouldn't it?
20:07 stephan48 I think I will probably implement the notifications and a 1s polling. If the job did not finish after 2 seconds I can aswell abort it
20:07 sri pink_mist: no it wouldn't
20:07 sri there is not just one race condition
20:07 pink_mist then I must be misunderstanding the race
20:07 pink_mist ah
20:08 sri btw. i wouldn't mind considering that for minion core again
20:09 sri my $result = $minion->wait($job_id); and $minion->wait($job_id => sub { my ($minion, $result) = @_; });
20:09 sri perhaps even die on error for ->wait and an $err argument for the callback version
20:12 sri funny thing, the reason it got removed the last time doesn't exist anymore
20:12 sri which was automatic processing of jobs right when they were enqueued
20:13 sri it does still make testing hard though
20:13 sri figuring that out would take time
20:15 sri yea, minion testing would need some redesigning to make it work
20:15 sri otherwise you have your actions just block in tests
20:16 sri forever
20:16 stephan48 should I write a feature request?
20:16 sri sure
20:16 stephan48 comparing to f.e. gearman this is basically the last feature which is missing for being sort of equal featurewise
20:20 sri also a new backend method
20:20 sri since the notifications+polling are backend specific
20:20 stephan48 yup
20:21 sri it's a bigger project
20:21 stephan48 can i directly add the feature-request label? if yes how does that work?
20:21 sri no, i label stuff
20:21 stephan48 ok
20:23 stephan48 may I directly reference(copy) your lines above about the suggested API?
20:23 sri sure
20:40 ichi joined #mojo
20:45 stephan48 minion#28
20:45 stephan48 https://github.com/kraih/minion/issues/28
20:53 dhg joined #mojo
21:00 sri commented, and fixed a few typos ;)
21:02 pink_mist stephan48: you could add the irclog link too http://irclog.perlgeek.de/mojo/2016-02-21#i_12078379
21:03 stephan48 sri: ah thanks!
21:49 hummeleBop joined #mojo
22:30 * sri relabels all issues https://github.com/kraih/minion/issues
22:31 sri only the admin ui is actually a planned feature
22:31 sri everything else depends on votes and free time
23:02 hesco joined #mojo
23:14 ZoffixMobile joined #mojo
23:18 dhg joined #mojo
23:22 hesco can a Mojo::Dom object be used to select everything that a <div> tag pair might enclose, or only that tag itself, leaving me to pick through what comes after?  I need both this div and all of its descendants.  Some code and such here: https://gist.github.com/hesco/900080d9f70bc3abfc9c
23:23 preaction hesco: $dom->at() returns another Mojo::DOM object, ->text specifically gets the text of the node. perhaps you just want to stringify it?
23:25 hesco I'm testing ->render now.  ->stringify gets the next ride.  Thanks preaction.
23:27 hesco preaction: neither -render, nor ->stringify seem to be valid methods for the Mojo::DOM object which tries to call them.
23:28 preaction hesco: if $elem is your object, "$elem"
23:28 preaction or ->to_string
23:28 hesco isa_ok( $elem, 'Mojo::DOM' )?
23:29 preaction the Mojo::DOM docs mention to_string under the "stringify" section
23:29 preaction hesco: what?
23:31 sri why do you randomly try stuff instead of reading the docs?
23:33 pink_mist hesco: are you writing a unit-test?
23:34 hesco yes, thanks preaction, that works.  Sorry Sri, I have read the docs in the past, and written working code using your library, though have not in a while, I'm trying to apply lessons documented in past projects to problems of the day.
23:36 hesco pink_mist: that was a question to preaction, who was suggesting an $elem->to_string().  I was simply trying to clarify what an $elem was in his mind.
23:36 pink_mist hesco: might have been better to ask him properly
23:57 hesco perhaps so

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