mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-10 04:50:02 +00:00
Utilise TokenManager and ExpiryManager
This commit is contained in:
@@ -3,8 +3,12 @@ package org.session.libsignal.utilities
|
||||
|
||||
import nl.komponents.kovenant.Promise
|
||||
import nl.komponents.kovenant.deferred
|
||||
import nl.komponents.kovenant.task
|
||||
import java.util.concurrent.TimeoutException
|
||||
|
||||
fun emptyPromise() = EMPTY_PROMISE
|
||||
private val EMPTY_PROMISE: Promise<*, java.lang.Exception> = task {}
|
||||
|
||||
fun <V, E : Throwable> Promise<V, E>.get(defaultValue: V): V {
|
||||
return try {
|
||||
get()
|
||||
|
@@ -28,3 +28,4 @@ fun <V, T : Promise<V, Exception>> retryIfNeeded(maxRetryCount: Int, retryInterv
|
||||
retryIfNeeded()
|
||||
return deferred.promise
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user