protected void put ( WonderPushRestClient . Request request , long delayMs ) { long notBeforeRealTimeElapsed = delayMs <= 0 ? delayMs : SystemClock . elapsedRealtime ( ) + delayMs ; long prevNotBeforeRealtimeElapsed = mJobQueue . peekNextJobNotBeforeRealtimeElapsed ( ) ; mJobQueue . postJobWithDescription ( request . toJSON ( ) , notBeforeRealTimeElapsed ) ; if ( notBeforeRealTimeElapsed < prevNotBeforeRealtimeElapsed ) { WonderPush . logDebug ( "RequestVault: Interrupting sleep" ) ; // Interrupt the worker thread so that it takes into account this new job in a timely manner mThread . interrupt ( ) ; } }
Save a request in the vault for future retry