Camelia, the Perl 6 bug

IRC log for #mojo, 2011-12-30

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

All times shown according to UTC.

Time Nick Message
00:31 jmhgtx joined #mojo
00:49 MojoGuest965 joined #mojo
00:49 MojoGuest965 From: http://www.google.de/url?sa=t&rct=j&q=i​rc%20websocket%20client&source=web&cd=2​&sqi=2&ved=0CCYQFjAB&url=http%3A%2F​%2Fdev.xantus.org%2F&ei=dgr9TqndL4bItAbgtsi​PCA&usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (1 hits)
00:49 MojoGuest965 left #mojo
00:51 MojoGuest476 joined #mojo
00:51 MojoGuest476 From: http://www.google.de/url?sa=t&rct=j&q=i​rc%20websocket%20client&source=web&cd=2​&sqi=2&ved=0CCYQFjAB&url=http%3A%2F​%2Fdev.xantus.org%2F&ei=dgr9TqndL4bItAbgtsi​PCA&usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (2 hits)
00:51 me joined #mojo
00:56 MojoGuest967 joined #mojo
00:56 MojoGuest967 From: http://www.google.de/url?sa=t&rct=j&q=i​rc%20websocket%20client&source=web&cd=2​&sqi=2&ved=0CCYQFjAB&url=http%3A%2F​%2Fdev.xantus.org%2F&ei=dgr9TqndL4bItAbgtsi​PCA&usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (3 hits)
00:56 MojoGuest837 joined #mojo
00:56 MojoGuest837 From: http://www.google.de/url?sa=t&rct=j&​q=mojo%20irc%20client&source=web&cd=​1&ved=0CCEQFjAA&url=http%3A%2F%2Fdev​.xantus.org%2F&ei=Pwz9ToL8B83JsgbhyNnEDg​&usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (1 hits)
01:22 hshong joined #mojo
01:40 buu joined #mojo
01:40 buu Hello happy friends.
01:44 * sri waves
02:00 sri nn..Zzz
02:05 ispy_ joined #mojo
02:06 buu While I'm asking questions, how do I access stuff being passed to ->render() in my custom renderer?
02:06 buu Is it in $r or $c or $options?
02:06 buu OH
02:06 buu Duh I'm being silly, It's in the stash
02:06 buu so I do $c->stash?
02:34 buu Anyone alive here? I'm trying to get my custom renderer to return stuff, I'm doing : sub render { my($r,$c,$output,$options) = @_;
02:34 buu $$output = "testing"; return; }
02:34 buu But the error log says something like "No output rendered assuming delayed response"
02:35 buu So apparently you have to return the results of setting $$output? What the hellness?
02:37 buu Well, you have to return a true value
02:46 marcus joined #mojo
03:02 tempire buu: have you taken a look at MojoX::Renderer::TT?
03:02 buu Not yet, no.
03:02 buu This is a good example?
03:02 tempire that's a working example you can find some insight with
03:02 buu Thanks.
03:07 bvierra joined #mojo
03:37 Psyche^ joined #mojo
04:40 tempire I have changed the world.
04:40 tempire google used to change the search for tempire to empire, and then ask whether you really wanted to search for tempire
04:41 tempire now it just searches, and my twitter account is the first result
04:41 tempire \o/
05:59 mire__ joined #mojo
06:07 preflex_ joined #mojo
06:07 MojoGuest330 joined #mojo
06:07 MojoGuest330 From: http://www.google.se/url?sa=t&rct=j&q=webs​ockets%20irc&source=web&cd=2&ved=0CDEQ​FjAB&url=http%3A%2F%2Fdev.xantus.org%2F&ei​=QFP9ToWQI4TR4QSa_d2NCA&usg=AFQjCNGw6nZv0wO42u​zUnHhWcD0vcKNULg&sig2=iLrMn2-ZQhHNG46OAb1E2w (1 hits)
06:08 MojoGuest923 joined #mojo
06:08 MojoGuest923 From: http://www.google.se/url?sa=t&rct=j&q=webs​ockets%20irc&source=web&cd=2&ved=0CDEQ​FjAB&url=http%3A%2F%2Fdev.xantus.org%2F&ei​=QFP9ToWQI4TR4QSa_d2NCA&usg=AFQjCNGw6nZv0wO42u​zUnHhWcD0vcKNULg&sig2=iLrMn2-ZQhHNG46OAb1E2w (2 hits)
06:47 Vandal joined #mojo
07:15 spleenjack joined #mojo
08:07 kaare joined #mojo
08:13 sugar joined #mojo
08:22 tholen42 joined #mojo
08:31 buu HRM.
08:31 buu I require DOCUMENTATION.
08:31 buu (For the documentation god)
08:32 buu Specifically what request do I make to get a static file?
08:34 marcus buu: hmm?
08:34 marcus buu: put static files in public dir
08:34 marcus for instance public/foo.txt
08:34 marcus mojo get /foot.txt
08:35 buu Oh
08:35 buu marcus: For some reason static->root was defaulting to /usr/bin/public
08:36 marcus buu: https://gist.github.com/1538774
08:37 marcus buu: yeah, that sounds wrong. it should be relative to home, as detected by Mojo::Home
08:38 buu marcus: Yes, well, it certainly wasn't working, but I set it manually in setup and it works now
08:39 marcus buu: are you using ::Lite or full_
08:39 buu Full
08:40 buu use mojo::base 'mojolicious'; . . .
08:40 marcus hopefully with a uppercase M
08:40 buu If it would make you happy!
08:40 marcus how do you run your app?
08:40 buu --daemon
08:40 buu Er, morbo
08:40 buu I take it back, I'm using morbo at the moment.
08:41 marcus good stuff :)
08:41 marcus anyways, you can set MOJO_HOME env var to force the issue.
08:42 marcus otherwise it should try to find it through the location of your MyApp.pm file
08:42 koban joined #mojo
08:42 marcus not sure how that ended up being /usr/bin =)
08:43 buu It turns out I don't have a myapp.pm
08:43 buu I have a myapp.pl!
08:43 marcus then you probably want to use Mojolicious::Lite
08:43 buu Just to confuse things.
08:44 buu Well, maybe, I was messing with the renderer so I thought I needed the full thing,
08:44 buu And I'm already wandering down that road.
08:44 marcus ::Lite is just sugar on top of the full thing
08:45 alnewkirk joined #mojo
08:45 buu Yeah
08:45 buu So I begin to understand.
08:45 tholen42 joined #mojo
09:15 lammel2 joined #mojo
09:47 GitHub35 joined #mojo
09:47 GitHub35 [mojo] kraih pushed 1 new commit to master: http://git.io/p6gBXg
09:47 GitHub35 [mojo/master] fixed renderer example - Sebastian Riedel
09:47 GitHub35 left #mojo
09:49 sri buu: and fixed
09:51 abra_ joined #mojo
11:05 marcus yay
11:05 marcus buu: what kind of renderer are you writing?
11:21 ZadYree Ah, one question: Is MojoX::Session::Store::MongoDB advised for making a sessions system, and are there some example codes out, I don't really understand everything?
11:23 Foxcool joined #mojo
11:25 marcus ZadYree: I usually use the built in client side session.
11:25 marcus stored in cookies
11:25 ZadYree Well, that's what I did, but my brain is so fucked up now!
11:26 ZadYree $self->redirect_to('/auth') unless ($sdb->db_connect->users->find({_id => MongoDB::OID->new(value => $sdb->decrypt($self->session->{uid}))})->count);
11:26 ZadYree that's twisted
11:26 ZadYree and prolly false
11:46 marcus seems overly complicated
11:47 judofyr joined #mojo
11:48 judofyr sri: you here? I have some feature requests that I'm wondering about… maybe better to discuss here than to open GH issues right away?
12:11 marcus need moar thermonuclear weapons?
12:31 Vandal joined #mojo
12:36 Foxcool joined #mojo
12:57 sri judofyr: don't ask to ask, ask
12:59 judofyr (1) Choose which port Test::Mojo starts the server on. right now it uses a random port, but I have some HTTP request recording/replaying I want to do (to make tests faster), but because the port number changes, the request changes (it includes a return-URL) and nothing is cached.
12:59 judofyr so just a Test::Mojo->new(port => 12345)
13:00 judofyr s/cached/replayed/
13:00 sri i'm opposed to that
13:00 Vandal joined #mojo
13:01 sri if you want more control over the daemon used internally then find an elegant way to expose the whole api
13:03 judofyr in that case: a public api to listen to more port after a server has started, and a public api for accessing the server of a Test::Mojo
13:03 sri no
13:03 judofyr (2) server support for CONNECT. I want to write a HTTPS proxy which modifies the TLS-stream. right now it's possible to define a "connect"-route, but Mojo threats the rest of the stream as more HTTP request. I need a way to tell Server that "I control this IO stream now". I thought it would be easy (because you already support WebSockets which does exactly that), but it seems you've just "hardcoded" support for WebSockets in Daemon.
13:03 sri i mean full control over the daemon used, not more wrapper apis nobody will ever use anyway
13:04 judofyr sri: I think we mean the same: so I can do: $test->server->also_listen_to(…)
13:04 sri no
13:05 judofyr or do you mean Test::Mojo->new(test_server => …) ? :S
13:05 sri i specifically don't want more useless methods/attributes
13:05 sri if you change the api you have to work with what we have now and simplify the whole thing
13:05 sri it's all experimental
13:06 sri no patchwork, you have to design everything from scratch with more versatility in mind
13:06 judofyr I see
13:06 sri and i don't understand what 2 means
13:07 sri it sounds like something i would be very much opposed to
13:07 judofyr sri: I want to do something like this without parsing HTTP requests myself: https://github.com/kraih/mojo/blob​/master/examples/connect-proxy.pl
13:08 judofyr because Mojolicious already is great at that
13:08 sri lets put it this way, if it adds more code to daemon i'm against it
13:08 sri if it makes the current daemon code easier, i'm all for it
13:09 sri guess that covers both actually :)
13:10 judofyr the plan would be to move code away from the daemon. daemon shouldn't worry about if the $tx is a websocket or HTTP or whatnot, it should just delegate stuff around and the "real" action should be in HTTP.pm and WebSocket.pm
13:11 sri that does sound a little naive
13:11 sri where would it keep state?
13:12 judofyr it sounds naive because I don't fully understand all the code yet ;)
13:12 sri for example, how do you handle the request limit a connection has?
13:13 sri or leftover data from pipelining
13:14 judofyr yeah, that's the tricky stuff :/
13:14 sri i won't lie to you, chances of such drastic changes getting accepted are very small
13:15 sri if it makes the current code simplier/more elegant, we can talk though
13:16 sri also, i'm not sure i understand your motivation
13:17 sri connect is very much not a standard http concept
13:19 judofyr well, I just want to write a connect-server without worrying about parsing the HTTP-part
13:19 judofyr although I guess a better approach would be to just use Mojo's HTTP parser
13:20 sri yes
13:20 judofyr but secondly, I just find it frustrating that I now have to write the same kind of code that's in Daemon
13:21 judofyr and it seems "wrong" that I can't reuse that code
13:21 judofyr but yeah, I don't know shit
13:21 judofyr so I'll probably just do it the pragmatic way
13:22 sri well, daemon does not really do connect
13:22 sri so you wouldn't be reusing much i think
13:23 judofyr it's the "fetch data from stream, pass it to transactor, deal with close/error-events"-part I want to reuse
13:25 sri you do know you can steal the stream from the daemon, right?
13:26 judofyr I tried, but I couldn't get to "steal" it properly
13:26 judofyr I just did some ->unsubscribe. is there a better way to steal it?
13:26 sri steal_handle and create a new stream
13:27 judofyr oh, there's a steal_handle…
13:27 judofyr haha
13:27 judofyr nice
13:27 sri the user agent does it for connect requests
13:27 sri for the tls upgrade after the connect request
13:28 judofyr nice. I think that actually solves my problem…
13:28 sri :)
13:28 judofyr why doesn't websocket use something like this?
13:29 sri websockets predate events
13:29 sri and the current code is simple enough
13:30 sri the whole stream api is also experimental, so be careful
13:33 sri pretty sure if websockets were implemented that way it would require more complicated code to make all events fire in the right order again
13:34 sri btw. about 1… i'm referring to ->test_server
13:36 judofyr why isn't ->test_server in the Mojolicious-class?
13:36 sri because they are not related
13:37 sri the user agent currently controls the test server
13:39 judofyr heh, that seems backwards to me
13:44 plu__ joined #mojo
13:44 sri then it shouldn't be too hard to make it more elegant and simpler ;p
14:00 Foxcool joined #mojo
14:01 sri that part of the api has been experimental for ages, i was expecting someone to revisit it at some point
14:01 sri not an easy to solve problem though, as you'll notice
14:07 koban left #mojo
14:24 plu_ joined #mojo
14:25 amoore joined #mojo
14:33 plu_ joined #mojo
14:40 sri https://github.com/kraih/mojo/issues/237 # btw
15:19 plu joined #mojo
15:47 sri judofyr: https://github.com/kraih/mojo/issues/258
15:53 tholen42 joined #mojo
15:57 sri marcus: didn't you try to get the mojolicious bundle into tm2?
16:01 xaka joined #mojo
16:22 marcus sri: I did. even sent them a mail. He said it would be a few days tho.
16:22 sri ah
16:26 marcus there hasn't been any new alphas during christmas, so probably they are busy stuffing their faces.
16:28 buu sri: Oh, haha, yeah, that return value threw me off for a bi
16:28 buu *bit
16:46 noganex_ joined #mojo
16:52 marcus joined #mojo
17:28 bvierra joined #mojo
18:12 tempire sri: I'm open to tackling the user agent splitting, but I'm not quite sure what you're envisioning.
18:12 tempire can haz guidance?
18:14 sri tempire: i have no clue
18:15 sri some ideas would be a good start :)
18:15 tempire lulz
18:15 tempire ok, so you just want it simplified, however that would happen
18:15 sri the test_server ticket might be related
18:15 * tempire hacksaws
18:16 * sri phears
18:17 sri no idea what to do with test_server either, just exposing $daemon could be a total disaster
18:25 Ivan joined #mojo
18:27 sri would be cool if the test server code could be moved to Test::Mojo, but i just don't see that happening
18:28 sri unless
18:29 sri hmm
18:29 sri no :(
18:30 sri app is tied to the useragent
18:34 inokenty joined #mojo
18:53 tholen42 joined #mojo
19:06 sri tempire: i'd like to hear your plans though
19:06 tempire When I have one, I'll speak up
19:06 sri :)
19:07 sri i'm just gonna stay as far away from those two issues as i can
19:07 sri driving me crazy
19:08 tempire there's no rush.  ua and test_server work just fine as they are.  it's reasonable to wait until something presents itself.
19:09 sri true
19:09 * tempire redirects sri's focus to mongodb
19:10 sri suppose we better degrade test_server issue to wishlist state
19:10 sri or actually… at some point it needs to be decided anyway
19:14 sri wonder what to do when we have an issue that's open for a long time like respond_to and no clear consensus can be reached, just majority vote?
19:15 grim_fandango joined #mojo
19:16 sri in that specific case there also seems to be a lack of interest, which could be interpreted as "it already works well"
19:16 sri https://github.com/kraih/mojo/issues/237
19:17 sri i bet as soon as we decide to stabilze it there will be discussions popping up :D
19:17 tempire I finally took the time last night to understand the problem, and the current solution is the only one that makes sense.
19:17 sri tempire++
19:19 tempire I liked the idea of making respond_to input a list, but that renders the order of mime types in the accept header useless.
19:19 tempire so you can either go back and forth about whether the accept header or the respond_to takes priority, but either way, there's confusion.
19:20 * sri nods
19:20 tempire one mime type in the accept header is the only use case that seems reasonable to me
19:20 tempire and since use cases are king in here, it wins
19:28 tempire stabilizing respond_to, and keeping the way we treat accept headers is splitting hairs to me.
19:28 tempire no one will understand that distinction.
19:29 tempire *keeping the way we treat accept headers as experimental
19:30 buu If I have "MyApp::Controller::Flibble" how do I write my route->get->to() call?
19:31 buu Specifically the to() portion, the example is merely 'foo#bar'
19:31 tempire http://mojolicio.us/perldoc/Mojolicious/Gui​des/Routing#Route_to_class_28_namespace_29
19:32 buu Oh
19:32 buu Wacky.
19:32 buu I was looking here http://search.cpan.org/~tempire/Mojolic​ious-2.41/lib/Mojolicious/Routes.pm#get =/
19:33 tempire buu: before you start looking directly at the api docs, if you take 15 minutes and read the guides in the order they're listed on http://mojolicio.us/perldoc, you'll save yourself hours
19:33 tempire maybe even days
19:34 buu Heh, apparently yes, there is much information in guides not in the api. It's such a habit in perl land to go to perldoc flibble::bar; though
19:34 tempire true enough
19:34 * tempire reprograms buu
19:34 * buu explodes
19:35 tholen42 joined #mojo
19:39 buu tempire: I'm reading the docs, but let me ask a question question, what's the convention for adding routes to an app? Doing them all in sub startup?
19:39 tempire in a full app, yes.
19:41 buu tempire: My instincts lead me to have each controller add its own routes
19:41 buu Having a giant list of routes seems a bit clumsy
19:42 tempire that's the way catalyst does it, but it doesn't scale well.
19:42 tempire it seems easier until you try to manage it
19:42 tempire consider:
19:42 tempire 50 routes in many different files
19:42 tempire then you have to rely on tools to tell you what's going on
19:42 tempire with a startup sub, it's all right there.
19:42 tempire managed and changeable in one location
19:43 tempire the system itself handles the problem, without the use of tools
19:43 tempire I used to think the same way, but I then saw the light
19:43 buu Hrm.
19:44 tempire also consider, sri felt the same way when he designed catalyst that way
19:44 buu tempire: To my mind it's the same argument about putting the code in modules in the first place.. it abstracts it away so you don't have to worry about every piece at the same time.
19:44 tempire and then he saw the inherent problems with it
19:44 buu I can see the value of having every route in the same place since they affect each other
19:45 tempire right - think about having to manage 50 routes with all sorts of different chain dependencies
19:45 tempire ack!
19:45 tempire with a couple bridges in startup, it's easy to see what goes where, when
19:45 buu Yeah
19:45 tempire you can always create an app plugin that makes it work catalyst-y if you want
19:45 buu This application has like two routes total anyway
19:46 tempire if it's only two routes, you might want to think about just using lite
19:46 tempire unless it's just for learning purposes, then by all means do what you want
19:46 buu =]
19:46 tempire mojocasts.com is a lite app, and it's really easy to manage with just one file
19:47 buu Mostly learning I'd say, but lite doesn't seem to offer *that* much
19:47 buu Maybe I haven't experienced it yet. Also, templates inside code make me break out in hives.
19:47 tempire it offers pretty much everything that full does.  just in a more accessible way.
19:48 tempire it's all about fitting the problem at hand.  if it's tiny, embedded templates work out well
19:48 buu Yeah of course.
19:48 buu I have this tendency to over-engineer things you see..
19:49 buu tempire: One last question, for the moment, do /:params go into self->param or self->stash? The documentation says stash, which seems a bit odd
19:49 tempire both
19:50 buu Wacky.
19:50 tempire ->param is a shortcut to ->req->param, so that describes the request, and is static
19:50 Ivan left #mojo
19:50 tempire they're put in the stash for accessibility
19:50 ivan joined #mojo
19:50 sri stash goes all the way from routes to templates
19:50 buu Do most people access via the stash then?
19:51 sri perl -Mojo -E'a("/" => {data => "hello buu!"})->start' get /
19:51 tempire oh, I misread.  you said /:params, not ?params
19:51 sri it's the reason you can do fun stuff like that
19:52 buu tempire: Yar, :param. But apparently those go into the stash.
19:52 sri and ->param
19:52 buu Oh.
19:53 sri marcus: what are your thoughts on respond_to?
20:00 sri if you both agree i'll just remove experimental status
20:08 buu sri: Are you familiar with expressjs?
20:08 buu Or more specifically, html-welder?
20:09 sri you mean weld.js?
20:11 chansen joined #mojo
20:13 mire joined #mojo
20:15 sri http://jade-lang.com # is way more popular
20:17 sri i like the idea of using css selector for templating, but hate it in practice
20:19 tholen42 joined #mojo
20:19 sri buu: don't know if you've seen this style yet, but i kinda like indented perl lines in html https://github.com/kraih/mojo/blob/master/​lib/Mojolicious/templates/mojobar.html.ep
20:20 sri not just code, also expressions
20:27 * crab finally returns home
20:27 * sri waves
20:28 sri food was good?
20:29 buu sri: So far I'm quite enjoying html selector templating but I haven't used it in anything resembling production yet
20:30 buu It makes for some really elegant interactions, but perhaps it will fall apart under more stress.
20:31 sri how do you handle layouts?
20:32 * sri suspects you could insert fragments with selectors
20:33 sri but that in turn would mean multiple parser instances burning cpu
20:36 sri to make it really perform well i think you would have to precompile perl code from the html+selectors that only takes a data structure for rendering
20:37 sri i've considered something like that once based on Mojo::DOM
20:45 marcus sri: I agree
20:45 sri oh my
20:46 * sri suspects crab will agree too
20:46 buu sri: I'm inserting html fragments, at the moment I'm using TreeBuilder, I figure I'd get somethingi running before I see where it falls down
20:46 buu Page1 is rendered to text then inserted as the contents of layout.html
20:47 buu I'm hoping just really aggressive caching will get my past any performance issues I might have.
20:47 perlite joined #mojo
20:50 buu Very nice.
20:50 purl Very nice. is, like, the link in the mxd docs still pointing at the right place
20:50 buu I enjoy writing code like: <ul><li class="fooberitem"></li></ul> then in my controller  I just do fooberitem => [ qw/a b c d/ ]
20:50 buu Which is cute.
20:52 crab what do i agree with?
20:53 marcus crab: stabilizing respond_to as it stands
20:53 crab yes
20:56 tempire left #mojo
20:56 tempire joined #mojo
20:58 GitHub60 joined #mojo
20:58 GitHub60 [mojo] kraih pushed 1 new commit to master: http://git.io/zVt77w
20:58 GitHub60 [mojo/master] removed experimental status from respond_to method in Mojolicious::Controller - Sebastian Riedel
20:58 GitHub60 left #mojo
20:58 marcus hmm, starman doesn't support nonblocking psgi?
21:00 sri define non-blocking psgi
21:03 sri workers handle just one client connection at a time, but i think it does psgix.streaming
21:05 marcus sri: someone was complaining that plugin-proxy wasn't working, then ended up saying it won't work nonblocking under starman because of 'psgi.nonblocking' => Plack::Util::FALSE,
21:06 sri i'm actually not exactly sure what psgi.nonblocking does
21:07 sri FAQ has me believe that it signals an AnyEvent based server or so
21:09 sri or poll_cb or so
21:09 sri anyway, we don't do psgi extensions
21:09 sri so its presence shouldn't make a difference
21:12 marcus sri: guess it's render_later that doesn't work under psgi servers like starman then?
21:12 sri wait
21:13 sri you're making a non-blocking Mojo::UserAgent request?
21:13 marcus sri: http://paste.scsys.co.uk/171967
21:13 marcus sri: that's what the proxy plugin does, yeah.
21:14 sri non-blocking user agent requests depend on Mojo::IOLoop running
21:15 sri which is not the case with psgi
21:15 marcus guess I could change it to support blocking to be more compatible.
21:15 marcus sri: is there an easy way to check if we have a ioloop running?
21:15 sri Mojo::IOLoop->is_running :)
21:16 marcus mm
21:16 sri just thought if we should make the user agent die if there's no ioloop running… but that kills about a thousand tests
21:17 sri start ioloop after starting the request is also a documented pattern
21:32 mire joined #mojo
21:42 sri tempire: problem with keeping test_server experimental is of course that we can't really test stuff like basic auth
21:51 diegok hello, just updated and found UA lost the log attribute :(
21:54 diegok ^ hm, I guess I should add a cb to on('error')...
22:01 tholen42 joined #mojo
22:04 batman joined #mojo
22:37 sri tempire: actually i'm not even sure Mojo::UserAgent can be really split up further :S
22:39 sri perhaps i shouldn't open wishlist issues open that might be impossible
22:39 sri *-open
22:42 sri marcus/crab: you two need to comment more on issues ;p
22:47 marcus :>
22:47 * marcus goes back to his lego project.
22:58 tempire I think that's why it's confusing.  there's no apparent want to split it up.
22:58 tempire the concepts seem too intertwined
22:59 Andrei666 joined #mojo
22:59 tempire the problem with crab and marcus is that they have real jobs
22:59 tempire or so it seems
23:00 Andrei666 hey guys
23:01 Andrei666 i have a question....i'm still learning mojo and i'm trying to figure out stuff
23:01 Andrei666 so I have a simple mojo lite_app
23:01 tempire Andrei666: have you watched the mojocasts?
23:01 Andrei666 yes, I did...
23:01 tempire excellent
23:01 Andrei666 read the documentation...
23:01 Andrei666 and stuff
23:02 Andrei666 but i;m a noob at web programming...and I might not get things done..or..i haven't learned them yet :)
23:02 tempire there's nothing wrong with n00bdom
23:02 Andrei666 I've seen that Glen recently did the mojocast #5 :)
23:02 tempire that Glen is a class act
23:02 Andrei666 it's a good one...
23:02 Andrei666 indeed, it is
23:03 Andrei666 I needed that UA tutorial :)
23:03 Andrei666 for some scraping :P
23:03 Andrei666 so...
23:03 sri tempire is glen :)
23:03 Andrei666 :D
23:03 Andrei666 really?
23:04 Andrei666 thanks sri :P
23:04 tempire noooooooooo!
23:04 Andrei666 I didn't knew that :D
23:04 sri secret identity?
23:04 Andrei666 :D :D
23:04 Andrei666 tempire (bow)
23:04 Andrei666 nice...i like the mojocasts :p
23:04 Andrei666 i really do...
23:04 Andrei666 they're helpfull :)
23:04 Andrei666 >D
23:04 Andrei666 :D
23:06 sri btw. agree about concepts in user agent being intertwined
23:07 sri and i guess it has to be that way
23:07 not_tempire I don't think it's that complicated
23:07 not_tempire the methods are clearly labeled
23:07 not_tempire it's fairly easy to determine what does what
23:08 sri it's fine right now, i'm just worried about the future
23:08 not_tempire maybe that's because I've seen it so many times
23:08 sri you know, when we add another 400 lines of new functionality
23:08 not_tempire but it's not like there's parameterized roles laying about
23:08 not_tempire at that point, the necessary separation will become apparent
23:12 sri closed the issue for now
23:12 Andrei666 ahm...my lite_app, first greets the visitor and asks for his name, then it goes to a post action, that stashes the name with $self->param() and renders a second template, that greets the visitor with his name and asks for his favorite colour, and then again..it goes to anther post action, that I want to say "hello $visitor_name, your favorite colour is...."
23:13 Andrei666 but I don't know how to send the name from the second template...to the second post action..that renders ..the last template..
23:13 not_tempire the easiest way is to use the session
23:13 Andrei666 hmm..
23:14 Andrei666 so instead of stashing the name like $self->stash(name => $self->param('...'));
23:15 Andrei666 i should use $self->session....?
23:15 not_tempire try it
23:16 Andrei666 :(
23:16 Andrei666 global symbol $name requires explicit package name...at template...
23:16 bvierra_ joined #mojo
23:17 not_tempire http://mojocasts.com/e4#Session
23:18 memowe not_tempire: but ... if you aren't tempire ... where did he go?
23:18 not_tempire to watch episodes of Community
23:20 sri \o/
23:22 Andrei666 not_tempire: i did try it...
23:24 Andrei666 bow....:)
23:24 Andrei666 yessss...
23:24 Andrei666 it's alive :P
23:26 Andrei666 so...let me get this straight..
23:26 Andrei666 if I want multiple scalars to be tossed around between controller in a non_lite app
23:27 Andrei666 they should all go in the session ...right?
23:27 Andrei666 and not in the stash...
23:27 not_tempire stash if for one request only
23:27 Andrei666 session is for all requests.. :)
23:27 memowe has nothing to do with lite or non lite app.
23:27 Andrei666 ok
23:27 not_tempire right, lite or full app, it's the same
23:27 Andrei666 ok, got that :P
23:28 Andrei666 one more :p
23:28 not_tempire ideally, you want to store a session id in the session, and store all your "session" stuff in a database
23:28 not_tempire but for simple stuff, storing it with ->session is fine
23:28 Andrei666 oh..
23:28 Andrei666 ok
23:28 Andrei666 and if I have multiple controller that have scalars with the same name
23:29 Andrei666 will their values be overwritten?
23:29 not_tempire yes
23:29 sri hmm, maybe we can get away with small changes to test_server
23:29 Andrei666 and is your proposal, the one with session id... a workaround this?
23:30 not_tempire a workaround for what?
23:30 sri $t->test_server(scheme => 'https', inactivity_timeout => 0, websocket_timeout => 0)
23:30 Andrei666 for not overwriting the scalar that have the same name..
23:30 sri exposing the whole daemon seems unwise
23:31 not_tempire workaround doesn't apply.  that's just what a session is.  design accordingly.
23:31 Andrei666 ok
23:31 Andrei666 thanks
23:34 sri on the other hand, you never know what events the daemon might emit in the future...
23:34 sri grr
23:35 sri and i'm getting a headcache again trying to solve this :S
23:35 sri hehe, headcache… i need one of those

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