Ringobot log - RingoJS IRC channel: #ringojs on irc.freenode.net
2010-05-17:
[7:57] <gmosx> good morning...[8:04] <hannesw_> good morning
[8:05] <gmosx> module.shared = true doesnt work for my use case either
[8:05] <gmosx> I have a module with a 'cache' variable
[8:05] <hannesw> is it your own module?
[8:05] <gmosx> yes
[8:06] <hannesw> why doesn't module.shared work?
[8:06] <gmosx> I 've put module.shared = true on top
[8:06] <gmosx> I have code similar to this
[8:06] <gmosx> var cache = {};
[8:06] <gmosx> if (!cache[key]) {....; cache[key] = val; } else {...}
[8:07] <gmosx> the cache is always empty on every refresh
[8:07] <gmosx> (ie the else clause is never executed)
[8:10] <gmosx> any idea?
[8:11] <hannesw> no, that should work
[8:11] <hannesw> can you put a print("something") statement in the top level scope of that module to see if it is actually reevaluated on each request?
[8:25] <gmosx> hmm the module is not revaluated... strange...
[8:25] <gmosx> I will have a better look, bbl
[8:28] <gmosx> ok, I had to add module.shared to multiple modules for this to work...
[8:29] <gmosx> Would it be too much to ask for a servlet option that makes shared=true the default?
[8:30] <gmosx> i mean this module.shared hack is not compatible with the commonjs proposal, narwhal does not support it, and I don't think node supports it.
[8:30] <hannesw> it should be compatible
[8:31] <hannesw> but yes, i'm considering making shared = true the default
[8:31] <gmosx> perhaps this can be an option
[8:31] <gmosx> module-shared
[8:32] <gmosx> on the positive side, I am now switched 100% to RingoJS ;-)
[8:32] <hannesw> that's very cool!
[8:33] <hannesw> I'll consider doing something about the shared issue
[8:33] <hannesw> i already considered making shared the default, and allowing modules to "opt out"
[8:34] <gmosx> imho, that would be a better default...
[8:34] <hannesw> yes, maybe..
[8:35] <gmosx> a quick grep revealed that most ringojs' modules jave shared=true anw...
[8:35] <hannesw> true
[8:36] <hannesw> there's only one module which must not be shared which is ringo/webapp/env, and i want to get rid of that (reimplement it) anyway
[8:41] <gmosx> I had a quick look at env, it looked like a strange implementation...
[8:41] <gmosx> (dunno remember why though ;-))
[8:42] <gmosx> btw, a question:
[8:43] <gmosx> if you know, when the servlet is running on appengine, each request goes to a separate thread? if I have shared=true in the config module can
[8:43] <gmosx> I avoid reinitialization on each request?
[8:53] <hannesw> gmosx: yes, with shared = true the module is not initialized for each request/thread
[8:53] <gmosx> but I still have to add module=true to every single module in my app (and all the dependencies), not good, I really hope you change the default.
[8:59] <ringostarr> 0221a4b Hannes Walln?fer: Bump version to 0.5
[8:59] <ringostarr> df118a6 Hannes Walln?fer: Add addServlet() method to ringo/httpserver.Server
[8:59] <ringostarr> e58437e Hannes Walln?fer: Minor cleanup
[9:23] <robi42> hannesw, if you don't mind i'd blog your websocket protocol code snippet?
[9:23] <hannesw> robi42 did you try it?
[9:23] <hannesw> it isn't working yet
[9:23] <robi42> oh, ok. :)
[9:23] <hannesw> still working on it with mr. rinner
[9:23] <robi42> i see :)
[9:25] <robi42> where's the catch?
[9:35] <robi42> btw, just tried and at least websocket servlet `doGet`'s working here
[9:45] <hannesw> now it's working
[9:45] <hannesw> http://gist.github.com/403604
[9:46] <hannesw> will also switch ringo-cometd to new addServlet() method so we don't need a custom jetty.xml...
[9:47] <robi42> great
[10:00] <robi42> hm, getting "java.lang.NoSuchMethodError: org.eclipse.jetty.io.AsyncEndPoint.cancelIdle()" here. but probably i'm doing something wrong. :)
[10:01] <hannesw> mixing different versions of jetty?
[10:02] <robi42> possibly
[10:03] <robi42> which websocket jar version's recommended, btw? got jetty-websocket-7.1.0.v20100505
[10:04] <hannesw> always use the same as your other jetty fiels
[10:05] <robi42> ok
[10:09] <robi42> yay, it's working.
[10:16] <robi42> will/would we provide that as a package?
[10:18] <ringostarr> 8677fbb Hannes Walln?fer: Add some options to Server.addServlet()
[10:32] <hannesw> we could
[10:47] <robi42> hannesw, shall we host it on ringo github account?
[10:47] <robi42> (just packaged it up)
[10:59] <robi42> hannesw, fyi: put (working) package there meanwhile: http://dav.robert42.com/ringo-websocket.zip
[11:25] <hannesw> robi42: i don't think this should be a ringo maintained package
[11:25] <hannesw> also, this is currently missing an API an actual application could use
[11:26] <hannesw> it's just a demo really, for a technoligy that is not yet widely implemented
[11:29] <robi42> isn't the actual api html5 websocket client one?
[11:31] <hannesw_> i was talking about the server side API
[11:31] <robi42> ok
[11:49] <robi42> hi rist, fyi: put up a little package of experimental websocket support, so one could simply `bin/ringo-admin install http://dav.robert42.com/ringo-websocket.zip` to give it a spin
[11:49] <rist> swa it already in the chat logs
[11:49] <rist> thanks
[11:52] <ringostarr> 44f458f Hannes Walln?fer: Fix API doc
[12:04] <robi42> hannesw, webapp skeleton is a bit "untidy", may i push little cleanup? (looking at actions.js stub index action, that is)
[12:05] <hannesw> robi42 sure
[12:05] <hannesw> also, i think we need to get namespace-skeleton out of packages.
[12:07] <robi42> agreed
[12:08] <robi42> one place for all skeletons/stubs could be useful?
[12:08] <ringostarr> 43ab247 Robert Thurnher: Tidy skeleton app a little (index action and base skin stub).
[12:31] <hannesw> updating ringojs.org to a current snapshot
[13:09] <robi42> (fyi: updated log.robert42.com to current ringo master snapshot as well)
[13:47] <ringostarr> be01260 Hannes Walln?fer: Make modules shared by default, allow to opt for single-threaded operation via module.shared = false
[13:48] <hannesw> I switched module default state to be shared
[15:32] <ringostarr> ea67b06 Hannes Walln?fer: Refresh jetty.xml: increase number of acceptors, enable graceful shutdown, reset some settings to their deault value.
[16:43] <earl> hannesw: with modules now being shared by default, should we probably remove all explicit `shared = true` settings?
[17:52] <hannesw> earl: yes maybe
[17:55] <hannesw> good evening!
[17:55] <hannesw> ready when you are :)
[18:04] <robi42> i'm here :)
[18:07] <hannesw> fixing some fileuplaod issues
[18:09] <robi42> hannesw, after that 0.5 should be ready in your opinion?
[18:09] <hannesw> well, almost.
[18:09] <robi42> what's missing?
[18:10] <oberhamsi> i'm mostly here as well :)
[18:25] <ringostarr> 3ab17bc Hannes Walln?fer: Fix buffer alignment, rename and document stream factory functions.
[18:26] <hannesw> hey oberhamsi if we're 3 that's enough for a meeting :)
[18:26] <hannesw> robi42 can't say, i keep testing and finding things i want to fix
[18:26] <hannesw> but i think we're almost there
[18:27] <robi42> dropping out for dinner shortly, sorry :)
[18:29] <ringostarr> f2b96d3 Hannes Walln?fer: Fix proper webapp config module not being used.
[19:36] <gmosx> hannesw: thanks for making shared the default!
[19:47] <xchl> hello all!
[19:48] <hannesw> hey xchl!
[19:48] <xchl> big changes w/ shared-modules-as-default!
[19:48] <hannesw> you think? not so big imo
[19:48] <hannesw> have been pondering this for a long time
[19:48] <xchl> behaviour that way is probably closer to what people (incl. me) would expect ...
[19:48] <hannesw> think it's the right thing to do
[19:48] <hannesw> yep
[19:49] <hannesw> think so too
[19:49] <robi42> should it also have an impact on performance, btw?
[19:49] <xchl> in any case, that module (not-)sharing business would profit tremendously from a bit of documentation
[19:49] <xchl> (but maybe there is already and I haven't stumbled across it yet)
[19:49] <hannesw> robi42 yes
[19:49] <hannesw> xchl indeed
[19:50] <hannesw> i think i wrote about it somewhere somtime
[19:50] <robi42> ah great, was wondering why log.robert42.com suddenly feels snappier :)
[19:50] <xchl> _even_ snappier :)
[19:50] <robi42> :)
[19:52] <robi42> actually we could also allow for disabling skin reloading in production, no?
[19:52] <gmosx> hey all ;-)
[19:53] <gmosx> 0.5 is shaping up to be a *great* release
[19:53] <xchl> hannesw: http://ringojs.org/wiki/Modules_and_Scopes/ - that's probably what you were thinking about
[19:53] <hannesw> right
[19:53] <xchl> hey gmosx!
[19:54] <xchl> appenginejs almost makes me want to check out appengine ;-)
[19:54] <hannesw> gmosx thanks, you contributed to that too
[19:54] <gmosx> hannesw: nah, hopefully I can contribute in the 0.6 cycle
[19:54] <gmosx> xchl: appengine is great ;-)
[19:56] <gmosx> xchl: most probably the best way to get from a 'toy' web app to a real world web app (no need to worry about infrastructure and restrictions that guide you)
[19:56] <hannesw> the one thing i dislike about appengine is the long initial load time
[19:56] <hannesw> otherwise it's truely great
[19:56] <gmosx> just use the cron trick
[19:57] <gmosx> or wait for reserved instances (is on the roadmap)
[19:57] <xchl> hannesw: I guess that's not really an issue for apps that are actually used, right?
[19:57] <gmosx> hannesw: what I really love about appengine is that you need no system administration ;-)
[19:57] <robi42> cron trick works fine there, yep
[19:58] <hannesw> xchl depends on what you call used :) gmosx didn't know about reserved instances, interesting
[19:58] <gmosx> hannesw: and you can't beat the price (for small apps)
[19:58] <gmosx> hannesw: have a look at the roadmap:
[19:58] <gmosx> http://code.google.com/appengine/docs/roadmap.html
[20:00] <hannesw> interesting!
[20:01] <gmosx> yeah
[20:02] <xchl> ahhh, lots of my early gripes have been fixed
[20:03] <robi42> having appenginejs supported on top of ringo's really awesome, thanks gmosx
[20:03] <gmosx> a lot is fixed... it's a great platform now, and the possibilities for the future are boundless...
[20:04] <xchl> and appenginejs' pythonic api looks very nice, indeed
[20:04] <gmosx> and you can use javascript now, what more can you ask ;-)
[20:04] <gmosx> I try to mirror the Python API exactly, this way there is no need to write docs (can reuse the Python docs)
[20:04] <robi42> great
[20:05] <gmosx> the Java API felt to alien for Javascript, so I decided to port the Python API
[20:06] <xchl> that was/is an excellent idea
[20:06] <gmosx> :)
[20:06] <xchl> is the component status on appenginejs.org still up-to-date?
[20:07] <gmosx> the components mostly work ;-)
[20:07] <gmosx> perhaps I should increase the percentages...
[20:07] <gmosx> more or less everything works...
[20:08] <xchl> is there a work roadmap somewhere? in the recent mails, you mentioned that you'd like some help ...
[20:08] <gmosx> but I need some help from hannes to optimize some low level code in the datastore api (that was one of the reasons of switching to ringojs ;-))
[20:08] <xchl> ah, ok :)
[20:08] <gmosx> hmm, I can post some kind of roadmap or stuff that needs to get done...
[20:09] <gmosx> one example is google.appengine.ext.webapp
[20:09] <gmosx> haven't converted that because I use JSGI/Nitro...
[20:09] <gmosx> but it would be great to have for completeness...
[20:09] <gmosx> (if I find a volunteer that is)
[20:10] <gmosx> another thing that is missing and that is probably easier to add is support for GQL in the datastore API...
[20:10] <gmosx> anw, if you are interested, try the examples, play a bit with the code (I will help you with any questions you might have) and then we can see If you can help...
[20:11] <xchl> yes, will do so!
[20:11] <gmosx> thanks...
[21:26] <ringostarr> 5748200 Hannes Walln?fer: Some tweaks in basicauth middleware, add api docs
[21:26] <hannesw> i made some changes to basicauth middleware
[21:26] <hannesw> let me know if you have troubles with these
[21:33] <robi42> hannesw, looks and works fine
[21:34] <hannesw> i'm not sure if we should remove surrounding slashes
[21:34] <hannesw> maybe yes
[21:42] <ringostarr> 36fca8b Andreas Bolka: Drop explicit module.shared=true, it's now the default
[21:45] <robi42> well, this way one has to provide root slashes for realms in config.js (which is fine, imho)
[21:49] <robi42> basically, `secure[/area]: credentials` vs. `/secure[/area]: credentials` (config-wise)
[21:50] <robi42> (while the latter realm def. needs to be a string literal, of course)
[21:51] <ringostarr> 7d1bdf9 Hannes Walln?fer: Fix jsdoc links
[22:02] <ringostarr> a62c901 Andreas Bolka: Drop now unneeded shared=true in apps
[22:03] <earl> (also updated ringowiki to remove shared=true)
[22:03] <earl> (i see robi also updated ringo-hibernate: great!)
[22:05] <robi42> (and ringolog :) )
