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

IRC log for #mojo, 2015-10-02

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

All times shown according to UTC.

Time Nick Message
00:00 jontaylor joined #mojo
00:45 jontaylor joined #mojo
00:58 mattastrophe joined #mojo
01:02 PopeFelix How do I tell if a request was made blocking or non blocking from inside an application?
01:03 PopeFelix er, inside a Mojolicious app, I mean.
01:03 PopeFelix So I guess that would be inside a route.
01:07 aborazmeh joined #mojo
01:27 disputin joined #mojo
01:34 jberger You can't
01:34 jberger You have to use the correct url for blocking or nonblocking
01:35 jberger Each has the ioloops setup correctly to handle it
01:38 asm35 joined #mojo
01:38 gaunt joined #mojo
01:39 disputin joined #mojo
01:49 PopeFelix joined #mojo
01:49 PopeFelix jberger, thanks.
01:51 PopeFelix Which means I can't currently support non-blocking requests, at least not without another means of handling playback.
01:51 PopeFelix unless I wrap build_tx.
02:05 PopeFelix No, start. I'll have to wrap start().
02:06 PopeFelix let's hope this works...
02:08 jb360 joined #mojo
02:13 PopeFelix woot!
02:13 PopeFelix That's done it.
02:26 genio my MBP is running soooo slowly after the update
02:34 noganex_ joined #mojo
02:40 kaare joined #mojo
03:02 asm35 joined #mojo
03:15 mattastrophe joined #mojo
03:37 SmokeMachine joined #mojo
03:38 bpmedley joined #mojo
03:39 forke joined #mojo
03:39 Lucas1 joined #mojo
03:39 disputin joined #mojo
04:20 inokenty-w joined #mojo
05:22 davido_ joined #mojo
05:46 * sri yawns
05:56 melo joined #mojo
06:40 dod joined #mojo
07:02 * marcus yawns more.
07:03 * marcus sips coffee.
07:40 depesz joined #mojo
07:41 depesz hi. what would be the correct way to build <a href=".."> link, using url_for, and query parameters?
07:41 depesz in template, not in perl code.
07:43 ashimema joined #mojo
07:47 sri there's actually examples http://mojolicio.us/perldoc/Mojolicious/Controller#url_for
07:54 eseyman joined #mojo
08:01 vanHoesel joined #mojo
08:03 vanHoesel1 joined #mojo
08:04 trone joined #mojo
08:10 Mattes joined #mojo
08:15 good_news_everyon joined #mojo
08:15 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vcgWw
08:15 good_news_everyon mojo/master f3902a2 Sebastian Riedel: another example for the url_for helper
08:15 good_news_everyon left #mojo
08:15 sri guess it makes sense to have that one there too
08:16 Vandal joined #mojo
09:00 meshl joined #mojo
09:03 asm35 joined #mojo
09:03 asm35 left #mojo
09:06 aborazmeh joined #mojo
09:25 depesz sri: (sorry for lag - lost power/internet at home a moment after I asked :( - the example seemst o be in perl code, not in templates. so would template code be <=% url_for( 'a' )->query( ... ) %> ?
09:32 gaunt_ joined #mojo
09:35 sri depesz: i just committed that exact example :)
09:36 depesz thanks, sri.
09:36 sri btw. there's no big difference between templates and controllers
09:36 sri you could just as well write <%= $c->url_for(...)->query(...) %>
09:37 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Helpers
09:46 mattastrophe joined #mojo
09:59 jontaylor joined #mojo
10:04 stephen joined #mojo
10:09 sue joined #mojo
10:11 * sri wonders if list_jobs should have a queue option too
10:12 sri guess we'll wait until a web ui actually needs it
10:13 sri not having a list of all active queues might also turn out to be tricky
10:14 sri jberger: btw. using postgres 9.5 features will be nice, but not *that* important, SKIP LOCKED only increases performance by about 10-30%
10:15 sri at least in the benchmarks i found and conducted
10:18 sri (so, not in a hurry to release minion 3 if postgres 9.5 comes out soon)
10:28 melo joined #mojo
10:32 aborazmeh joined #mojo
10:52 mishanti1 I like he "Find someone with enough experience to pair and design an async DBIC sub-interface, and then implement it" bullet item in the ribasushi tilt-campaign.
10:52 mishanti1 s/he/the/
10:57 dvinciguerra joined #mojo
11:03 depesz left #mojo
11:04 aborazmeh joined #mojo
11:18 melo1 joined #mojo
11:19 fvox joined #mojo
11:22 Lee joined #mojo
11:51 hernan605 joined #mojo
11:58 Martin90 joined #mojo
11:58 asm35 joined #mojo
11:59 mattastrophe joined #mojo
12:00 Jonis -win 4
12:03 * pink_mist now wonders which window /this/ is
12:10 bd pink_mist: 52
12:15 neilhwatson joined #mojo
12:16 Dada joined #mojo
12:18 Dada joined #mojo
12:19 asm35 joined #mojo
12:19 Martin90 joined #mojo
12:19 dvinciguerra joined #mojo
12:19 sue joined #mojo
12:19 gaunt_ joined #mojo
12:19 vanHoesel1 joined #mojo
12:19 inokenty-w joined #mojo
12:19 kaare joined #mojo
12:19 CromeDome joined #mojo
12:19 geheimnis` joined #mojo
12:19 mtj joined #mojo
12:19 bc547_ joined #mojo
12:19 jantore joined #mojo
12:19 HtbaaPi joined #mojo
12:19 mudler joined #mojo
12:19 nic joined #mojo
12:19 hernan604 joined #mojo
12:19 Mikey joined #mojo
12:19 tyldum joined #mojo
12:19 stephan48 joined #mojo
12:19 sri joined #mojo
12:19 vytas joined #mojo
12:19 kivilahtio joined #mojo
12:19 cstamas joined #mojo
12:19 KindOne joined #mojo
12:19 dustinm joined #mojo
12:19 gabiruh joined #mojo
12:19 marcusr joined #mojo
12:19 Onigiri joined #mojo
12:19 mishanti1 joined #mojo
12:19 mgrimes joined #mojo
12:19 augensalat joined #mojo
12:19 renormalist joined #mojo
12:19 crab joined #mojo
12:19 bowtie joined #mojo
12:19 romel joined #mojo
12:19 inokenty joined #mojo
12:19 janus joined #mojo
12:19 tianon joined #mojo
12:19 dysfun joined #mojo
12:19 Snelius joined #mojo
12:19 BinGOs joined #mojo
12:19 garu joined #mojo
12:19 lestrrat joined #mojo
12:19 phillipadsmith joined #mojo
12:19 charsbar joined #mojo
12:19 Phil21 joined #mojo
12:19 jwang joined #mojo
12:19 mikegrb joined #mojo
12:19 ashleyde1 joined #mojo
12:19 bjakubski joined #mojo
12:19 upasana_ joined #mojo
12:19 cfedde joined #mojo
12:19 omega joined #mojo
12:19 Zx3 joined #mojo
12:19 eduardow joined #mojo
12:19 lupi_ joined #mojo
12:19 al_ joined #mojo
12:19 esh joined #mojo
12:19 firnsy joined #mojo
12:19 chansen joined #mojo
12:19 worklapperl joined #mojo
12:19 skaji joined #mojo
12:19 caeles joined #mojo
12:19 tinita joined #mojo
12:19 bzero joined #mojo
12:19 allison joined #mojo
12:19 salparadise joined #mojo
12:19 abracadaniel joined #mojo
12:19 Quai joined #mojo
12:19 tempire joined #mojo
12:19 spicyjack joined #mojo
12:19 btyler joined #mojo
12:19 sivoais joined #mojo
12:19 stokachu joined #mojo
12:19 diegok joined #mojo
12:19 sawtooth joined #mojo
12:19 stuart joined #mojo
12:20 mattastrophe joined #mojo
12:20 stephen joined #mojo
12:20 Vandal joined #mojo
12:20 eseyman joined #mojo
12:20 dod joined #mojo
12:20 jb360 joined #mojo
12:20 dabudabu joined #mojo
12:20 lsm joined #mojo
12:20 absolut_todd joined #mojo
12:20 buu joined #mojo
12:20 batman joined #mojo
12:20 McA joined #mojo
12:20 dotan joined #mojo
12:20 salva joined #mojo
12:20 kmx joined #mojo
12:20 bpmedley_ joined #mojo
12:20 odc joined #mojo
12:20 Janos joined #mojo
12:20 Foxcool joined #mojo
12:20 jberger joined #mojo
12:20 Ralesk joined #mojo
12:20 bayashi joined #mojo
12:20 coolo joined #mojo
12:20 bobkare joined #mojo
12:20 mattp joined #mojo
12:20 ssm joined #mojo
12:20 lb joined #mojo
12:20 hahainternet joined #mojo
12:20 kwa joined #mojo
12:20 robinsmidsrod joined #mojo
12:25 Dada_is_crazy joined #mojo
12:33 Jonis pink_mist: 14
12:37 nic weird, here it's saying 19
12:39 ajr_ joined #mojo
12:43 tcohen joined #mojo
12:57 Lucas1 joined #mojo
12:57 bpmedley joined #mojo
13:03 SmokeMachine joined #mojo
13:03 asm35 left #mojo
13:10 panshin joined #mojo
13:11 jberger mine's broken :( "/win Unknown command. Type /help to see available commands."
13:13 bd pink_mist: alternatively alt-m
13:14 Grinnz jberger, guess we're just not winners
13:14 mishanti1 badum-tsh
13:21 mattastrophe joined #mojo
13:25 Mattes joined #mojo
13:27 panshin_ joined #mojo
13:29 bd Grinnz: well im cheating, chanact renumbers windows ;)
13:32 arthas joined #mojo
13:33 neilhwatson joined #mojo
13:36 gaunt_ I'm building a mojo application that uses DBIx::Class with DBD::mysql. Some db queries last a few seconds, which is nothing that I can currently change. Since DBD::mysql is blocking, this would potentially block other users of the same worker and I should go with a number of workers and restrict each of them to a single client. Is this correct?
13:41 sri DBD::mysql does support non-blocking, DBIx::Class doesn't though
13:44 Grinnz_ that is correct though, you can increase the number of workers to compensate, or if you want to try an ORM that supports non-blocking, you can use https://metacpan.org/pod/Mad::Mapper with Mojo::mysql
13:51 gaunt_ Looks interesting.
13:53 Grinnz_ another option which I use is to fork_call really long queries with Mojo::IOLoop::ForkCall, you just have to get a new database handle in the fork (don't remember if DBIx::Class handles that)
13:54 Grinnz_ (and make sure AutoInactiveDestroy is set)
13:55 jberger wasn't DBIx::Connector extracted from DBIC?
13:57 jberger hmmm, maybe not
13:57 * jberger summons the ribasushi
13:57 Kogurr joined #mojo
13:59 gaunt_ Mad::Mapper looks promising, but it seems like it has a way to go before it can replace DBIx::Class for me. I'll keep fork_call in mind. I think I know how I would have to renew the database handle.
14:01 jberger I can't wait until I don't have to ask this, but, ...
14:01 jberger gaunt_: are you on windows?
14:01 jberger be careful with fork_call on windows, it might work on recent perls, it might not
14:01 jberger :s
14:02 jberger I should renew my bounty on that bug
14:04 gaunt_ no, this will be linux-only. I try not to touch windows.
14:05 Grinnz_ a good policy in general
14:05 jberger cool
14:06 jberger in principle, it should work on windows, in practice, well that's another thing
14:06 eseyman left #mojo
14:07 eseyman joined #mojo
14:14 dod joined #mojo
14:15 sri minion failed a test on windows too :( http://www.cpantesters.org/cpan/report/b7dd846c-6bf3-1014-9536-d9209350454e
14:20 sri does usleep(0.5 * 1000000) not work portably on windows?
14:22 lluad joined #mojo
14:22 sri perl -MTime::HiRes=usleep -E 'say usleep(0.5 * 1000000)'
14:22 sri should say something above 500000
14:25 Adurah Can't find string terminator "'" anywhere before EOF at -e line 1.
14:25 Adurah It installed fine here, though. heh
14:28 sri may very well just be a floating point math problem
14:29 Grinnz_ Adurah: try with -E'
14:29 Grinnz_ not sure about the quoting rules in cmd.exe
14:30 Adurah Well, double quotes give just under 500000.
14:32 sri i guess if i lower the check to 0.4 it will work better
14:38 CandyAngel sri: do you mean that you'll be able to pass in a list of queue names to list jobs from?
14:39 CandyAngel Because my crawler would definitely use that
14:39 CandyAngel (once I update it to queues)
14:39 sue joined #mojo
14:40 PryMar56 joined #mojo
14:41 gryphon joined #mojo
14:42 sri CandyAngel: just one queue
14:43 sri same as for task and state now
14:43 sri there is something that bugs me about the whole idea though, and i can't say what exactly yet
14:45 PopeFelix joined #mojo
14:45 sri maybe it's that we don't have an actual list of queues
14:45 sri so integration into a ui could be tricky
14:47 CandyAngel Oh, you mean you can't get a list of queues present so you present a dropdown?
14:48 sri you can't do that, yea
14:48 PopeF joined #mojo
14:48 sri you'd need a text field
14:49 sri for tasks and states we know all the possibilities
14:51 CandyAngel Well unless the queue name is specified by the end user, all the queue names are known by the coder
14:51 CandyAngel And can be listed in a helper
14:51 sri i would hope anyone putting that much effort into ui will open source it
14:52 sri so it should be generic
14:52 CandyAngel Oh, you mean a general minion UI
14:52 CandyAngel I was just thinking of my crawler UI
14:52 sri ah
14:53 sri i guess ->stats could include a list of active tasks and queues
14:53 sri would be bad for performance though
14:54 sri since i imagine a good ui would pull ->stats in regular intervals to draw nice diagrams
14:55 CandyAngel Would it be bad for it to maintain a table of them? Like a in-db cache?
14:55 sri you mean a separate table?
14:55 CandyAngel Yeah, for keeping track of task names (and hwo many tasks with that name)
14:55 CandyAngel And for queues
14:55 sri that sounds horribly complicated
14:56 CandyAngel Sounds like something you could give to a minion job (querying it for cached lookup :P)
14:57 ZoffixWork joined #mojo
14:57 jberger this is my minion monitor btw
14:57 sri it's not a cache
14:57 jberger https://github.com/jberger/Minion-Command-minion-monitor
14:57 jberger I still had some refactoring I wanted to do
14:57 ZoffixWork sri, tests still fail, though more rarely. Took me about 8 runs of prove to get the first fail.
14:57 sri for real-time stats you want fresh data all the time
14:57 jberger and the frontend isn't as nice as it should be
14:57 sri caching defeats the purpose
14:58 sri ZoffixWork: how odd
14:59 ZoffixWork sri, oh wait. I think I may have checkout the wrong thing. Wait
14:59 * CandyAngel shrugs
15:00 CandyAngel Sometimes realtime means slow, that's why caches are a thing
15:00 CandyAngel Not like you wouldn't be able to just reschedule the 'find the names' job as often as you want
15:00 sri ZoffixWork: fingers crossed
15:00 CandyAngel Err
15:00 CandyAngel Sometimes '100% up to date' means slow*
15:02 CandyAngel Isn't 'stats' slow anyway because it needs to query all the jobs?
15:02 ZoffixWork sri, I was wrong. I typed "git checkout HEAD" instead of "git checkout master". Ran prove 20 times; all passed
15:03 sri ZoffixWork: \o/
15:04 sri CandyAngel: shouldn't be slow, most operations use indexes
15:04 CandyAngel Then why would getting queue names be slow..?
15:05 CandyAngel Myabe I should look at the schema
15:05 sri there is no index on the queueue names
15:05 sri s/eu//
15:06 sri https://github.com/kraih/minion/blob/master/lib/Minion/Backend/Pg.pm#L563
15:07 PopeF Is there a nice fork/exec helper in Mojo somewhere? I'd like to spawn an instance of Mojo::Server::Daemon inside a unit test.
15:07 disputin joined #mojo
15:15 cpan_mojo Minion-2.01 by SRI https://metacpan.org/release/SRI/Minion-2.01
15:17 * sri doesn't see a clean way to do job listing with queues, so won't do anything about it for now
15:17 sri of course, as always, proposals welcome
15:17 sri just make sure they cover the job command as well
15:19 sri i guess ->list_jobs is probably the weakest spot in the api
15:23 sri http://mojolicio.us/perldoc/Minion/Backend/Pg#list_jobs
15:23 * sri can't think of something better though
15:23 sri (keep in mind this has to work for all sorts of storage backends, not just sql)
15:30 jberger PopeF: ummmm why?
15:30 jberger that's what the nb_url is for
15:31 PopeF jberger, I'm not sure I follow you.  Are you suggesting I just do $ua->server->app($app) for my local app?
15:32 PopeF Otherwise I'm lost. :)
15:33 jberger this follows yesterday when your test was blocking itself right?
15:34 PopeFelix jberger, yes and no. I solved the problem yesterday by wrapping $ua->start.  But I'm still handling playback via an internal Mojolicious instance.
15:38 PopeFelix To be more precise, I determine whether a given request is blocking or not by overriding Mojo::UserAgent::Start and setting a flag if I was passed a code block.
15:38 jberger if you see that it was called nonblocking, you need to use the ua->server->nb_url rather than ua->server->url
15:38 PopeFelix Right.
15:38 PopeFelix And i'm doing that.
15:38 PopeFelix That's not the problem.
15:38 jberger so what isn't working?
15:39 PopeFelix The problem is that I want to construct a local app inside a unit test that my UA can connect to. But I can't just do $ua->server->app($local_app), because the playback functionality depends on an internal Mojolicious instance.
15:46 * jberger brain esplode
15:49 PopeFelix jberger, if you have a better idea, i'd love to hear it.
15:49 jberger I barely understand what you are trying to accomplish let alone how this test ought to work :-P
15:49 PopeFelix OK.
15:50 PopeFelix This module records and plays back HTTP exchanges in a manner similar to LWP::UserAgent::Mockable.
15:51 jberger I've heard you explain it before, I think my problem is that it is so different than what I would likely do that I can't put it into context for myself
15:51 PopeFelix What would you be likely to do?
15:51 jberger rather than record and replay a request, just make the same request multiple times
15:52 jberger I would do the "recording" manually
15:52 jberger as I did with my shipping module, which I think was the original impetus for most of this right?
15:53 jberger I'm not saying what you are doing is wrong, I just can't give you advice anymore :-P
15:53 PopeFelix jberger, no worries.
15:53 PopeFelix The impetus for this is really that we use Mojo::UA a lot at work, and for a variety of different web services.
15:54 PopeFelix And we don't want to be talking to these various and sundry services every time we want to test a thing.
15:55 zackiv31 joined #mojo
15:55 PopeFelix So we mock it up.  But to ensure that we are coding to what the web service actually sends, rather than what we think it sends, we record the interchange.
15:58 jberger sure
16:01 PopeFelix I'd love to get away from the internal Mojolicious app, but I don't know how. :(
16:02 PopeFelix Also, I suspect that my cookies aren't working right, but that's something I can probably fix.
16:02 eduardow PopeFelix: what is the problem with your cookies?
16:03 * eduardow hates cookies
16:03 PopeFelix I don't think the UA is respecting the 'Set-Cookie' header sent in playback.
16:04 eduardow ohh .. got you ... I didnt read the backlog
16:05 berov left #mojo
16:06 kivilahtio_ joined #mojo
16:06 gryphon joined #mojo
16:11 jontaylor joined #mojo
16:14 dod joined #mojo
16:15 sri interesting strategy from phoenix framework, they are making clients for their channel abstraction for many different langauges now, like java, objc, swift, js...
16:19 hernan605 joined #mojo
16:21 CromeDome left #mojo
16:26 Dada_is_crazy Hi. I should be able to use a switch in a template right? I just need a % use Switch, then i can use it? (I ask because I'm having trouble with it.. )
16:26 Grinnz_ don't use Switch, it's terrible
16:26 Grinnz_ try Switch::Plain
16:27 Dada_is_crazy roger, thx !
16:27 Grinnz_ Switch is a source filter so will cause weird issues, and using in a template file is bound to screw everything up
16:27 Dada_is_crazy why is it terrible btw? performances?
16:27 Dada_is_crazy oh ok
16:28 melo joined #mojo
16:32 jb360 joined #mojo
16:38 meshl joined #mojo
16:47 jberger yeah, using Switch in a template sounds like a very bad idea
16:48 jberger I have no idea how Switch::Plain (a keyword api module) would work
16:48 jberger its worth a try I suppose
16:49 sri switch in a template sounds terrible
16:50 sri don't put complicated logic into templates
16:50 Grinnz that too
16:53 jberger I'm on the fence about something
16:53 genio There are a surprising amount of things in the CPAN that are dependent upon Switch
16:53 jberger I'm adding ASCII-art tables to ReplyTable (via Text::Table::Tiny)
16:53 jberger I'm making it an optional dependency
16:54 ajr_ joined #mojo
16:54 jberger if it isn't available it falls back to Mojo::Util::tablify
16:54 jberger question: should I have an option to let it do that even if it is installed?
16:55 lluad If it's trivial to do, yes, I think so.
16:55 jberger I note in the documentation that the text format is intended for human consumption and its format shouldn't be relied upon
16:55 lluad But NBD either way.
16:55 jberger see, I'm stuck in so much NBD that I can't decide either way!
16:59 sh4 joined #mojo
17:00 Martin90 joined #mojo
17:04 PopeFelix Would it be fun?
17:06 preaction work's not supposed to be fun!
17:10 lsm joined #mojo
17:15 zackiv31 joined #mojo
17:17 mattastrophe joined #mojo
17:30 cpan_mojo Mojolicious-Plugin-ReplyTable-0.05 by JBERGER https://metacpan.org/release/JBERGER/Mojolicious-Plugin-ReplyTable-0.05
17:32 mattastrophe joined #mojo
17:33 Mattes joined #mojo
17:40 mattastrophe joined #mojo
17:44 ZoffixWork joined #mojo
17:56 PopeFelix Well, just ended up doing fork() and running the server that way.
18:00 trone joined #mojo
18:06 hernan605 joined #mojo
18:13 Martin90 PopeFelix, what's wrong ?
18:20 panshin joined #mojo
18:20 * jberger starts the upgrade
18:21 jberger Oh el captain, my el captain
18:25 hernan605 joined #mojo
18:25 disputin joined #mojo
18:29 PopeFelix Martin90, I wanted to run a Mojo::Server instance inside a unit test for Mojo::UserAgent::Mockable.
18:30 PopeFelix And for architectural reasons, I can't just create a Mojolicious app and attach it to the UA.
18:33 sri PopeFelix: sounds like you're doing something wrong
18:34 sri there should never be a reason to run Mojo::Server::Daemon in a forked process
18:34 PopeFelix I may well be.  But I don't know how to do it right.
18:35 shadowpaste "PopeFelix" at 217.168.150.38 pasted "Forking" (46 lines) at http://paste.scsys.co.uk/499778
18:35 sri eeeep, even hardcoded ports
18:36 PopeFelix sri, yes, for purposes of the sketch.
18:37 sri there's lots of examples here https://github.com/kraih/mojo/blob/master/t/mojo/daemon.t
18:37 sri no need to fork, ever
18:38 sri this might be the part you need https://github.com/kraih/mojo/blob/master/t/mojo/daemon.t#L108
18:38 PopeFelix Nope.
18:39 PopeFelix If I could do $ua->server->app, I would, because that's way easier than going through all this forking jiggery pokery.
18:40 PopeFelix But MUA::Mockable relies on an internal Mojolicious app to service requests in playback mode.
18:40 sri that doesn't matter
18:40 PopeFelix ?
18:41 sri you can make as many daemon instances as you like and attach them to the same ioloop
18:41 sri $ua->server is only for relative URLs, but you can have as many other daemons as you like inside the same process
18:42 sri what's the point of an event loop if you couldn't?
18:42 PopeFelix So let me make sure I understand this properly.
18:44 PopeFelix Something like you're doing at https://github.com/kraih/mojo/blob/master/t/mojo/daemon.t#L232
18:44 PopeFelix ?
18:45 sri there's better examples here https://github.com/kraih/mojo/blob/master/t/mojo/user_agent_tls.t
18:45 sri even with dynamic ports
18:47 PopeFelix OK, thanks, sri. I think that will help.
18:51 PopeFelix but now, etwas essen.
18:56 amon joined #mojo
19:05 Lee joined #mojo
19:06 dod joined #mojo
19:14 bpmedley_ So, what's the best way to share the config file format between scripts that are not necessarily a good fit as a Mojolicious::Lite app?  Should an app object be created to use the Config plugin?
19:14 bpmedley_ Something like: my $app = __PACKAGE__->new(moniker => lc(basename($0, (".pl"))));
19:18 jberger bpmedley_: there is an example
19:19 jberger http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Application-embedding
19:20 CandyAngel Is appliction embedding something you would use if your site had like.. a wiki area, a blog area, a gallery area etc?
19:20 CandyAngel So they could be separated
19:21 bpmedley_ Hrmm.  What if the scripts are on different hosts and I don't have the original app - just a config file?
19:22 jberger CandyAngel: then you want "mount"ing
19:23 jberger bpmedley_: yeah, then I'd just make a dummy app
19:28 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Mount-applications
19:28 bpmedley_ CandyAngel: Not sure if this is helpful; however, I use something like this: https://bitbucket.org/snippets/bpmedley/pL97e
20:01 CandyAngel I see
20:01 CandyAngel A friend of mine is about to implement his website in Mojo and he'll be looking to be able to do that
20:02 CandyAngel Logging in will log into the site, but each part of it separate, preferably
20:02 jberger there is also ToadFarm
20:02 CandyAngel So the blog part can be updated separately (and used by others, as the source will be available)
20:03 good_news_everyon joined #mojo
20:03 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vcVjd
20:03 good_news_everyon mojo/master c169570 Sebastian Riedel: highlight dt elements a little more
20:03 good_news_everyon left #mojo
20:03 jberger CandyAngel: see also Statocles
20:03 jberger (re blog)
20:04 batman CandyAngel: https://metacpan.org/release/Toadfarm
20:04 CandyAngel I'll pass these on, thankies :)
20:10 ribasushi jberger: just noticed the highlight
20:11 ribasushi what is the question exactly?
20:11 jberger oh, it was about DBIx::Class and fork safety
20:11 ribasushi jberger: generally DBIC is 100% fork-safe
20:12 ribasushi there is a small issue with fork-during-statement-in-progress
20:12 jberger I assumed it would be
20:12 jberger I don't think that was the question
20:12 ribasushi i.e. ->fetchrow => fork => ->fetchrow on the same thing
20:12 ribasushi which I haven't fixed yet, because doing it without a perf penalty is tough
20:12 ribasushi but that's the only known issue afaik
20:13 jberger gaunt_ (cc Grinnz): ^^
20:13 jberger ribasushi: thanks
20:13 Grinnz_ fork safety in mid fetch is something i'd consider "only an issue if you're doing somethign real weird"
20:14 ribasushi Grinnz_: it's not really weird as a use case
20:14 ribasushi consider streaming in a large resultset and firing off new children to gnarl on a part of the set and then have them exit
20:15 ribasushi saves on the IPC between parent'child
20:16 Grinnz_ i suppose
20:16 Grinnz_ but you can also save on that by just reading everything into a data structure before forking :P
20:16 ribasushi <ribasushi> consider streaming in a large resultset <--- this clearly won't fit in memory
20:16 Grinnz_ oh, that kind of large
20:18 melo joined #mojo
20:18 hernan605 joined #mojo
20:18 ribasushi anyway &
20:18 jberger ribasushi: \o and thanks
20:22 PopeFelix You know, I don't know about Statocles. Seems like it'd leave a sword hanging over your head...
20:23 jberger nah, preaction is much more subtle than that
20:23 jberger I mean, if he wants to get you, you're pretty much a goner, but you're not going to know about it and he's not serving any time
20:24 jberger :-P
20:24 PopeFelix ;)
20:25 good_news_everyon joined #mojo
20:25 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vcwLC
20:25 good_news_everyon mojo/master a2b56df Sebastian Riedel: more consistent indentation
20:25 good_news_everyon left #mojo
20:33 jberger hmmmm, rereading Minion::Command::minion::monitor
20:33 jberger I don't want this to die on the vine
20:33 jberger the front-end is still clunky
20:34 jberger and it does come up with Mojo 6.22 and Minion 2.x
20:34 jberger of course it doesn't have queue functionality
20:48 good_news_everyon joined #mojo
20:48 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vcwCd
20:48 good_news_everyon mojo/master 6e6f979 Sebastian Riedel: slightly less consistent indentation
20:48 good_news_everyon left #mojo
20:52 Grinnz_ lol
20:54 CandyAngel Is it usual to commit code to a repo that isn't used (yet) by anything (except the test suite)?
20:54 asarch joined #mojo
20:57 * jberger renames repo: https://github.com/jberger/Minion-Monitor
20:57 Grinnz_ what denotes a repo as "used by something"?
20:58 CandyAngel I mean, the code isn't used by anything
20:58 Grinnz_ or you mean the code isn't used
20:58 CandyAngel So like
20:58 Grinnz_ lol
20:58 Grinnz_ sure why not
20:58 Grinnz_ repos are free-ish
20:58 CandyAngel Say you have a parser that takes CSV files and makes some objects with that data
20:58 CandyAngel Rather than commit the parser and the object class at the same time, the object class would be commited first (but unused) with its test suite
20:59 CandyAngel then the parser would be commited
20:59 jberger CandyAngel: I don't think that matters
20:59 jberger you need more OCD than I've got to need it I guess
20:59 Grinnz_ lol
21:00 jberger also, obligatory self-promotion: https://metacpan.org/pod/Tie::Array::CSV
21:00 jberger (my favorite CPAN module, still)
21:00 jberger (of my own authorship I should say)
21:03 CandyAngel Meh, if it can handle the terrible output files I get, I'll use it
21:03 CandyAngel I have to do a bunch of handholding of Text::CSV to parse them
21:04 CandyAngel Because it has a multi-line header, blank rows, blank starting column, duplicate headers.. >.<
21:04 Grinnz_ and this is why i avoid CSV
21:04 Grinnz_ it's about as standardized as INI
21:05 jberger CandyAngel: hmmm, maybe not then :s
21:05 jberger it uses Text::CSV under the hood, but it doesn't handle multiline fields
21:05 Grinnz_ kind of stuck with INI though
21:05 jberger Grinnz_: only because you use that zilla 'o yourn
21:06 Grinnz_ i mean in general
21:06 Grinnz_ INI is really the only choice for a human writable format
21:07 CandyAngel Grinnz_: It isn't CSV's fault, its the system that exports it
21:07 CandyAngel It sucks :P
21:07 CandyAngel A lot
21:07 CandyAngel Foooor example
21:07 CandyAngel if you export it to a file, the header changes.. depending on how wide the column is in the preview
21:08 Grinnz_ lol
21:08 jberger oh ... my ....
21:08 CandyAngel I've asked for database access but they won't let me because "you might break something"
21:08 * sri still wishes he had time to do a proper minion ui
21:08 CandyAngel Yeah, totally going ot break something wiht readonly access
21:09 jberger sri: have you tried the monitor?
21:09 sri jberger: nope, just seen your screenshots i believe
21:09 jberger I really should learn angular at some point
21:10 jberger preaction: want to hack-a-thon on angular version of minion monitor at some point?
21:10 jberger then we'll hand it over to tempire for some shiny
21:10 preaction sure
21:11 jberger we should pick some weekend day and hole up in a coffee shop
21:11 * sri wants a cool dashboard like https://raw.githubusercontent.com/mperham/sidekiq/master/examples/web-ui.png
21:11 jberger sri: does that keep its own stats or does it just use the available data
21:11 jberger ?
21:12 jberger currently mine just uses what's in the db, ie, if you remove a job I don't have its stats anymore
21:12 sri don't know
21:12 jberger would using the data as-is be sufficient, in your view?
21:12 sri don't know
21:14 sri long term stats are not that interesting i guess
21:15 sri but currently active workers on the other hand is quite interesting
21:24 PryMar56 joined #mojo
21:26 preaction funny enough, i've written a job-runner monitor website already at $work. nobody uses it, because the jobs it monitors are the legacy jobs (hundreds of them that must work, but nobody likes being reminded that these jobs exist)
21:27 zackiv31 joined #mojo
21:30 preaction its main purpose is to show, in three columns, the list of currently-running jobs, the list of recently-completed jobs, and the list of jobs that had errors. clicking on the job gives details, including configuration and logs. is that about what y'all mean?
21:31 preaction ($work also needs to know data source and data destination and other kind of details, but if the monitor's templates are editable, we can allow things like that)
21:31 sri yes
21:39 meshl joined #mojo
21:50 sri i wouldn't mind something as simple as the kue ui with a dashboard for current activity added https://www.topcoder.com/wp-content/uploads/2015/07/grepstarBlog4_pic5.png
21:50 meshl joined #mojo
21:51 dvinciguerra joined #mojo
21:52 preaction i can take some time before jberger and i's hackathon and come up with some mockups. what info we want will likely inform what apis we need. but do keep throwing out examples for inspiration, thanks
21:52 jberger preaction: keep in mind that I do already have something
21:53 jberger not that we need to keep any of it
21:53 jberger (I'm actually tinkering now, to see if I can get retry with options working)
21:53 preaction yep. though i guess then what are you specifically looking for help with?
21:53 sri what i like about the kue ui is that it's all built around a json api https://github.com/Automattic/kue/blob/master/lib/http/index.js#L51
21:53 meshl joined #mojo
21:53 jberger preaction: making the frontend nicely responsive
21:54 sri very clean
21:54 jberger what I have now is hacked together with rivets js, and though I like rivets it feels like I'm already pushing the boundary of what it (or I) can do
21:54 jberger sri: that's part of my design already
21:55 preaction ah. do you have a restful backend already?
21:55 jberger https://github.com/jberger/Minion-Monitor/blob/master/lib/Minion/Monitor.pm
21:56 sri needs a controller
21:56 Grinnz_ http://news.xbox.com/~/media/images/media%20assets/event%20assets/may%2021%20press%20kit/hardware%20and%20accessories/controller/xbox_controller_f_transbg_rgb_2013.png
21:56 jberger I'm pulling it into a more maintainable state
21:56 Grinnz_ wow that was higher res than i was expecting
21:56 preaction okay, yes, i mean, so you want a responsive design and some angular frontend stuff?
21:56 jberger it was all in a plugin before (actually it was all in a command before that)
21:57 jberger preaction: precisely
21:57 * sri nods
21:57 jberger preaction: current front-end: https://github.com/jberger/Minion-Monitor/blob/master/lib/Minion/Monitor/templates/jobs.html.ep
21:57 jberger don't have any worker view at all either
21:59 jberger and currently no way to add a task from the frontend
21:59 jberger I was looking for visual JSON editors a while back, about when I got sidetracked
22:00 preaction so you'd select a task and then input some json for the task's configuration?
22:00 sri wow, january, almost a year... time flies :o
22:01 preaction do you have a list of things you'd like it to do? use-cases, user stories, that kind of thing?
22:01 * sri is not sure he likes the idea of adding jobs from the ui
22:02 sri if i was debugging i'd use the job command, if it was in production then my app would be creating the jobs
22:03 preaction oh, and an MVP, what's the least amount of stuff you'd like it to do?
22:04 jberger sri: yeah, I started a new job in December
22:04 jberger the work in January was because we almost started using it, as I got them (read: us) using Minion
22:04 sri dashboard with live stats and a pretty graph, job listing for different states, job details, retry/remove buttons
22:04 jberger but then we got too deep in other stuff
22:05 jberger converting the giant Mason app to Mojo for one thing
22:05 * Grinnz_ had to read that 3 times to realize jberger wasnt talking about a minion job started in december
22:05 * jberger plays the long game ;D
22:08 sri oh, and clean/simple code that makes it easy to fork
22:15 preaction well now you're just talking crazy!
22:18 sugar joined #mojo
22:27 sri ¯\(°_o)/¯
22:41 jberger preaction: I'm out the rest of the night, but I'll be around tomorrow
22:41 jberger if you want to take a peek, by all means, go ahead
22:42 jberger otherwise we can chat/hackathon sometime soon
22:52 Mattes joined #mojo
23:03 jontaylor joined #mojo
23:24 ZoffixWork joined #mojo
23:39 zackiv31 joined #mojo

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