Author: Not specified Language: javascript
Description: (v21) Timestamp: 2018-06-12 22:16:40 +0000
View raw paste Parent paste by: Not specified - Child paste by: Not specified Reply
  1. func createTrackingSession(for request: Request) -> Future<TrackingSession> {
  2.     return request.makeNewSession()
  3. }
  4.  
  5. func getTrackingSession(for request: Request) -> Future<TrackingSession> {
  6.     let session: TrackingSession? = TrackingSession(id: request.getKey())
  7.  
  8.     guard let createdSession = session else {
  9.         return createTrackingSession(for: request)
  10.     }
  11.  
  12.     return Future.map(on: request) { createdSession }
  13. }
View raw paste Parent paste by: Not specified - Child paste by: Not specified Reply