Camelia, the Perl 6 bug

IRC log for #mojo, 2013-07-05

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

All times shown according to UTC.

Time Nick Message
00:47 shmuel joined #mojo
01:43 phillipadsmith sri: looking in the tests for Mango and I can't find an example of a non-blockign insert… am I missing something?
01:50 tianon phillipadsmith: https://metacpan.org/modul​e/Mango::Collection#insert
01:51 tianon there's an example :P  it's probably something that should be in the test cases, but sri's got big changes cooking anyhow so it might be subject to change
01:55 tianon sri: I wonder if perhaps the readme for the mango repo ought to say something in really big bold letters about it still being very experimental and/or that a major rewrite is in the works?
01:55 sawtooth joined #mojo
01:57 Meiermann joined #mojo
01:57 phillipadsmith good point… I mean, would you propose that folks not use it at all and use the MongoDB module for now?
02:00 d4rkie joined #mojo
02:00 crab you have to decide for yourself which you care about more.
02:01 sawtooth joined #mojo
02:01 crab a "stable" API, or something that works better. in the initial days there will be pain and it will require effort on your part.
02:02 crab it was the same with the early days of Mojolicious. but at least i personally find that the effort i invested then was amply repaid.
02:10 phillipadsmith I'm not doing anything fancy, just inserts and finds
02:11 preflex_ joined #mojo
02:18 crab what are you worried about, then?
02:26 phillipadsmith crab: I'M NOT!  ;)
02:27 phillipadsmith it's just that folks have said "perhaps the readme for the mango repo ought to say something in really big bold letters about it still being very experimental"
02:27 phillipadsmith That said, I'd like to see an example of a non-blocking insert in a lite app. :)
02:58 rem_lex|pivo joined #mojo
03:20 preflex_ joined #mojo
04:06 sri tianon: there's examples *and* tests, i suspect phillipadsmith didn't look very hard
04:07 sri normal people don't use a module from github... the warning is for the cpan release
04:08 sri phillipadsmith: considering you're new to all this, no, i don't think you should be using mango
04:09 good_news_everyone joined #mojo
04:09 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/BrX4Ag
04:09 good_news_everyone mojo/master 21c676e Sebastian Riedel: documentation tweaks
04:09 good_news_everyone left #mojo
04:10 sri in fact, anyone who's in doubt if he should be using it... you shouldn't
04:23 yakudza joined #mojo
04:32 mrphilov1 joined #mojo
04:45 yakudza joined #mojo
04:53 phillipadsmith sri: "new to all of 'this'" where 'this' means...?
04:54 phillipadsmith sri: if there's an example of a non-blocking insert for a mojo lite app that I missed, I'd be happy for a pointer.
05:03 phillipadsmith I know I've only had Mojolicious::Lite apps in production since, um, May 2011, but given that the framework only hit 1.0 in December 2010, I was thinking that early adopter and thus not all that "new to this" .... Anyway.
05:11 dimuls joined #mojo
05:17 mrphilov joined #mojo
05:23 Meiermann joined #mojo
05:32 ver joined #mojo
05:45 dimuls joined #mojo
05:51 thaljef joined #mojo
06:03 crab don't be offended.
06:04 crab that's not how it was meant. (as for an asynchronous insert example or anything else to do with mongodb, however, i have no idea)
06:11 mrphilov joined #mojo
06:11 Britzel joined #mojo
06:25 yakudza joined #mojo
06:36 dpetrov_ joined #mojo
06:59 spacebat I must admit to finding mojo routes pretty confusing, I might get something working, then come back a few weeks later and I'm lost again
06:59 dod joined #mojo
07:00 Vandal joined #mojo
07:02 spacebat say I want to authenticate a whole app or section thereof, I have $r->bridge('/')->to('main#auth_che​ck')->get('/')->to('main#index');
07:02 spacebat that kindof works but takes me back to the home page, when I might want to go elsewhere
07:04 spacebat likewise, is there a way to make a route just work for all the methods on a controller so I don't have to make a route for each action?
07:04 Britzel look for 'any' keyword
07:04 spacebat thanks
07:05 Britzel (instead of 'post', 'get' etc.)
07:14 spacebat ah what I mean is, say I have /login and /logout and /meh and so on, each has a function in the Main controller
07:15 spacebat is there a way of saying in one line that anything after / should look for a function in that controller
07:15 jast the way I understand things, for development convenience, all lowercase (iirc) methods are automatically exposed as actions
07:15 spacebat seems every time I add a page I have to create a function for it, then add a route for that function, then go and make a template for that action to render anything
07:16 spacebat or I get the error page saying that the request didn't match any route
07:17 spacebat guess what I'm looking for is a better way to reuse things
07:19 spacebat I don't seem to be getting any automated access to actions, it works so long as I explicitly specify everything in 3 places
07:22 trone joined #mojo
07:26 rem_lex| joined #mojo
07:26 dod joined #mojo
07:28 iankent qq, whats the 'right' way to call a route internally? i.e., match a route with /some/page in controller some#action, which I then want to call another-controller#action
07:36 arthas joined #mojo
07:36 Jonis anyone use html5 tidy for .ep files?
07:39 hrupp_ joined #mojo
07:39 spacebat I thought maybe $self->routes->route('/:acti​on')->to(controller=>'main', template=>'default') might work but no dice, nothing matches any route
08:01 crab that should work.
08:02 crab well, something like it should work, anyway.
08:02 crab iankent: there is no "internal redirect". either issue an http redirect, or just call your other function.
08:03 maxhq joined #mojo
08:04 crab i suppose you could use mojo's route matching machinery to translate a path into a class+method and call it, but that smells very wrong and i'd recommend avoiding it.
08:04 crab (given which, i don't know why i brought it up at all. maybe because the question was phrased that way.)
08:13 crab spacebat: have you read the routing guide?
08:18 cosmincx joined #mojo
08:23 iankent crab: thats sort of what I want tbh, I've got a config file which specifies the route in mojolicious shortcut style (namespace-controller#action), and was hoping I could get mojolicious to look that up, load the classes and call the action for me
08:23 iankent time to write a plugin :)
08:28 jzawodn joined #mojo
08:33 basiliscos joined #mojo
08:59 crab i knew you would want to do it as soon as i mentioned it. ;-)
08:59 crab but why don't you write a routing shortcut that takes a list of foo#bar and creates the right routes for them to begin with?
09:02 crab oh no, you want to redirect. ok.
09:05 crab weird. what are you really doing?
09:14 spacebat crab: I've read the guide, its not doing me much good
09:16 spacebat I have a love hate thing going on with the mojolicious docs, they seem well crafted and complete, until I need them for something specific and they don't help
09:17 spacebat source diving is the answer of course
09:17 jast yeah, my impression has been that the docs are much easier to read as an intro than as a reference
09:24 sri someone should write a book *hint hint*
09:29 crab what does one use to write a book these days?
09:29 crab pdflatex? something else?
09:30 jast depends on how much control you want over the layout. LaTeX does tend to get in your way...
09:31 mire joined #mojo
09:31 jast I like ConTeXt, but it's fairly underdocumented and they seem to be actively changing everything all the time
09:33 sri oreilly seems to want DocBook XML
09:35 sri modern perl book seems to have the most complete workflow for self publishing https://github.com/chromatic/modern_perl_book
09:35 crab cool.
09:36 crab and in pod, too. neat.
09:37 sri i guess you can generate anything from pod
09:38 sri suppose briandfoy might be using pod to write his books too https://github.com/briandfoy/Pod-DocBook
09:38 * crab palpates sri's pods
09:47 bpmedley spacebat: Still thre?
09:53 basiliscos1 joined #mojo
11:02 basiliscos joined #mojo
11:25 good_news_everyone joined #mojo
11:25 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/RqhecA
11:25 good_news_everyone mojo/master a49837a Sebastian Riedel: more documentation tweaks
11:25 good_news_everyone left #mojo
11:30 trone joined #mojo
11:32 dpetrov1 joined #mojo
12:13 punter joined #mojo
12:35 mire joined #mojo
12:54 toadflax joined #mojo
12:58 asarch joined #mojo
13:08 zekame joined #mojo
13:08 sri \o\
13:08 sri /o/
13:10 sri hmm, quality of questions on the mailing list decreases as the quality of the documentation increases :o
13:13 nic sri: Are you working on resque-like workers for mango?
13:13 nic (cos if so, I'm going to drop what I'm doing on redis)
13:13 sri not yet, have to finish the new core for mango first
13:13 nic k
13:22 abra joined #mojo
13:27 mrphilov joined #mojo
13:27 punter joined #mojo
13:27 basiliscos joined #mojo
13:27 maxhq joined #mojo
13:27 arthas joined #mojo
13:27 dod joined #mojo
13:27 Britzel joined #mojo
13:27 thaljef joined #mojo
13:27 Meiermann joined #mojo
13:27 sawtooth joined #mojo
13:27 sivoais joined #mojo
13:27 tianon joined #mojo
13:27 iSlug joined #mojo
13:27 sweet_kid joined #mojo
13:27 stan_theman joined #mojo
13:27 coff joined #mojo
13:27 Dandre joined #mojo
13:27 Grrrr joined #mojo
13:27 KindOne joined #mojo
13:27 Foxcool joined #mojo
13:27 kwa joined #mojo
13:27 mtths joined #mojo
13:27 duncanthrax joined #mojo
13:27 human39_ joined #mojo
13:27 bzero joined #mojo
13:27 salparadise joined #mojo
13:27 caeles joined #mojo
13:27 ruz joined #mojo
13:27 omega joined #mojo
13:27 phillipadsmith joined #mojo
13:27 marcus_ joined #mojo
13:27 cosimo joined #mojo
13:27 PerlJam joined #mojo
13:27 zivester joined #mojo
13:27 phips joined #mojo
13:27 BinGOs joined #mojo
13:27 cottoo joined #mojo
13:27 augensalat joined #mojo
13:27 bayashi joined #mojo
13:27 d^_^b joined #mojo
13:27 tardisx` joined #mojo
13:27 _mkrull joined #mojo
13:27 charsbar___ joined #mojo
13:27 HtbaaPi joined #mojo
13:27 al joined #mojo
13:27 gautier joined #mojo
13:27 ColonelPanic001 joined #mojo
13:27 bd joined #mojo
13:27 stokachu joined #mojo
13:27 andrefs joined #mojo
13:27 Caelum joined #mojo
13:27 mst joined #mojo
13:27 garu joined #mojo
13:27 nicomen joined #mojo
13:27 kmx joined #mojo
13:27 bc547 joined #mojo
13:27 depesz joined #mojo
13:27 Kovensky joined #mojo
13:27 tempire joined #mojo
13:27 crab joined #mojo
14:00 asarch joined #mojo
14:14 punter joined #mojo
14:47 KindOne joined #mojo
15:10 gryphon joined #mojo
15:13 bpmedley Woohoo.  Websockets are awesome.  Got it working in a few hours, thanks.
15:18 sri \o/
15:24 zekame joined #mojo
15:25 sh4 joined #mojo
15:27 sh4 joined #mojo
15:36 punter To make a chatroom, though, you need to use a single-process single-thread server, like Twiggy, right? Otherwise people will connect to different chatrooms depending on which webserver process they are on
15:36 punter Am I right?
15:36 punter (I'm talking about Websockets)
15:37 iankent punter: or some way of sharing between processes, which you'd need if you want any sort of scalability
15:37 punter hmmm
15:37 tianon Redis (and especially Mojo::Redis) makes that trivial ;)
15:37 tianon in fact, the basics of a websocket chat server are directly in the documentation for Mojo::Redis as one of the first examples :P
15:38 punter interesting
15:42 punter very interesting. I solved my scalability problem.
16:08 * phillipadsmith finds the example he's been looking for, http://blog.kraih.com/post​/43199352166/mangolicious
16:09 punter so a redis subscribe request will consume one whole connection?
16:10 punter Mojo::Redis says subscribe will take over my connection
16:10 punter So if I have 1,000 chatrooms, that means 1,000 connections?
16:22 basiliscos joined #mojo
16:23 mire joined #mojo
16:29 sri one connection per websocket is more common
16:37 lagrasta joined #mojo
16:37 d4rkie joined #mojo
16:40 lagrasta newb needs help please. urls linking to the public directory aren't working unless I lead off with a double slash like this: http://127.0.0.1:3000//public/test.html
16:40 lagrasta but this is not found: http://127.0.0.1:3000/public/test.html
17:26 punter joined #mojo
17:26 basiliscos joined #mojo
17:34 dod joined #mojo
17:53 punter iankent: Was Redis what you had in mind, too, when you mentioned "some way of sharing between processes" a while ago?
17:53 punter iankent: Or are there other ways as well?
17:57 zekame joined #mojo
17:59 sri redis is the most common one
18:00 sri even postgresql has a pub/sub system these days though
18:02 sri https://metacpan.org/module/DBD::Pg#pg_notifies
18:03 basiliscos joined #mojo
18:05 punter At work we use an Adobe FMS server, I believe for stuff like this
18:05 punter A waste of money, ey?
18:06 tba punter: lots of ways, depends if your processes will all be on one server, distributed or on a cloud
18:07 * tba is iankent btw
18:07 punter thanks
18:07 punter aha
18:11 punter I'll start with Redis and see.
18:23 dvinciguerra joined #mojo
18:28 punter It just occurred to me, that the Redis pub/sub model doesn't scale well. If the webserver has subscribed 1,000 times to receive the from Redis server the exact same message 1,000 times for your 1,000 concurrent users, network-wise you can't scale
18:29 punter Each webserver should subscribe only once, and distribute its message to its 1,000 users
18:29 punter multiplex it
18:30 punter I mean, you're better-off with a single process if you don't multiplex inside the webserver
18:30 punter simple math, I believe
18:32 punter To scale, only subscribe once per room per process
18:32 trone joined #mojo
18:42 asarch joined #mojo
18:56 punter sri: I see a bug on https://metacpan.org/module​/Mojo::Redis::Subscription - should I describe it here, or in github?
18:56 sri punter: it's not my module
18:56 punter it's not yours, sorry
18:57 preflex joined #mojo
19:05 Tiger joined #mojo
19:13 maxhq joined #mojo
19:51 d4rkie joined #mojo
20:15 mire joined #mojo
20:59 * sri just got two concurrent connections working in mango, getting closer!
21:00 sri it's still like playing jenga though :S
22:04 tianon keep up the good fight, sri; it is very much appreciated :)
22:09 sri almost working now, concurrent tests are already passing, just cleaning up some hacks now \o/
22:26 thaljef Anyone here used Input::Validator via MojoX::Validator?  I'm looking for good examples of composing custom constraints and form validators.
22:29 thaljef I've looked around on Google and GitHub, but not found anything helpful yet.
22:35 * sri wonders if mango commit messages would be too off-topic for #mojo
22:37 sri anyway
22:38 sri i've committed a first version of the new mango core with connection pool https://github.com/kraih/mango/commit/2​69910f04df16ca13357e38c773adc4966e8e019
22:38 sri still needs a lot of cleanup, but the basics are there
22:39 sri one of the tests uses a tailable cursor to wait on one connection while another connection does an insert, fun stuff
22:40 sri marty++ # thanks for sponsoring some of the work again
22:42 tianon \o/!!!
22:42 tianon sri: I don't think they'd be too off-topic here, but I love your Mango work, so I'm not exactly unbiased :)
22:42 preaction i'd say that Mango is a project related to Mojolicious. in the mojolicious family, as it were
23:00 xxtjaxx joined #mojo
23:55 asarch joined #mojo
23:58 gryphon joined #mojo

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