WebSocketStorage
class WebSocketStorage
This is the datatype that gets stored in UserCacheStorage. Vapor’s Services API uses this. Making this a class instead of a struct. This prevents internal modifications (e.g. adding/removing a value from the dicts) from causing the entire app.storage getting copied, in the case where app.storage is a value type composed of other value types. The custom setter for app.storage is not thread-safe. So, this is a workaround for app.storage having a non-thread-safe setter.
-
Declaration
Swift
var notificationSockets: [UUID : [UserSocket]]
-
Declaration
Swift
var fezSockets: [UUID : [UserSocket]]
-
Declaration
Swift
func getSockets<T>(app: Application, userIDs: T) -> [UserSocket] where T : Sequence, T.Element == <<error type>>
-
Declaration
Swift
func forwardToSockets(app: Application, users: [UUID], type: NotificationType, info: String)