public async Task <TempSessionWithSecrets> CreateTemporarySession() { Init(); var session = await _temporarySessionApi.SessionPutAsync(); _tempSessions.Add(session); return(session); }
public async Task <TempSessionWithSecrets> CreateTemporarySession() { Init(); // Ensure this does not run as part of a coroutine - force it to // a background thread with Task.Run. return(await Task.Run(async() => { var session = await _temporarySessionApi.SessionPutAsync(); _tempSessions.Add(session); return session; })); }