public Observable < Mail > addMailWithDelay ( final Mail mail ) { return Observable . defer ( new Func0 < Observable < Mail > > ( ) { @ Override public Observable < Mail > call ( ) { delay ( ) ; Observable o = checkExceptions ( ) ; if ( o != null ) { return o ; } return Observable . just ( mail ) ; } } ) . flatMap ( new Func1 < Mail , Observable < Mail > > ( ) { @ Override public Observable < Mail > call ( Mail mail ) { return addMail ( mail ) ; } } ) ; }
Creates and saves a new mail