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

IRC log for #mojo, 2016-03-04

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

All times shown according to UTC.

Time Nick Message
00:01 sri kinda fun to dig through the node.js source, the code quality is not as good as i expected
00:01 sri libuv is where they put all the effort it seems
00:10 sri hehe, google even found a relevant patch that addresses the same problem we have https://gist.github.com/piscisaureus/2653691
00:11 sri they changed it since then
00:11 sri now instead of letting the reactor spin again, they usleep(1) between accepts
00:14 sri only in libuv though
00:14 sri node.js has switched to a different architecture
00:15 sri they have an extra process that accepts connections, and then sends it through a pipe to the worker processes
00:16 sri round-robin
00:17 sri something we've talked about before... which requires questionable modules in perl
00:41 good_news_everyon joined #mojo
00:41 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v27Og
00:41 good_news_everyon mojo/master 72dd2fe Sebastian Riedel: $loop is not actually used anywhere
00:41 good_news_everyon left #mojo
00:43 bpmedley http://unsemantic.com/ <-- This looks to be a cool grid system based on percentages
00:48 good_news_everyon joined #mojo
00:48 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v273V
00:48 good_news_everyon mojo/master 260984f Sebastian Riedel: restart workers a little slower by default
00:48 good_news_everyon left #mojo
00:50 perlpilot_ joined #mojo
00:56 good_news_everyon joined #mojo
00:56 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v27s2
00:56 good_news_everyon mojo/master 925bab6 Sebastian Riedel: update prefork command too
00:56 good_news_everyon left #mojo
00:57 good_news_everyon joined #mojo
00:57 good_news_everyon [mojo] kraih tagged v6.53 at 880e35a: https://git.io/v27s9
00:57 good_news_everyon left #mojo
00:59 good_news_everyon joined #mojo
00:59 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v27Ge
00:59 good_news_everyon mojo/master 2e394f9 Sebastian Riedel: bump version
00:59 good_news_everyon left #mojo
01:00 jontaylor joined #mojo
01:21 mcsnolte joined #mojo
01:30 sivoais joined #mojo
02:02 jontaylor joined #mojo
03:24 jontaylor joined #mojo
03:50 noganex_ joined #mojo
04:18 jontaylor joined #mojo
05:10 jontaylor joined #mojo
05:17 marty_ joined #mojo
05:18 bwf joined #mojo
05:19 mcsnolte joined #mojo
05:21 inokenty-w joined #mojo
06:02 jontaylor joined #mojo
07:01 jontaylor joined #mojo
07:16 dod joined #mojo
07:20 dod joined #mojo
07:52 arthas joined #mojo
08:02 jontaylor joined #mojo
08:11 Vandal joined #mojo
08:26 AndrewIsh joined #mojo
08:43 trone joined #mojo
08:49 arthas_ joined #mojo
09:02 osfabibisi joined #mojo
09:02 arthas joined #mojo
09:21 jontaylor joined #mojo
09:32 meshl joined #mojo
09:51 dod joined #mojo
10:04 meshl joined #mojo
11:05 dvinciguerra joined #mojo
11:46 kaare joined #mojo
12:06 nic joined #mojo
12:23 cpan_mojo BenchmarkAnything-Storage-Frontend-HTTP-0.009 by SCHWIGON https://metacpan.org/release/SCHWIGON/BenchmarkAnything-Storage-Frontend-HTTP-0.009
12:57 deserted joined #mojo
13:31 asarch joined #mojo
13:36 mspo sri: isn't the dispatcher worker the apache model too?
13:36 pink_mist I believe it's *one* of their models
13:36 pink_mist afaik they have several
13:37 mspo well yeah I mean the traiditional prefork; not worker or mpm-event
13:37 mspo although I think mpm_event is actually what you guys are going for: the dispatcher + event-based/threaded workers
13:37 mspo also it is pretty fast
13:40 mspo https://github.com/apache/httpd/blob/trunk/server/mpm/event/event.c
13:47 acamari joined #mojo
13:58 orev joined #mojo
13:59 ramortegui joined #mojo
14:17 bwf joined #mojo
14:23 neilhwatson joined #mojo
14:38 berov joined #mojo
14:43 ichi joined #mojo
14:58 neilhwatson joined #mojo
15:10 mcsnolte joined #mojo
16:08 ataX joined #mojo
16:17 ataX Hi guys, I've been trying to wrap my head around how the Minion enqueue/dequeue works and I haven't been able to do it
16:18 ataX I've been reading the documentation and I still don't have a clear idea on how to do it
16:19 ataX so I have a rest api app using Mojo, I'm able via the Controller to enqueue the job, but I don't understand where to create the workers to take on those enqueued jobs.
16:20 ashimema you need to start a worker
16:20 ashimema easiest way if it's a mojo app using the plugin is documented:
16:20 * ashimema goes to dig out the relevant link
16:21 ataX using a myapp::task::foo ?
16:21 ataX module
16:21 ashimema https://metacpan.org/pod/Minion#DESCRIPTION
16:22 ashimema './myapp.pl minion worker'
16:22 ashimema that's the relevant bit
16:22 ataX humm
16:22 ataX so there is now way to do it from the app itself
16:22 ashimema it's a mojo command to start a minion worker which will pull jobs off the queue
16:22 ashimema I've not got that far myself..
16:23 ataX it will be something like a cron every 5 to take on the jobs on the queue
16:24 ashimema to me, the worker daemon makes more sense
16:24 lluad joined #mojo
16:25 ashimema we've reached the limit of my knowledge now I'm afraid.. could do with someone else popping up to clarify if you have further questions.
16:25 ashimema jberger I think helped my understand it a while back
16:26 ashimema you 'could' likely build a cron based worker to pick off jobs though.. I just don't know how
16:26 ashimema or why ;)
16:27 disputin joined #mojo
16:29 ataX how does the worker daemon work though
16:29 ataX so when I start my app
16:29 ataX instead of just ./app.pl
16:29 ataX will be ./app.pl minion worker ?
16:30 perlpilot surely you can fork a worker into the background when you start your app
16:30 ashimema minion is a mojolicious 'command' to start a worker
16:30 ashimema so you run both the above lines
16:31 ashimema one to start the app, the one to start the worker daemon
16:31 ashimema perlpilot.. i'm sure your right and you can
16:31 ashimema but i'm no expert and havent yet tried..
16:32 ashimema though, i'll admit i did originally think of doing that until I discovered the command
16:32 ashimema so instead. i wrote an init script to start workers using that
16:35 ashimema I imagine I'd start with https://metacpan.org/source/SRI/Minion-5.01/lib/Minion/Command/minion/worker.pm as example code for spawning workers.. and embed something along the lines of the content of the run sub into startup
16:35 jberger ataX: you never start your web app with just ./app.pl
16:35 ashimema but i'm guessing there's a reason theres not an example of doing just that out there
16:35 jberger you either do a command like daemon or prefork
16:36 ashimema yeay.. jberger.. someone with 'the knolledge'
16:36 jberger or else you pass the application script to an external server like morbo or hypnotoad
16:36 ataX well on development mode
16:36 ataX to test and what not you just do ./myapp.pl
16:36 jberger ?
16:36 jberger that should just give you a help page
16:37 jberger in your console
16:37 jberger rememer that a mojolicious application is more than just the webapp portion
16:37 preaction jberger++; # appease the god "Nollij" http://vignette4.wikia.nocookie.net/candh/images/1/1a/Nollij.png/revision/latest?cb=20120821162206
16:38 jberger preaction: hehe
16:38 fontardion joined #mojo
16:38 ataX heh
16:39 ataX oh oh
16:39 ataX I'm running morbo instead of just ./app.pl
16:39 cpan_mojo Statocles-0.072 by PREACTION https://metacpan.org/release/PREACTION/Statocles-0.072
16:39 jberger right
16:39 jberger and morbo is just a script that's a wrapper around daemon
16:39 ataX ok
16:40 jberger so the simplest way to start your webapp would be to do ./app.pl daemon
16:40 FatalNIX XD
16:40 jberger but then if you wanted to do other things you could use other commands like './app.pl minion job' to see the state of all your jobs
16:40 FatalNIX I finally successfully have Mojo::IRC connected to Acme::6502
16:40 ataX ok
16:40 jberger and, as was said before, one of those possible commands is ./app.pl minion worker
16:41 jberger which starts a minion worker for you
16:41 FatalNIX now I just gotta figure out why Mojo::IRC doesn't connect
16:41 ataX so when I start my app using daemon then if I go into another console and start a worker
16:41 FatalNIX OH WAIT
16:41 kes joined #mojo
16:41 * preaction waits
16:41 ataX it will take whatever is on the queue and perform it
16:41 jberger ataX: yes that works for simple deployment, eg testing
16:42 FatalNIX oh crap! I never started the mojo ioloop :D
16:42 jberger for production deployment you probably want an init script
16:42 jberger FatalNIX: yeah, we've all done it
16:42 ataX how would I start X workers
16:42 FatalNIX yep
16:42 ashimema it's in the comman ataX ;)
16:43 ataX just run it multiple times and send them to the bg
16:43 ataX oh
16:43 ashimema ./app minion --help
16:43 FatalNIX I gotta figure out how to start the IO loop without blocking the loop of the 6502 emulation
16:43 ashimema i believe?
16:43 FatalNIX as you can see I was very bored at 3am this morning :D
16:43 ataX in the mean time I might just run it manually to test
16:43 jberger ./app.pl help minion
16:43 ataX thank guys,
16:44 jberger ataX: there is an option that does multiple jobs
16:44 ataX yeah I saw that
16:44 ataX 4 by default IIRC
16:44 ataX I might keep it 1-to-1
16:44 FatalNIX maybe I can add my 6502's loop to Mojo::IOLoop?
16:45 FatalNIX should be simple enough :D
16:45 ashimema we should haev a few examples of minion init's linked from somewhere useful.. mines here in case it's remotely useful: https://gist.github.com/mrenvoize/87389f99609f1ac2b13f
16:45 ataX so the way I envsioned this rest api is that the worker would write it's output to Redis
16:45 ataX and have a controller/model that reads that from Redis using jobid
16:46 ataX but at least making the work run is an improvement. i'll go off to try it
16:46 ashimema on a totally different topic.. did I dream a few months back that you were pondering work on dbic:: asynchronous jberger?
16:46 ashimema wondering if that ever went anywhere
16:46 jberger it has been brought up
16:46 * ashimema would love to see some movement in that direction :)
16:47 zivester joined #mojo
16:47 jberger ribasushi believes that it should be technically very easy
16:47 jberger and yet the stall seems to be related to api design
16:47 ashimema yeah.. he's on his way out shortly.. I wondered if you were aiming to do any of the work on it?
16:47 jberger which I would be happy to be part of a discussion about, but I'm not going to be the driver
16:47 kes sri: Some thoughts about better rendering (patch attached): http://paste.scsys.co.uk/506889
16:47 jberger nope
16:47 ashimema I see
16:48 ashimema so we need a driver for the asyn bus.
16:48 ashimema but no-one's stepped up.. I see
16:49 jberger the problem is that, with the exception of Galileo, I really don't use DBIC very much
16:49 jberger I think it is very nice
16:49 jberger but the things I work on aren't really in that wheelhouse
16:50 jberger so while I think and async DBIC would be excellent, its not my itch to scratch at the moment
16:51 * ashimema wishes he was more competent himself to scratch that itch
16:51 ataX to have access to ./myapp.pl minion, I just need "use Minion" on app.pl ?
16:52 jberger ataX: load it as a plugin
16:52 jberger basically follow the example in the Minion synopsis
16:53 FatalNIX hmm. if I wanted to run a set of say 50 6502 instructions every Mojo IOLoop sequence, would it be reasonable to just use delay() in IOLoop?
16:53 ataX I did it but not on app.pl but lib/app.pm inside the startup function
16:54 perlpilot ashimema: The person driving the development doesn't have to know everything about how to do it if he can get lots of advice from smart people and/or code contributions from them
16:54 ashimema indeed, that's a fair point
16:54 ashimema they kinda need to at least know where to start thouhg ;)
16:55 perlpilot Ask those smart people about it  :)
16:55 ashimema I think neither my dbic knowledge nor my async knowledge is enough to get that far ;).. though may I will try some time when i have a bit more oss time
16:55 perlpilot ashimema: though, since this is about DBIC, it might be best to ask on #dbix-class
16:56 ashimema I think it was jberger who had the last input into it.. hence my asking here ;)
16:57 ashimema https://gist.github.com/ribasushi/032fbb8b58e2b0d62fae appears to outline the last activity on it
16:57 ashimema the last bit, where jberge jumped in was really promising
16:57 ashimema anywho.. dropping it for now.. will rally support in the future if I get a moment.
16:58 perlpilot ashimema: when you pick it up again, maybe look at DBIx::Async for inspiration
16:59 orev joined #mojo
16:59 perlpilot (even if it's inspiration on what not to do :)
17:00 ashimema :)
17:01 jberger maybe ribasushi just needs to be reminded of that converstation
17:01 jberger but then again, as you say, he has chosen to start stepping away from development
17:02 jberger if it is important to you though, the problem for him was funding *wink wink*
17:06 ribasushi jberger: the problem was deeper - I refuse to continue working on CPAN in its current form (due to the people driving it and the direction they drive it in). Pulling a mojo (I do not dep on anything) is unperlish and I will never do that either. Hence "funding to fix the underlying problem of the elders being reckless"
17:06 ribasushi jberger: so I am tying lose ends (sigh, so much more work left, but what can you do), and then I am effectively forced out by the current "regime" :)
17:07 jberger ribasushi: I am very sorry that you feel that way
17:08 ribasushi eh, it is what it is, I just figured I need to set the record straight for posterity ;)
17:08 ashimema :
17:11 PryMar56 joined #mojo
17:12 perlpilot ribasushi: do you have a document or post somewhere that outlines what you consider the "elders being reckless" means?
17:12 ataX "Mar 4 17:12 DEBUG worker._work                :  Checking worker registry and job queue"
17:12 ataX thanks a lot
17:13 ribasushi perlpilot: https://gist.github.com/ribasushi/74ce356123ede727e90f
17:13 perlpilot thank you
17:13 ataX I think I'll do some volunteering for this project. maybe try to help s little bit where I can.
17:16 dod joined #mojo
17:16 jberger ataX: glad it helped, and of course feel free to hang around
17:19 ashimema there's a good chunk of interesting cpan river posts that come out of that perlpilot.. all very interesting and informative
17:27 Grinnz_ wow, LMU broke if you use its functions without importing them? is that still the case?? https://rt.cpan.org/Public/Bug/Display.html?id=94013
17:28 bradjm joined #mojo
17:29 Grinnz_ looks like there was at least some attempt at fixing it
17:57 sri is the new house of cards season live on netflix?
17:58 sri looks like netflix germany might have botched the release
17:58 meredith yeah i've been seeing posts about watching it here
17:59 sri good going there netflix, i have a subscription but need to pirate your shows anyway!
18:00 jberger oh carp, I don't have time to watch House of Cards right now
18:00 meredith followup: yeah i opened netflix and season 4 is here. that's the new one right?
18:01 sri yea
18:01 meredith sorry US companies manage to botch this kinda stuff so much  -_-
18:04 pink_mist meredith: ah, you're here ... you were the one suggesting the $DBDPG_DEFAULT workaround to use $1 etc as placeholders right? well that doesn't make any difference -- the only difference is that the first time you use $DBDPG_DEFAULT it borks, but every subsequent time it works -- http://irclog.perlgeek.de/mojo/2016-02-04#i_11986340
18:06 pink_mist meredith: also: https://rt.cpan.org/Public/Bug/Display.html?id=112309
18:08 sri OMG
18:09 sri house of cards season 4 will not be available in germany
18:09 vicash torrent it
18:09 pink_mist 0_o why would they do something like that? =(
18:09 sri how... what... why... i don't even
18:10 sri to make it even more ridiculous, it will be available on amazon prime tomorrow in germany
18:10 Grinnz_ I hope they make fun of the circus that this election cycle has become
18:10 ribasushi Sky Deutschland, for example, has exclusive local rights to Netflix's own signature show, House of Cards, as well as binge-watcher favorites like Game of Thrones.
18:10 ribasushi pink_mist: ^^ when one signs a shitty contract - they are stuck with a shitty contract
18:11 Grinnz_ someone other than HBO has rights to game of thrones?
18:12 trone joined #mojo
18:12 ribasushi Grinnz_: https://en.wikipedia.org/wiki/HBO_(international)#United_Kingdom.2C_Germany.2C_Austria.2C_Switzerland.2C_Italy_and_Ireland
18:13 Grinnz_ huh
18:18 sri sky is the worst
18:32 * osfameron shakes his fist at the sky
18:32 osfameron it has been snowing all day here
18:44 FatalNIX test
18:46 FatalNIX ok. ForkCall is maybe not what I want
18:55 sri mspo: no, in the traditional apache prefork model the worker processes do the accepting
18:56 FatalNIX this lady at the help desk just said that there's a ghost in her machine
18:56 Grinnz closed; could not reproduce
18:56 preaction i'll call Major Kusanagi
18:57 sri someone call john constantine
18:59 FatalNIX yeah we can't reproduce it
19:00 FatalNIX you could also call Gilbert Ryle
19:01 jberger FatalNIX: what are you trying to do with ForkCall?
19:16 mspo sri: how about mpm_event?
19:17 sri dunno
19:50 sri mspo: looks like it uses normal prefork workers and then just a pool of threads
19:51 sri and each worker has a special thread for accepting new connections, and a separate pool of threads for handling those connections
19:51 mspo sri: yeah
19:51 sri it's different from what i talked about earlier
19:51 sri you still have the load balancing problem
19:51 mspo you were saying a single accepting/dispatcher?
19:52 sri i was talking about one process/thread accepting connections for the whole server
19:53 sri that's what IO::FDPass enables
19:53 sri you can pass file descriptors from process to process through a pipe
20:07 HtbaaPi joined #mojo
20:08 sri https://pbs.twimg.com/media/CcuYraMXIAE5Yn6.jpg
20:12 jberger shoulda been "for dummies"
20:31 jberger I hope that no one from this channel is involved in this https://twitter.com/wundercounter/status/705851767267979264
20:31 jberger the conversation in the github issue is progressing along and I think having an opt-out option was looking likely
20:35 perlpilot xdg must've riled someone a little too much
20:38 meredith he never seemed like much of a yeller to me
20:39 mitya joined #mojo
20:44 neilhwatson Couldn't he a least vary the language a bit?
20:45 sri everyone's a critic
20:46 neilhwatson It is easier to destroy and the create.
20:50 sri i may or may not be trolling him a little https://github.com/CPAN-API/metacpan-web/issues/1653#issuecomment-192462953
20:52 sri half the comments there https://pbs.twimg.com/media/Ccu1XW7UEAAAv4K.jpg
21:01 dod joined #mojo
21:16 sri oh my
21:16 sri kneejerk reaction not to do anything is totally not childish at all
21:18 oalders nope
21:19 sri yes, yes, it is
21:19 sri for the record, it wasn't actually me, i just went with it and trolled xdg
21:21 s1037989 With Mojo::Collection, is it possible to grab a slice of all but, say, the first element?  ->slice(1..-1)
21:22 jberger s1037989: its a blessed arrayref, so you could shift @$obj first
21:22 jberger that is destructive though
21:22 jberger you could also access all but the first element that way too
21:23 Grinnz_ ->slice(1..$#$collection) should work
21:23 s1037989 A way to do it all in one?  c(1,2,3)->slice(1..-1)?
21:24 Grinnz_ 1..-1 is not a valid construct, so no
21:24 s1037989 Right.  :)
21:24 mspo could you just use splice?
21:24 Grinnz_ splice is destructive
21:25 s1037989 c(1,2,3)->slice(1,'n')?  And then slice would be smart and go from 1 to end.
21:25 Grinnz_ use List::Slice 'tail'; tail -1, c(1,2,3)
21:25 Grinnz_ kind of a silly dependency, but if you really want the sugar
21:26 s1037989 Yeah, that's a solid hack...  Thanks!
21:26 cpan_mojo App-txtnix-0.05 by MDOM https://metacpan.org/release/MDOM/App-txtnix-0.05
21:27 Grinnz_ oops, need to dereference the collection and reform it there too, since its not a built in method :P
21:28 s1037989 Or...  I could just -- what's it called -- overload the class with my own, using Mojo::Collection as a base class.  Yeah?
21:28 Grinnz_ subclass
21:28 s1037989 Yeah!  :)
21:29 Vitrifur joined #mojo
21:30 s1037989 Or...  Could it be achieved through the use of tap?
21:31 Grinnz_ use Mojo::Base 'Mojo::Collection'; use List::Slice qw(head tail); sub c { __PACKAGE__->new(@_) } sub tail { my ($self, $i) = @_; return $self->new(tail $i, @$self) }
21:31 Grinnz_ something like that...
21:31 s1037989 Cool!  Thanks!!
21:32 jberger or just make that an ephemeral method
21:33 s1037989 jberger: What's that mean?
21:33 Grinnz_ s1037989: tap wouldn't really make sense, because you want to return a new object, not modify the original one
21:33 jberger my $tail = sub { my ($self, $i) = @_; return $self->new(tail $i, @$self) }; c(1,2,3)->$tail(2);
21:33 jberger no need for a subclass
21:34 s1037989 Oh yes!  Cool!  Didn't think about being able to apply that inside a chain.  I dig it!
21:34 Grinnz_ that's a neat solution too
21:34 jberger yeah I do that often just to preserve the style
21:35 jberger ephemeral method is my name for it, but I wouldn't mind if it caught on
21:35 jberger http://blogs.perl.org/users/joel_berger/2014/01/ephemeral-methods-or-what-to-call-dispatch-to-a-variable-containing-a-subref.html
21:37 vicash is there a recommended module to use for checking what processes are running on a system ? Just want to display the health (running or not-running) of a set of running applications using Mojo and wondering what you guys use here. I see Unix::Process on Metacpan but that doesn't do what I want.
21:37 s1037989 Thanks for the link!  Good read!  And now I don't feel too stupid for not knowing what "ephemeral method" means!  :D
21:37 vicash I am trying to avoid writing "ps aux | grep $name" basically if there is already a module
21:38 Grinnz_ vicash: i usually just shell out. any method for finding such a thing will probably be doing that anyway, or be just as non-portable
21:38 Grinnz_ if thye're running via init scripts, shelling out to /sbin/service isn't so bad
21:39 jberger the blog post relates to a previous one about Test::Mojo, I should probably add an update to that one about Test::Mojo::WithRoles
21:39 jberger as you can see I was thinking about that one for quite a while
21:40 vicash Grinnz_ : ok. i will just do that instead.
21:40 sri there is one example in the Test::Mojo docs too http://mojolicious.org/perldoc/Test/Mojo#success
21:41 Grinnz_ lol
21:41 jberger I believe that article was related to the addition of the success attribute
21:42 jberger "Finally the test is run and the response is stored in the new success attribute."
21:42 jberger yeah
21:42 sri :)
21:43 s1037989 Must have been Joel!
21:43 jberger pretty sure I was trying to get some new test methods added and we settled on that as the general solution
21:43 sri figured you were involved based on the diag text ;p
21:43 s1037989 :D
21:43 * jberger bows
21:45 s1037989 Is it possible to get access to the following feature when using Mojo::Template without building a Mojolicious app?  "At the beginning of the template, stash values that don't have invalid characters in their name get automatically initialized as normal variables, and the controller object as both $self and $c."
21:46 s1037989 Obviously I don't want access to the controller object, but other objects...
21:46 s1037989 Of course i can use @_.  But I really like the named variables.  :)
21:46 sri no
21:47 sri you could try moving the feature from Mojolicious::Plugin::EPRenderer to Mojo::Template
21:47 s1037989 Cool, that is what I've done.  Works well.
21:48 sri Oo
21:48 sri i mean, like a pull request
21:48 sri we would likely accept one for that
21:48 s1037989 Would you think it's possible to refactor to move some features from Mojolicious::Renderer to Mojo::Renderer?  And if so, would you support a PR for that?
21:49 sri Mojo::Template
21:49 sri possibly
21:49 sri depends on code complexity and performance i assume
21:49 s1037989 Well...  I grabbed a lot of code from Mojolicious::Renderer.  So I was thinking it made sense to move those into Mojo::Renderer.
21:49 sri oh
21:50 sri now i'm a little sceptical
21:50 s1037989 But I could shove it all into Mojo::Template.
21:50 s1037989 Sorry, just the "helper" concepts.  And grabbed stash from Controller.  And the prepend/append from EPRenderer.
21:51 s1037989 I'd also like to have access to the handler functionality.
21:52 sri very sceptical
21:52 s1037989 As you should be.  :)  But is what I'm trying to achieve legit?
21:53 sri did you just clone the functionality and didn't reuse Mojo::Renderer for Mojolicious::Renderer?
21:53 sri that would be 100% a -1 vote
21:53 s1037989 Sorry, I don't understand the question.
21:53 sri whatever you extrace from Mojolicious::Renderer/Mojolicious::Plugin::EPRenderer needs to be reused again later
21:54 sri *extract
21:54 s1037989 Right!  That would be my goal with the refactoring.  Not sure that it's possible.
21:55 sri the stash/variable stuff can prolly be extracted cleanly, but helpers and the rest will be very very hard
21:56 s1037989 Then that would be a feature that wouldn't transfer.
21:56 s1037989 It was just a hope.
21:56 s1037989 And I'm glad I ask before moving forward with trying.
21:57 s1037989 The module I created just copied all the helper / stash / handler features into my module.  It just kind of led me to think that some refactoring could provide some / all of those features without having to copy the code if I ever wanted to do it again in another module.
21:58 sri like i said, some of it should be easy to do, and will prolly be accepted into core
21:59 s1037989 Great!  I'll attempt to do the pieces that will be and forgo on the others and discuss again after step 1.  :)
22:16 * sri is going to close his netflix account
22:16 Adura Moving to Canada?
22:17 sri http://www.viciouspotato.net
22:26 orev what is a good approach to limiting a certain session to specific pages?  I'm currently using a session, and was thinking of adding a "usage" type of flag to it, so only sessions with a certain flag can access certain pages.  think of something like a password reset page - I want a session that only allows access to the reset form until the password is changed
22:27 orev I'm thinking of some under groups that check the flag for each kind of flag
22:31 sri role based access control
22:32 Adura A bitfield with various capabilities.
22:34 orev as far as the structure in mojo?  does it make sense to use unders inside of groups for each thing?
22:35 orev I'm usinglite
22:35 jberger depends on how granular the permissions are
22:35 orev just whole pages
22:37 jberger then I'd make a helper which checks the perms and returns true or false
22:37 jberger sorry, checks the perms and returns true or (returns false and sets a status code/response)
22:38 jberger that way you can do return unless $c->can_view;
22:39 jberger and maybe that takes a $level argument or something
22:39 jberger or $role more like
22:39 Grinnz_ i added a reply.forbidden so i can do return $c->reply->forbidden unless blah
22:40 jberger Grinnz_: that's a good generic solution but it gets cumbersome the more pages have it
22:40 jberger the more common something is the simpler I want it to be
22:40 Grinnz_ eh, each page has to test different sorts of permissions anyway
22:40 jberger so I put the failure response right into the check
22:40 Grinnz_ that part is more cumbersome
22:41 jberger but of course that is a matter of taste and should be chosen as the application warrents
22:43 jberger anyway I did update that old post: http://blogs.perl.org/users/joel_berger/2014/01/create-your-own-testmojo-method.html
22:50 vicash left #mojo
23:44 cpan_mojo Module-Release-2.122 by BDFOY https://metacpan.org/release/BDFOY/Module-Release-2.122
23:55 meshl joined #mojo

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