 # with our message protocol.
 
 _project_cache = {}
-new_project = (project_id, cb, delay) ->   # cb(err, project)
-    #winston.debug("project request (project_id=#{project_id})")
+new_project = (project_id) ->
     P = _project_cache[project_id]
-    if P?
-        if P == "instantiating"
-            if not delay?
-                delay = 500
-            else
-                delay = Math.min(15000, 1.2*delay)
-            # Try again; We must believe that the code
-            # doing the instantiation will terminate and correctly set P.
-            setTimeout((() -> new_project(project_id, cb, delay)), delay)
-        else
-            cb(undefined, P)
-    else
-        _project_cache[project_id] = "instantiating"
-        start_time = misc.walltime()
-        new Project project_id, (err, P) ->
-            winston.debug("new Project(#{project_id}): time= #{misc.walltime() - start_time}")
-            if err
-                delete _project_cache[project_id]
-                cb(err)
-            else
-                _project_cache[project_id] = P
-                cb(undefined, P)
-
+    if not P?
+        P = new Project(project_id)
+        _project_cache[project_id] = P
+    return P
 
 class Project
-    constructor: (@project_id, cb) ->
-        if not @project_id
-            cb("when creating Project, the project_id must be defined")
-            return
+    constructor: (@project_id) ->
         @dbg("instantiating Project class")
-
-        new_local_hub
-            project_id : @project_id
-            cb         : (err, hub) =>
-                if err
-                    cb(err)
-                else
-                    @local_hub = hub
-                    cb(undefined, @)
-
+        @local_hub = new_local_hub(@project_id)
         # we always look this up and cache it; it can be useful, e.g., in
         # the activity table.
         @get_info()

            catch e
                @dbg("_open_session_socket: exception ending existing socket: #{e}")
            delete @_sockets[opts.session_uuid]
            
        socket = undefined
        async.series([
            (cb) =>


        @local_hub_socket (err, socket) =>
            if err
                @dbg("call: failed to get socket -- #{err}")
                opts.cb?(err)
                return
            @dbg("call: get socket -- now writing message to the socket")
