@ Override public Future < RawGcsCreationToken > continueObjectCreationAsync ( final RawGcsCreationToken token , final ByteBuffer chunk , long timeoutMillis ) { try { ensureInitialized ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } final Environment environment = ApiProxy . getCurrentEnvironment ( ) ; return writePool . schedule ( new Callable < RawGcsCreationToken > ( ) { @ Override public RawGcsCreationToken call ( ) throws Exception { ApiProxy . setEnvironmentForCurrentThread ( environment ) ; return append ( token , chunk ) ; } } , 50 , TimeUnit . MILLISECONDS ) ; }
Runs calls in a background thread so that the results will actually be asynchronous .