Misc cleanups
2 unresolved threads
2 unresolved threads
@lewolff could you have a look? This is very lightly tested.
And @vairoli if you could help with testing that would be great.
This should be merged after !20 (merged)
Merge request reports
Activity
requested review from @lewolff
assigned to @korban
39 32 40 33 /** Initialize an empty session list for the given app instance */ 41 34 def initializeApp(instanceId: InstanceId) = 42 35 require(!sessions.contains(instanceId)) 43 sessions(instanceId) = Seq.empty 44 45 /** Runs k with parameters parsed from the websocket connection path. [[k]] is 46 * run while synchronizing on [[sessions]] 47 * 48 * The connection should be on "ws://…/[app_instance_id]/[user_id]" for the 49 * parsing to function properly. 50 */ 51 private def withSessionParams[T](socket: WebSocket)(k: (InstanceId, UserId) => T) = 36 sessions = sessions.updated(instanceId, Map.empty.withDefaultValue(Set.empty)) 37 38 def shutdownApp(instanceId: InstanceId): Unit = I think you're right. But to do this cleanly I'm going to need a lot more refactoring. @vairoli I think I'll handle the issue with the ClockDrivenApp encoding at the same time.
Done in !25 (merged) . I will close this one.
47 * 48 * The connection should be on "ws://…/[app_instance_id]/[user_id]" for the 49 * parsing to function properly. 50 */ 51 private def withSessionParams[T](socket: WebSocket)(k: (InstanceId, UserId) => T) = 36 sessions = sessions.updated(instanceId, Map.empty.withDefaultValue(Set.empty)) 37 38 def shutdownApp(instanceId: InstanceId): Unit = 39 for by_client <- sessions.values 40 channels <- by_client.values 41 channel <- channels 42 do 43 channel.send(cask.Ws.Close()) 44 sessions = sessions - instanceId 45 46 def connect(instanceId: String, userId: String) Actually since it includes the code from !20 (merged) , this review belongs to !20 (merged) rather than here I think.
Superseded by !25 (merged)
mentioned in merge request !20 (merged)
Please register or sign in to reply