On Mon, 13 Jul 2015 07:32:17 GMT, Taylor Gronka wrote:

source/views/user.d:

module bolt.views.user;
class UserViews {
	protected void register(HTTPServerRequest req, HTTPServerResponse res)
	{
        bks.addUser(req.form);
        res.render!("user/register.dt", req);
}

bolt.d:

module bolt.bolt;
import bolt.views.user;
class Bolt {
    private {
        auto USER = new UserViews;
        bks = new CassaClient("127.0.0.1", 9042, "bolt");
    }
...
    void register(URLRouter router) {
        router.get("register", $USER.register);
    }
}

Oh wait so.. this doesn't work.. I kind of didn't think it would. But I ran a test and got good results. Now I think I'm getting what I originally expected.. I must have made it mistake that made it look good.

Guess it's time to try threadlocal.