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

IRC log for #mojo, 2014-03-28

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

All times shown according to UTC.

Time Nick Message
00:08 davido__ joined #mojo
00:18 davido__ joined #mojo
00:22 jack joined #mojo
00:35 punter joined #mojo
01:01 sri that should cover basic stats https://github.com/kraih/minion/commit/ae7e1894fd795dc6a744fd0dbe95200aafb56425
01:01 sri the state field really needs an index though ;p
01:02 sri but i guess stats should be pretty fast then
01:03 sri wonder if individual queries could be combined into an aggregation
01:03 sri something to hack on for those that want to help :)
01:04 sri btw. index generation should fit pretty well into Minion::Worker::repair
01:04 hotsnow joined #mojo
01:04 sri since that's supposed to run on worker startup
01:22 davido___ joined #mojo
01:40 laouji joined #mojo
01:41 russum joined #mojo
02:02 d4rkie_ joined #mojo
02:05 sri tempire: i got some weird mails from you that don't make much sense, maybe i missed something?
02:08 steveeirium joined #mojo
02:14 steveeirium hello! I have a WebSocket, reading click events etc. from the client. I want to dispatch to a controller with the event object.
02:15 steveeirium while using mojolicious as much as I oughtta...
02:50 klapperl_ joined #mojo
02:51 bzero joined #mojo
02:56 d4rkie joined #mojo
03:01 marty_ joined #mojo
03:06 steveerium joined #mojo
03:14 danmiller joined #mojo
03:41 jnbek joined #mojo
03:44 laouji joined #mojo
03:47 laouji joined #mojo
04:02 steveerium I just want to route ->to but without having the route
04:03 steveerium so I'm dispatching from the WebSocket lingo I receive, not the get /whatever request
04:04 Adurah Good to see you back siri.
04:10 damaya joined #mojo
04:54 shmuel joined #mojo
04:56 shmuel How does Mojo::Lite strait to template route such as "get '/about';" translates to full mojo?
05:09 Eke- joined #mojo
05:30 steveerium okay how about this http://pastebin.com/kBfTurcM
05:31 laouji joined #mojo
05:31 steveerium is it that the helpers don't get made at the right time?
05:32 steveerium app->send doesn't work in that example either
05:32 steveerium am I not going over to the controller in the right fashion?
05:33 laouji joined #mojo
05:34 steveerium there's a certain flavour of documentation I cant find for this...
05:34 steveerium Mojolicious is really nice though.
05:34 steveerium not sure I'm using it right.
05:34 steveerium Cheers.
05:36 shmuel steveerium: the error in line 40?
05:37 shmuel you used $self->app->confy, while you should have used $self->confy
05:38 shmuel also, you are mixing the Mojo::lite with full mojo. I don't think you should do that.
05:44 steveerium hmm
05:44 steveerium neither works
05:46 steveerium I'll turn it into something that "use Mojo::Base 'Mojolicious';" etc
05:48 steveerium I'm trying to invent the next bunch of stuff
05:49 steveerium digital atoms, tools for reeling stuff in across cyberspace and figuring out the language with it
05:49 shmuel I'm not an expert, but Conty is a controller. but it is not instated by Mojo.
05:49 shmuel you use "new" by yourself.
05:49 shmuel nothing connects this controller to your application.
05:50 shmuel why is Conty a controller? maybe it should be a normal module?
05:51 shmuel the whole idea of creating controllers as helpers is weird.
05:53 steveerium yeah pretty murky
05:53 steveerium just want them to be available
05:53 shmuel what are you trying to do?
05:53 steveerium something said if I made them helpers...
05:53 shmuel what does "available" means? available to what?
05:54 steveerium code all over the place
05:55 steveerium trying to solve this has totally confused me
05:56 shmuel so start with the beginning. you have a working Mojo-lite app?
06:01 sujithm joined #mojo
06:04 steveeirium joined #mojo
06:05 steveeirium yep, it was going swell when I was passing around $hostinfo etc when I needed it but I thought why not always have it there?
06:06 steveeirium it's to make art, abstract text writing in the browser
06:06 steveeirium Hostinfo keeps track of elements we send to the client
06:07 steveeirium Conty starts doing stuff and handles events in a hookable way
06:08 steveeirium I need more abstract documentation
06:08 shmuel maybe you want to use the stash?
06:09 shmuel if you will stash $hostinfo, it will be available everywhere as long as the requst is alive
06:09 steveeirium hmm
06:09 * steveeirium smokes
06:12 steveeirium what a weird place to get stuck
06:14 laouji joined #mojo
06:38 steveeirium so I convert it all to Mojolicious
06:44 steveeirium not enough parameters for index?
06:44 laouji joined #mojo
06:45 steveeirium I should give up
06:45 steveeirium it gets really vague
06:46 steveeirium it needs more degrees between the description and the individual parts
06:47 steveeirium man you get so lost
06:47 steveeirium no wonder nothing much gets invented on the internet
06:52 dod joined #mojo
06:55 steveeirium I like the low key "has 'conty';"
06:55 steveeirium any OO libs do syntax like that?
07:10 Vandal joined #mojo
07:13 steveeirium argh
07:14 steveeirium then I have to pass around the $mojo->app so extremities of Hostinfo can ->send
07:15 steveeirium as Controllers they had that ability
07:15 basiliscos joined #mojo
07:16 steveeirium on $self->app, which was cool, then I wanted the two chunks of persistent things on the webserver available there too, as helpers
07:16 steveeirium seemed like that's what helper is for?
07:28 steveeirium man
07:28 steveeirium I used to have dreams for this thing
07:30 edestler joined #mojo
07:33 laouji joined #mojo
07:42 dod joined #mojo
07:48 laouji joined #mojo
07:53 steveeirium I am defeated for now
07:53 steveeirium I just need some stimuli to see the way forward
07:58 eseyman joined #mojo
08:02 steveeirium I want my controllers to be able to $self->app->send('...') to the websocket
08:03 steveeirium and I want to reach those controllers from each other and everywhere
08:03 steveeirium so maybe I need to split controller from the object it works with
08:04 steveeirium but then what's the right way to get execution into a controller if you're using a websocket?
08:04 steveeirium dinner, back soon.
08:13 denisboyun joined #mojo
08:14 dod joined #mojo
08:29 sujithm joined #mojo
08:32 mattastrophe joined #mojo
08:33 trone joined #mojo
08:36 rawler joined #mojo
08:36 sleigner joined #mojo
08:44 fhelmber_ joined #mojo
08:49 ver joined #mojo
09:37 mire joined #mojo
09:38 dotandimet joined #mojo
09:44 stl joined #mojo
09:55 dotandimet joined #mojo
10:25 sujithm_ joined #mojo
10:30 Jonneh joined #mojo
10:48 sugar_ joined #mojo
10:50 hummeleBop joined #mojo
11:15 mire joined #mojo
11:16 sujithm joined #mojo
11:27 neilhwatson joined #mojo
11:30 denis_boyun joined #mojo
11:33 danmiller Can Mojolicious create a URL for an action in a different controller for me? Something like "[% self.url_for( controller => 'page', action => 'show', id => element.page.id ) %]"
11:36 laouji joined #mojo
11:40 jberger_ joined #mojo
11:40 jberger_ Yay, we can haz sri!
11:41 rem_lex|pivo joined #mojo
11:41 jberger_ Welcome back
11:41 * purl bows
11:41 * jberger_ looks at minions
11:41 jberger_ s/s//
11:49 jberger_ Also jhg++ # testing before asking
11:51 sri \o\
11:51 sri /o/
11:53 jberger_ -o/
11:53 jberger_ \o-
11:55 bjoernfan sri: Wow, minion. I was just looking into something like that. :)
11:55 jberger_ danmiller: url_for is more router-centric than controller-centric
11:56 sri :)
11:56 sri one thing i forgot when i suggested a $minion->enqueue_and_wait(foo => \@args => sub {...}) api was testing :S
11:57 sri this kinda stuff wouldn't work https://github.com/kraih/minion/blob/master/t/minion_lite_app.t#L51
11:58 * sri cares a lot about making minion easy to test
11:58 jberger_ MOAR TRSTINGZ
11:59 sri http://i12.photobucket.com/albums/a219/Glampira/dog_and_sprinkler.jpg
12:00 mattastrophe joined #mojo
12:02 danmiller jberger_: I'm pretty new to Mojo (Have been working with CGI::Application for years, and only for a day with Mojo now). I am just looking for the idiomatic Mojo way or for a common practice to prevent putting literal URLs into my templates.
12:03 sri javascript getting async/await too is pretty freaky
12:05 sri i've not gone through the whole backlog from the last few days yet... but there's some very weird stuff in there
12:07 jberger_ sri hahaha
12:14 jberger_ Hmmm my convos instance seems to be non responsive
12:15 jberger_ danmiller:  url_for is what you want
12:16 danmiller Yes, I'm getting close to success, i think ;-)
12:16 jberger_ Cool
12:17 danmiller I just noticed that I need to name my routes and that I can use the routes' names as first argument to url_for. Does that sound right?
12:20 jberger_ Yep
12:20 jberger_ Actually all routes will get an auto generated name if you don't set one
12:21 jberger_ You can see them when you run `./myapp.pl routes`
12:21 jberger_ but naming explicitly is a good idea when you intend to refer to them
12:23 danmiller Ah! Thank you very much! I have seen those auto-generated route names in a different place of the documentation, but it didn't make any sense then.
12:27 jberger joined #mojo
13:05 gryphon joined #mojo
13:09 d4rkie_ joined #mojo
13:18 jack joined #mojo
13:22 d4rkie joined #mojo
13:32 bluescreen joined #mojo
13:44 sugar joined #mojo
14:01 mport joined #mojo
14:05 sujithm joined #mojo
14:16 * sri wonders if $worker->one_job and $worker->all_jobs should be merged
14:24 btyler joined #mojo
14:45 sh4 joined #mojo
14:49 danmiller Is it intentional that captures don't end up in validation input? After all, I can access both using $c->param() and I usually need to validate captures as well.
14:55 cfedde maybe you can clarify that a bit?
15:05 danmiller I'll try: http://pastebin.com/E8tCytwG  I have a simple runmode that takes a page number in the URL and renders a page based on some database query. I'm trying to use the validator to check whether the page id is in a correct format and range. But don't see, how I can put the id into the validation object.
15:18 danmiller Or to put it differently: I'm looking for the best practice to validate values from placeholders.
15:27 meshl joined #mojo
15:32 jberger danmiller: the validation system was created for form validation, and especially csrf protection
15:32 jberger I don't think anyone has attempted to use it for placeholder validation
15:33 jberger In some sense the router itself is the validation
15:33 jberger If you need more checks, look at bridges (under)
15:53 punter joined #mojo
15:54 punter We should make a "made with Mojolicious" website to exhibit sites made with Mojolicious. This would benefit Mojolicious in two ways: people choosing Mojolicious would know they would get a little bit of exposure for their sites, and secondly people would be able to see what nice things Mojolicious can do
15:59 bjoernfan punter: You do have this on the wiki: https://github.com/kraih/mojo/wiki/Projects-and-Companies-Using-Mojolicious
15:59 punter thanks
16:00 bjoernfan :)
16:00 Jim joined #mojo
16:01 bjoernfan I'm trying to spend a few hours a week on my own photography oriented cms-thingie, I'll probably add that to that list once it's a little less beta.
16:02 mire joined #mojo
16:07 Jim left #mojo
16:19 beyondcreed joined #mojo
16:21 meshl joined #mojo
16:22 danmiller jberger: Thank you again! I'm copying the values from the placeholders to the input in a hook now: http://pastebin.com/6d0eAqUn
16:22 danmiller Works well, but I still feel like I'm missing some point.
16:23 jberger danmiller: do not use/rely on mojo. variables
16:23 jberger They are private
16:24 jberger And documented as such
16:28 danmiller Of course, you are right. My problem is that the user can request a page via a link to "/page/99/" or via a form submit to "/page?id=99". It seems strange to me that I can validate the page id only in the latter case.
16:31 meshl joined #mojo
16:51 mattastrophe joined #mojo
16:57 denis_boyun joined #mojo
17:00 denis_boyun__ joined #mojo
17:05 sri i guess support for delayed jobs is a must have feature https://github.com/kraih/minion/commit/a7098153499cb33897f283b04285d873f66795c9
17:08 sugar_ joined #mojo
17:37 sugar__ joined #mojo
17:44 meshl Greetings! What's the easiest way to have several predefined routes lead to the same request? I tried: get ['/route1','/route2'] => sub { }; but that did not do it...
17:55 sugar joined #mojo
17:56 denisboyun joined #mojo
18:05 denis_boyun__ joined #mojo
18:17 denisboyun joined #mojo
18:17 * sri wonders if stuff like delayed jobs and job priority are sensible base features... resque has no base features like that... only plain old jobs
18:17 punter joined #mojo
18:19 go|dfish meshl: I think you want to use http://mojolicio.us/perldoc/Mojolicious/Lite#Restrictive_placeholders
18:20 denis_boyun____ joined #mojo
18:24 go|dfish meshl: you might want to read http://mojolicio.us/perldoc/Mojolicious/Lite#Placeholders first
18:25 denisboyun joined #mojo
18:25 sri reding through the ruby job queues is funny though... they have to worry about memory usage so much :D
18:25 sri s/reding/reading/
18:26 sri makes you appreciate how good copy on write and cheap forking in perl actually are
18:29 btyler sri: my office started by having different queues for several 'priority' levels (ie low/medium/high queues), and then as we started using the queue more and more heavily, found that we much preferred having different queues for each task (so one long-running task doesn't hold up others of the same queue-based priority). we use delayed jobs a lot, though (the PHP resque scheduler lib)
18:33 * sri kinda likes having priority and delay as simple attributes of a job
18:33 sri https://github.com/kraih/minion/blob/master/lib/Minion.pm#L169
18:33 sri everything goes into the same queue, with just a task name and several attributes
18:34 sri guess the design is more in the nature of an object database, multiple queues fits redis better
18:35 btyler yeah, I suspect you're right. that's a really pretty API (par for the course with Mojo and company :)
18:38 btyler we've really benefitted from multiple queues, since some of our tasks can take hours, so being able to allocate a limited number of workers to potentially long-running tasks helps us keep the system throughput high (ie the 'generate mega backup' queue only has one worker per queue processing server, while other queues serve much smaller tasks and have more workers allocated)
18:39 btyler we had issues early on when all of our workers got tied up in long-running tasks and the work queue grew and grew
18:40 sri works the same with task names though
18:41 sri suppose you could consider the task names different queues if you wanted to
18:42 mire joined #mojo
18:43 sri two solutions for that problem in minion, enqueue new fast jobs with higher priority, or start a few workers that only accept certain tasks (not a core feature, but easy to do... basically just delete app->minion->tasks->{very_long} in your branch of the app)
18:45 btyler yeah, the second approach (dedicated workers to different task names) is what we've sort of converged on here
18:46 * sri also wonders where he wants to go with minion worker process configuration
18:47 sri possibly app->config->{minion} = {...} like hypnotoad
18:52 denis_boyun__ joined #mojo
18:53 stephan48 is there a way to run a string throu the Default Renderer the app uses?
18:59 bluescreen_ joined #mojo
19:02 disputin joined #mojo
19:03 jberger stephan48: rendering inline (possibly with partial too)
19:04 stephan48 thanks, a classic fail of RTFM
19:05 stephan48 after you mentioned for what i had to search in M::G::Rendering, i found it, its pretty obvious, thanks
19:09 stephan48 jberger: thanks! it works
19:09 jberger Glad to help
19:10 stephan48 i used inlinde together with the include helper
19:11 denis_boyun joined #mojo
19:13 bjoernfan Did I get this right? http://mojocasts.com/e4#comment-1308672678
19:13 * jberger looks forward to inion.pm
19:14 denis_boyun___ joined #mojo
19:14 edestler joined #mojo
19:16 jberger bjoernfan: we have an errata section on the wiki home page: https://github.com/kraih/mojo/wiki
19:17 jberger tempire: perhaps a link to the errata page on the mojocast site?
19:17 * sri just updated the errata with bjoernfan's findings
19:17 sri https://github.com/kraih/mojo/wiki#screencasts
19:17 jberger MOAR MOJOCASTS!!
19:18 * sri thinks tempire might be busy with preparing the training for mojoconf
19:18 bjoernfan hoooraaay I'm helping!
19:19 sri \o/
19:19 bjoernfan People are paying attention to me!
19:19 bjoernfan Not enough references lately.
19:21 bjoernfan Does any of you get this reference? The internets are upset with me http://www.reddit.com/r/gamedev/comments/21lbhx/job_hunters_in_or_around_vancouver_upcoming_job/cgeav3i
19:21 sri more people would pay attention if you had a face tattoo... just saying
19:24 denis_boyun joined #mojo
19:26 bjoernfan Those of you who havn't read jPod by Douglas Coupland really should. :)
19:28 mire joined #mojo
19:45 edestler joined #mojo
19:47 denis_boyun__ joined #mojo
19:53 lb bjoernfan: curious, i read it when it was new, has it aged well, or is it hilarious or prophetic now?
19:59 bjoernfan I read it a few years ago and loved it, I read Microserfs more recently and liked that one as well, not as much, but not really because that it's older. I'm not really sure what there is about it that would prevent it from aging well.
19:59 bjoernfan And it's from 2006, sure a lot has happened since then, but not that much.
20:00 lb not much? :)
20:00 lb only mobile
20:00 lb anyway, i think i was mixing jpod and microserfs up in my head
20:02 bjoernfan Haha, sure, but it's not like anybody would read it and think "People used the internet on desktop computers back then?"
20:02 lb and where are all the hug machines
20:02 bjoernfan :D
20:02 bjoernfan <3
20:02 bjoernfan Did you watch that... whatyacallit... they made it into a television series as well
20:02 lb one ep
20:03 lb got distracted, not interesting
20:03 bjoernfan Though my thinking watching it was that it would probably only be attractive to anybody who hadn't read the book.
20:05 bjoernfan They use the hug machine as a cliffhanger at the end of the series, it malfunctions and one person gets stuck or something.
20:05 bjoernfan Or if two people got stuck in it together? nightmare
20:10 lb depends on the people, *rrr*
20:16 basiliscos joined #mojo
21:43 mudler joined #mojo
22:28 Jim joined #mojo
22:31 tianon joined #mojo
22:32 espent joined #mojo
22:49 jfried joined #mojo
23:08 jberger_ joined #mojo
23:09 good_news_everyone joined #mojo
23:09 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/mRwp9g
23:09 good_news_everyone mojo/master 821844b Sebastian Riedel: added daemonize method to Mojo::Server and ensure_pid_file method to Mojo::Server::Prefork
23:09 good_news_everyone left #mojo
23:11 sri i hate how setuidgid and daemonize are untested... but i can't think of reliable tests
23:13 sri on the plus side... reusing the daemon management stuff is really easy and i'm going to abuse that for minion :D
23:19 good_news_everyone joined #mojo
23:19 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/gZeC_w
23:19 good_news_everyone mojo/master 4f8bb14 Sebastian Riedel: clean up PID file more consistently
23:19 good_news_everyone left #mojo

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