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

IRC log for #mojo, 2017-08-13

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

All times shown according to UTC.

Time Nick Message
01:05 good_news_everyon joined #mojo
01:05 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v7HVo
01:05 good_news_everyon mojo/master aefc184 Sebastian Riedel: slightly more consistent formatting
01:05 good_news_everyon left #mojo
02:07 noganex_ joined #mojo
02:36 kavuria joined #mojo
07:13 Vandal joined #mojo
07:56 Lee joined #mojo
08:24 aborazmeh joined #mojo
09:03 petru joined #mojo
09:23 trone joined #mojo
10:11 zerah joined #mojo
10:28 jabberwok joined #mojo
10:50 stryx` joined #mojo
11:28 dotan_convos preaction - maybe you want to use Tie::Cache::LRU for your round-robin data set cache?
11:36 marcus mishanti1: it's just a simple wrapper around No::Dato  iirc.
12:05 leffe joined #mojo
12:06 leffe Hi
12:06 leffe Here I come again with other of my newbie questions
12:07 leffe As I told before I'm moving Model modules away from the prototype I created with mojolicious::lite
12:09 leffe The exception bubbling to the controller, is resolved, I think.
12:10 leffe What I want to do now is to share the log infrastructure among all layers of the app.
12:10 pink_mist $app->log
12:10 pink_mist is a thing
12:11 leffe What I would do using java is to whether declare abstract methods to log, that is info, error, debug
12:11 leffe or inject the logger at somepoint
12:13 leffe With perl the options would be to redefine these methods in the client class, like this *Model::SomeOtherModel::info = \&info
12:14 leffe or to pass them in the constructor, as an object or even pointers to functions
12:14 leffe or even to have app->log in a global variable
12:15 leffe I do not really like any of these solutions
12:15 leffe What do you think? is there a canonical way of doing what I want to do?
12:16 sri have a role with those methods, and pass the Mojo::Log instance as an argument to ->new
12:17 sri assuming this app layout https://github.com/kraih/mojo-pg/tree/master/examples/blog
12:18 sri (Model::...->new that is)
12:22 erry marcus: by the way, did you end up watching my mojo vs catalyst tlak?
12:23 leffe I'll study the 'blog' example in detail, thanks again.
12:24 sri erry: is there a video?
12:25 erry sri: https://www.youtube.com/watch?v=wZgucF0Fgy8
12:25 erry someone told me i made a mistake with the databases in mojo
12:25 erry which is plausible :p
12:29 sri ah, a syntax comparison
12:29 erry ye pretty much
12:30 sri database example didn't quite look right, but the approach is correct
12:31 erry basically someone said that it'll do a new connection each time the way i did it
12:31 erry dunno if that's right or how you'd rectify that
12:31 sri yes
12:32 sri i would link to a DBIx::Class example if i could think of one
12:32 mishanti1 marcus: Yeah, I ended up using No::Dato::hverdager().
12:34 sri erry: you're not alone though, looks like tempire got it wrong in his example too -.- https://github.com/tempire/MojoExample/blob/master/lib/MojoFull.pm#L15
12:34 sri no wait, he didin't it's an attribute
12:34 sri that's just the older pattern, where the helper defers to a lazy attribute
12:35 erry aha
12:36 sri the modern-ish version uses one helper and state
12:36 sri $self->helper(db => sub { state $schema = Schema->connect('dbi:SQLite:' . ($ENV{TEST_DB} || 'test.db')) });
12:37 erry oh
12:46 erry that's pretty simple :p
13:25 kavuria joined #mojo
13:53 PryMar56 joined #mojo
13:53 petru joined #mojo
14:30 zerah joined #mojo
14:43 petru joined #mojo
14:51 kavuria joined #mojo
15:14 kavuria left #mojo
16:34 itaipu joined #mojo
17:04 trone joined #mojo
19:09 petru joined #mojo
19:25 genio sri: I got in contact with leont and as soon as he's had some time to take a look at things hopefully he can provide some guidance/fixes.  thanks!
19:51 stryx` joined #mojo
20:21 sri genio: \o/
20:45 sri so, now that we officially support Role::Tiny
20:45 sri should "use Mojo::Base -strict" maybe also export the has function?
20:46 sri so you don't have to add Mojo::Base as a base class to your roles
20:54 Grinnz maybe "use Mojo::Base -has" or something else, between strict and base
20:54 sri why?
20:55 Grinnz don't like the idea of existing packages using it for strict and warnings suddenly getting a has function they didn't want
20:55 sri what's the harm?
20:55 purl the harm is that it takes a long time to build.
20:58 good_news_everyon joined #mojo
20:58 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v7QWG
20:58 good_news_everyon mojo/master de71a04 Sebastian Riedel: no need to state the obvious
20:58 good_news_everyon left #mojo
21:01 sri oh well, if there's doubt i'll just not add it
21:18 itaipu joined #mojo
21:28 jberger I'd rather pull in Mojo::Role into the core at that point
21:29 jberger dvinciguerra already handed back the perms on that IIRC
22:54 tyldis joined #mojo

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